]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ENGR00293235 IPUv3: Refine register access
authorLiu Ying <Ying.Liu@freescale.com>
Tue, 24 Dec 2013 08:26:35 +0000 (16:26 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:51 +0000 (10:06 +0200)
commit69090bd5292d4a5b6741986378f6a920d2234551
tree90532f5ca48f8bd4a300d55351482293cc659b4c
parentf52528186e6108416a2445db66f83765a3f85f3f
ENGR00293235 IPUv3: Refine register access

The original IPUv3 driver uses readl()/writel() to
access the IPUv3 registers in the following way where
ipu->reg_base is a pointer which points to a 32 bit
I/O memory cell of a certain IPUv3 deblock's base address:
writel(value, ipu->reg_base + offset);
readl(ipu->reg_base + offset);

This makes the register offset values shrink 4 times,
comparing to the offset values documented in the
reference manual. For example, we need to change the
offset value from 0x003C to 0x003C/4 so that we may
access the register IPU_INT_CTRL_1 correctly.

This patch redefines the type of ipu->reg_base to
'void __iomem *', then the offset values can be the
same to what they are documented.

Also, this patch corrects some register relevant
macros by wrapping their arguments with parentheses
to avoid any unsafe decipher.

Reviewed-by: Robby Cai <R63905@freescale.com>
Cc: Oliver Brown <oliver.brown@freescale.com>
Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/mxc/ipu3/ipu_disp.c
drivers/mxc/ipu3/ipu_ic.c
drivers/mxc/ipu3/ipu_prv.h
drivers/mxc/ipu3/ipu_regs.h