]> git.karo-electronics.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>
Mon, 16 Jun 2014 16:09:20 +0000 (18:09 +0200)
commit541d1f45acd03b6994acfaf552a8b7e74bd9dc5d
tree6006f9b9adb9de5c3c67b0f5139cd02a93dbcb55
parentfe5a4c79d9c38df7fc852ff815693d0f3e041edb
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