usb: chipidea: mark register map as "const" and convert to u8
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 6 Jan 2014 02:10:39 +0000 (10:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jan 2014 00:21:06 +0000 (16:21 -0800)
This patch makes the controller register map ci_regs_nolpm and ci_regs_lpm as
"const". Further, as all offset fit into a single byte, the type is changed
from uintptr_t to u8.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/core.c

index b9385c1..458d8e4 100644 (file)
 #include "otg.h"
 
 /* Controller register map */
-static uintptr_t ci_regs_nolpm[] = {
-       [CAP_CAPLENGTH]         = 0x000UL,
-       [CAP_HCCPARAMS]         = 0x008UL,
-       [CAP_DCCPARAMS]         = 0x024UL,
-       [CAP_TESTMODE]          = 0x038UL,
-       [OP_USBCMD]             = 0x000UL,
-       [OP_USBSTS]             = 0x004UL,
-       [OP_USBINTR]            = 0x008UL,
-       [OP_DEVICEADDR]         = 0x014UL,
-       [OP_ENDPTLISTADDR]      = 0x018UL,
-       [OP_PORTSC]             = 0x044UL,
-       [OP_DEVLC]              = 0x084UL,
-       [OP_OTGSC]              = 0x064UL,
-       [OP_USBMODE]            = 0x068UL,
-       [OP_ENDPTSETUPSTAT]     = 0x06CUL,
-       [OP_ENDPTPRIME]         = 0x070UL,
-       [OP_ENDPTFLUSH]         = 0x074UL,
-       [OP_ENDPTSTAT]          = 0x078UL,
-       [OP_ENDPTCOMPLETE]      = 0x07CUL,
-       [OP_ENDPTCTRL]          = 0x080UL,
+static const u8 ci_regs_nolpm[] = {
+       [CAP_CAPLENGTH]         = 0x00U,
+       [CAP_HCCPARAMS]         = 0x08U,
+       [CAP_DCCPARAMS]         = 0x24U,
+       [CAP_TESTMODE]          = 0x38U,
+       [OP_USBCMD]             = 0x00U,
+       [OP_USBSTS]             = 0x04U,
+       [OP_USBINTR]            = 0x08U,
+       [OP_DEVICEADDR]         = 0x14U,
+       [OP_ENDPTLISTADDR]      = 0x18U,
+       [OP_PORTSC]             = 0x44U,
+       [OP_DEVLC]              = 0x84U,
+       [OP_OTGSC]              = 0x64U,
+       [OP_USBMODE]            = 0x68U,
+       [OP_ENDPTSETUPSTAT]     = 0x6CU,
+       [OP_ENDPTPRIME]         = 0x70U,
+       [OP_ENDPTFLUSH]         = 0x74U,
+       [OP_ENDPTSTAT]          = 0x78U,
+       [OP_ENDPTCOMPLETE]      = 0x7CU,
+       [OP_ENDPTCTRL]          = 0x80U,
 };
 
-static uintptr_t ci_regs_lpm[] = {
-       [CAP_CAPLENGTH]         = 0x000UL,
-       [CAP_HCCPARAMS]         = 0x008UL,
-       [CAP_DCCPARAMS]         = 0x024UL,
-       [CAP_TESTMODE]          = 0x0FCUL,
-       [OP_USBCMD]             = 0x000UL,
-       [OP_USBSTS]             = 0x004UL,
-       [OP_USBINTR]            = 0x008UL,
-       [OP_DEVICEADDR]         = 0x014UL,
-       [OP_ENDPTLISTADDR]      = 0x018UL,
-       [OP_PORTSC]             = 0x044UL,
-       [OP_DEVLC]              = 0x084UL,
-       [OP_OTGSC]              = 0x0C4UL,
-       [OP_USBMODE]            = 0x0C8UL,
-       [OP_ENDPTSETUPSTAT]     = 0x0D8UL,
-       [OP_ENDPTPRIME]         = 0x0DCUL,
-       [OP_ENDPTFLUSH]         = 0x0E0UL,
-       [OP_ENDPTSTAT]          = 0x0E4UL,
-       [OP_ENDPTCOMPLETE]      = 0x0E8UL,
-       [OP_ENDPTCTRL]          = 0x0ECUL,
+static const u8 ci_regs_lpm[] = {
+       [CAP_CAPLENGTH]         = 0x00U,
+       [CAP_HCCPARAMS]         = 0x08U,
+       [CAP_DCCPARAMS]         = 0x24U,
+       [CAP_TESTMODE]          = 0xFCU,
+       [OP_USBCMD]             = 0x00U,
+       [OP_USBSTS]             = 0x04U,
+       [OP_USBINTR]            = 0x08U,
+       [OP_DEVICEADDR]         = 0x14U,
+       [OP_ENDPTLISTADDR]      = 0x18U,
+       [OP_PORTSC]             = 0x44U,
+       [OP_DEVLC]              = 0x84U,
+       [OP_OTGSC]              = 0xC4U,
+       [OP_USBMODE]            = 0xC8U,
+       [OP_ENDPTSETUPSTAT]     = 0xD8U,
+       [OP_ENDPTPRIME]         = 0xDCU,
+       [OP_ENDPTFLUSH]         = 0xE0U,
+       [OP_ENDPTSTAT]          = 0xE4U,
+       [OP_ENDPTCOMPLETE]      = 0xE8U,
+       [OP_ENDPTCTRL]          = 0xECU,
 };
 
 static int hw_alloc_regmap(struct ci_hdrc *ci, bool is_lpm)