diff options
author | Lothar Waßmann <LW@KARO-electronics.de> | 2010-10-26 08:28:31 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-11-24 03:56:58 -0500 |
commit | 8f5260c8c1a1f9b25dfedd5ca749e4faef1b3eb9 (patch) | |
tree | 56f3a67b1cf74a670c026ab14cc872cf3accccb8 | |
parent | 2a85927c79634e89b9cd683dd2bae65966d9b216 (diff) |
ARM: i.MX IOMUX-V3 replace struct pad_desc with bitmapped cookie
The following patch is a first step to convert the 'struct pad_desc'
to a bitmapped cookie to facilitate adding platform specific pullup or
drive strength definitions to existing pad definitions without need to
rewrite the complete pad def.
The patch wraps 'struct pad_desc' in an opaque data type and
introduces macros to access the individual members.
This patch does not constitute any functional change!
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-eukrea_cpuimx25.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx25_3ds.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-cpuimx35.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx35_3ds.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-pcm043.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-cpuimx51.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-cpuimx51sd.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_3ds.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_babbage.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_efikamx.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/iomux-v3.h | 38 | ||||
-rw-r--r-- | arch/arm/plat-mxc/iomux-v3.c | 22 |
16 files changed, 70 insertions, 40 deletions
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c index 7cab720519ee..cb705c28de02 100644 --- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | #include "devices-imx25.h" | 38 | #include "devices-imx25.h" |
39 | 39 | ||
40 | static struct pad_desc eukrea_mbimxsd_pads[] = { | 40 | static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { |
41 | /* LCD */ | 41 | /* LCD */ |
42 | MX25_PAD_LD0__LD0, | 42 | MX25_PAD_LD0__LD0, |
43 | MX25_PAD_LD1__LD1, | 43 | MX25_PAD_LD1__LD1, |
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c index 67a7d55ad191..eb395aba9237 100644 --- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c +++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c | |||
@@ -46,7 +46,7 @@ static const struct imxuart_platform_data uart_pdata __initconst = { | |||
46 | .flags = IMXUART_HAVE_RTSCTS, | 46 | .flags = IMXUART_HAVE_RTSCTS, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static struct pad_desc eukrea_cpuimx25_pads[] = { | 49 | static iomux_v3_cfg_t eukrea_cpuimx25_pads[] = { |
50 | /* FEC - RMII */ | 50 | /* FEC - RMII */ |
51 | MX25_PAD_FEC_MDC__FEC_MDC, | 51 | MX25_PAD_FEC_MDC__FEC_MDC, |
52 | MX25_PAD_FEC_MDIO__FEC_MDIO, | 52 | MX25_PAD_FEC_MDIO__FEC_MDIO, |
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c index 52b4d9b3717d..8b8e75b93000 100644 --- a/arch/arm/mach-imx/mach-mx25_3ds.c +++ b/arch/arm/mach-imx/mach-mx25_3ds.c | |||
@@ -47,7 +47,7 @@ static const struct imxuart_platform_data uart_pdata __initconst = { | |||
47 | .flags = IMXUART_HAVE_RTSCTS, | 47 | .flags = IMXUART_HAVE_RTSCTS, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static struct pad_desc mx25pdk_pads[] = { | 50 | static iomux_v3_cfg_t mx25pdk_pads[] = { |
51 | MX25_PAD_FEC_MDC__FEC_MDC, | 51 | MX25_PAD_FEC_MDC__FEC_MDC, |
52 | MX25_PAD_FEC_MDIO__FEC_MDIO, | 52 | MX25_PAD_FEC_MDIO__FEC_MDIO, |
53 | MX25_PAD_FEC_TDATA0__FEC_TDATA0, | 53 | MX25_PAD_FEC_TDATA0__FEC_TDATA0, |
diff --git a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c index 950dbb13b19b..14a5ffc939ad 100644 --- a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c | |||
@@ -111,7 +111,7 @@ static struct mx3fb_platform_data mx3fb_pdata = { | |||
111 | .num_modes = ARRAY_SIZE(fb_modedb), | 111 | .num_modes = ARRAY_SIZE(fb_modedb), |
112 | }; | 112 | }; |
113 | 113 | ||
114 | static struct pad_desc eukrea_mbimxsd_pads[] = { | 114 | static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { |
115 | /* LCD */ | 115 | /* LCD */ |
116 | MX35_PAD_LD0__IPU_DISPB_DAT_0, | 116 | MX35_PAD_LD0__IPU_DISPB_DAT_0, |
117 | MX35_PAD_LD1__IPU_DISPB_DAT_1, | 117 | MX35_PAD_LD1__IPU_DISPB_DAT_1, |
diff --git a/arch/arm/mach-mx3/mach-cpuimx35.c b/arch/arm/mach-mx3/mach-cpuimx35.c index dda19883ffe2..26ae90f02582 100644 --- a/arch/arm/mach-mx3/mach-cpuimx35.c +++ b/arch/arm/mach-mx3/mach-cpuimx35.c | |||
@@ -72,7 +72,7 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { | |||
72 | }, | 72 | }, |
73 | }; | 73 | }; |
74 | 74 | ||
75 | static struct pad_desc eukrea_cpuimx35_pads[] = { | 75 | static iomux_v3_cfg_t eukrea_cpuimx35_pads[] = { |
76 | /* UART1 */ | 76 | /* UART1 */ |
77 | MX35_PAD_CTS1__UART1_CTS, | 77 | MX35_PAD_CTS1__UART1_CTS, |
78 | MX35_PAD_RTS1__UART1_RTS, | 78 | MX35_PAD_RTS1__UART1_RTS, |
diff --git a/arch/arm/mach-mx3/mach-mx35_3ds.c b/arch/arm/mach-mx3/mach-mx35_3ds.c index 7e73153b2b6b..8bd8992ffaa5 100644 --- a/arch/arm/mach-mx3/mach-mx35_3ds.c +++ b/arch/arm/mach-mx3/mach-mx35_3ds.c | |||
@@ -79,7 +79,7 @@ static struct platform_device *devices[] __initdata = { | |||
79 | &mx35pdk_flash, | 79 | &mx35pdk_flash, |
80 | }; | 80 | }; |
81 | 81 | ||
82 | static struct pad_desc mx35pdk_pads[] = { | 82 | static iomux_v3_cfg_t mx35pdk_pads[] = { |
83 | /* UART1 */ | 83 | /* UART1 */ |
84 | MX35_PAD_CTS1__UART1_CTS, | 84 | MX35_PAD_CTS1__UART1_CTS, |
85 | MX35_PAD_RTS1__UART1_RTS, | 85 | MX35_PAD_RTS1__UART1_RTS, |
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c index 826c6dc2f4c8..e229a7476f0a 100644 --- a/arch/arm/mach-mx3/mach-pcm043.c +++ b/arch/arm/mach-mx3/mach-pcm043.c | |||
@@ -140,7 +140,7 @@ static struct platform_device *devices[] __initdata = { | |||
140 | &pcm043_flash, | 140 | &pcm043_flash, |
141 | }; | 141 | }; |
142 | 142 | ||
143 | static struct pad_desc pcm043_pads[] = { | 143 | static iomux_v3_cfg_t pcm043_pads[] = { |
144 | /* UART1 */ | 144 | /* UART1 */ |
145 | MX35_PAD_CTS1__UART1_CTS, | 145 | MX35_PAD_CTS1__UART1_CTS, |
146 | MX35_PAD_RTS1__UART1_RTS, | 146 | MX35_PAD_RTS1__UART1_RTS, |
@@ -227,8 +227,8 @@ static struct pad_desc pcm043_pads[] = { | |||
227 | 227 | ||
228 | static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) | 228 | static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) |
229 | { | 229 | { |
230 | struct pad_desc txfs_gpio = MX35_PAD_STXFS4__GPIO2_31; | 230 | iomux_v3_cfg_t txfs_gpio = MX35_PAD_STXFS4__GPIO2_31; |
231 | struct pad_desc txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; | 231 | iomux_v3_cfg_t txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; |
232 | int ret; | 232 | int ret; |
233 | 233 | ||
234 | ret = gpio_request(AC97_GPIO_TXFS, "SSI"); | 234 | ret = gpio_request(AC97_GPIO_TXFS, "SSI"); |
@@ -250,11 +250,11 @@ static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) | |||
250 | 250 | ||
251 | static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97) | 251 | static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97) |
252 | { | 252 | { |
253 | struct pad_desc txfs_gpio = MX35_PAD_STXFS4__GPIO2_31; | 253 | iomux_v3_cfg_t txfs_gpio = MX35_PAD_STXFS4__GPIO2_31; |
254 | struct pad_desc txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; | 254 | iomux_v3_cfg_t txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS; |
255 | struct pad_desc txd_gpio = MX35_PAD_STXD4__GPIO2_28; | 255 | iomux_v3_cfg_t txd_gpio = MX35_PAD_STXD4__GPIO2_28; |
256 | struct pad_desc txd = MX35_PAD_STXD4__AUDMUX_AUD4_TXD; | 256 | iomux_v3_cfg_t txd = MX35_PAD_STXD4__AUDMUX_AUD4_TXD; |
257 | struct pad_desc reset_gpio = MX35_PAD_SD2_CMD__GPIO2_0; | 257 | iomux_v3_cfg_t reset_gpio = MX35_PAD_SD2_CMD__GPIO2_0; |
258 | int ret; | 258 | int ret; |
259 | 259 | ||
260 | ret = gpio_request(AC97_GPIO_TXFS, "SSI"); | 260 | ret = gpio_request(AC97_GPIO_TXFS, "SSI"); |
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c index 6a9792fd0a76..bfbc14af589e 100644 --- a/arch/arm/mach-mx5/board-cpuimx51.c +++ b/arch/arm/mach-mx5/board-cpuimx51.c | |||
@@ -113,7 +113,7 @@ static struct platform_device *devices[] __initdata = { | |||
113 | #endif | 113 | #endif |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static struct pad_desc eukrea_cpuimx51_pads[] = { | 116 | static iomux_v3_cfg_t eukrea_cpuimx51_pads[] = { |
117 | /* UART1 */ | 117 | /* UART1 */ |
118 | MX51_PAD_UART1_RXD__UART1_RXD, | 118 | MX51_PAD_UART1_RXD__UART1_RXD, |
119 | MX51_PAD_UART1_TXD__UART1_TXD, | 119 | MX51_PAD_UART1_TXD__UART1_TXD, |
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c index 4b3a6119c5fb..e6807e36e436 100644 --- a/arch/arm/mach-mx5/board-cpuimx51sd.c +++ b/arch/arm/mach-mx5/board-cpuimx51sd.c | |||
@@ -68,7 +68,7 @@ | |||
68 | #define CPUIMX51SD_GPIO_3_12 IOMUX_PAD(0x57C, 0x194, 3, 0x0, 0, \ | 68 | #define CPUIMX51SD_GPIO_3_12 IOMUX_PAD(0x57C, 0x194, 3, 0x0, 0, \ |
69 | MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP) | 69 | MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP) |
70 | 70 | ||
71 | static struct pad_desc eukrea_cpuimx51sd_pads[] = { | 71 | static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = { |
72 | /* UART1 */ | 72 | /* UART1 */ |
73 | MX51_PAD_UART1_RXD__UART1_RXD, | 73 | MX51_PAD_UART1_RXD__UART1_RXD, |
74 | MX51_PAD_UART1_TXD__UART1_TXD, | 74 | MX51_PAD_UART1_TXD__UART1_TXD, |
diff --git a/arch/arm/mach-mx5/board-mx51_3ds.c b/arch/arm/mach-mx5/board-mx51_3ds.c index 79ce8dcf3cda..ba5805f33adf 100644 --- a/arch/arm/mach-mx5/board-mx51_3ds.c +++ b/arch/arm/mach-mx5/board-mx51_3ds.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) | 30 | #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 6) |
31 | #define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) | 31 | #define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) |
32 | 32 | ||
33 | static struct pad_desc mx51_3ds_pads[] = { | 33 | static iomux_v3_cfg_t mx51_3ds_pads[] = { |
34 | /* UART1 */ | 34 | /* UART1 */ |
35 | MX51_PAD_UART1_RXD__UART1_RXD, | 35 | MX51_PAD_UART1_RXD__UART1_RXD, |
36 | MX51_PAD_UART1_TXD__UART1_TXD, | 36 | MX51_PAD_UART1_TXD__UART1_TXD, |
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index 542f2b147dcc..0df50d214db8 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c | |||
@@ -65,7 +65,7 @@ static const struct gpio_keys_platform_data imx_button_data __initconst = { | |||
65 | .nbuttons = ARRAY_SIZE(babbage_buttons), | 65 | .nbuttons = ARRAY_SIZE(babbage_buttons), |
66 | }; | 66 | }; |
67 | 67 | ||
68 | static struct pad_desc mx51babbage_pads[] = { | 68 | static iomux_v3_cfg_t mx51babbage_pads[] = { |
69 | /* UART1 */ | 69 | /* UART1 */ |
70 | MX51_PAD_UART1_RXD__UART1_RXD, | 70 | MX51_PAD_UART1_RXD__UART1_RXD, |
71 | MX51_PAD_UART1_TXD__UART1_TXD, | 71 | MX51_PAD_UART1_TXD__UART1_TXD, |
@@ -177,8 +177,8 @@ static struct imxi2c_platform_data babbage_hsi2c_data = { | |||
177 | 177 | ||
178 | static int gpio_usbh1_active(void) | 178 | static int gpio_usbh1_active(void) |
179 | { | 179 | { |
180 | struct pad_desc usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO_1_27; | 180 | iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO_1_27; |
181 | struct pad_desc phyreset_gpio = MX51_PAD_EIM_D21__GPIO_2_5; | 181 | iomux_v3_cfg_t phyreset_gpio = MX51_PAD_EIM_D21__GPIO_2_5; |
182 | int ret; | 182 | int ret; |
183 | 183 | ||
184 | /* Set USBH1_STP to GPIO and toggle it */ | 184 | /* Set USBH1_STP to GPIO and toggle it */ |
@@ -315,8 +315,8 @@ __setup("otg_mode=", babbage_otg_mode); | |||
315 | */ | 315 | */ |
316 | static void __init mxc_board_init(void) | 316 | static void __init mxc_board_init(void) |
317 | { | 317 | { |
318 | struct pad_desc usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; | 318 | iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; |
319 | struct pad_desc power_key = MX51_PAD_EIM_A27__GPIO_2_21; | 319 | iomux_v3_cfg_t power_key = MX51_PAD_EIM_A27__GPIO_2_21; |
320 | 320 | ||
321 | #if defined(CONFIG_CPU_FREQ_IMX) | 321 | #if defined(CONFIG_CPU_FREQ_IMX) |
322 | get_cpu_op = mx51_get_cpu_op; | 322 | get_cpu_op = mx51_get_cpu_op; |
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c index 6e623bda3ee7..1b1d4f14d486 100644 --- a/arch/arm/mach-mx5/board-mx51_efikamx.c +++ b/arch/arm/mach-mx5/board-mx51_efikamx.c | |||
@@ -39,7 +39,7 @@ | |||
39 | 39 | ||
40 | #define MX51_USB_PLL_DIV_24_MHZ 0x01 | 40 | #define MX51_USB_PLL_DIV_24_MHZ 0x01 |
41 | 41 | ||
42 | static struct pad_desc mx51efikamx_pads[] = { | 42 | static iomux_v3_cfg_t mx51efikamx_pads[] = { |
43 | /* UART1 */ | 43 | /* UART1 */ |
44 | MX51_PAD_UART1_RXD__UART1_RXD, | 44 | MX51_PAD_UART1_RXD__UART1_RXD, |
45 | MX51_PAD_UART1_TXD__UART1_TXD, | 45 | MX51_PAD_UART1_TXD__UART1_TXD, |
diff --git a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c index 4e74b9907b7c..b830967f4bec 100644 --- a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c | |||
@@ -84,7 +84,7 @@ static struct platform_device *devices[] __initdata = { | |||
84 | &mbimx51_leds_gpio, | 84 | &mbimx51_leds_gpio, |
85 | }; | 85 | }; |
86 | 86 | ||
87 | static struct pad_desc mbimx51_pads[] = { | 87 | static iomux_v3_cfg_t mbimx51_pads[] = { |
88 | /* UART2 */ | 88 | /* UART2 */ |
89 | MX51_PAD_UART2_RXD__UART2_RXD, | 89 | MX51_PAD_UART2_RXD__UART2_RXD, |
90 | MX51_PAD_UART2_TXD__UART2_TXD, | 90 | MX51_PAD_UART2_TXD__UART2_TXD, |
diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c index 038d8c94f79e..2751b11ead89 100644 --- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | |||
@@ -48,7 +48,7 @@ | |||
48 | #define MBIMXSD_GPIO_3_31 IOMUX_PAD(0x554, 0x16C, 3, 0x0, 0, \ | 48 | #define MBIMXSD_GPIO_3_31 IOMUX_PAD(0x554, 0x16C, 3, 0x0, 0, \ |
49 | MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP) | 49 | MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP) |
50 | 50 | ||
51 | static struct pad_desc eukrea_mbimxsd_pads[] = { | 51 | static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { |
52 | /* LED */ | 52 | /* LED */ |
53 | MX51_PAD_NANDF_D10__GPIO_3_30, | 53 | MX51_PAD_NANDF_D10__GPIO_3_30, |
54 | /* SWITCH */ | 54 | /* SWITCH */ |
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h index 0880a4a1aed1..811716fbfbe6 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-v3.h +++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h | |||
@@ -44,7 +44,7 @@ | |||
44 | * | 44 | * |
45 | */ | 45 | */ |
46 | 46 | ||
47 | struct pad_desc { | 47 | typedef struct deprecated_pad_desc { |
48 | unsigned mux_ctrl_ofs:12; /* IOMUXC_SW_MUX_CTL_PAD offset */ | 48 | unsigned mux_ctrl_ofs:12; /* IOMUXC_SW_MUX_CTL_PAD offset */ |
49 | unsigned mux_mode:8; | 49 | unsigned mux_mode:8; |
50 | unsigned pad_ctrl_ofs:12; /* IOMUXC_SW_PAD_CTRL offset */ | 50 | unsigned pad_ctrl_ofs:12; /* IOMUXC_SW_PAD_CTRL offset */ |
@@ -52,7 +52,37 @@ struct pad_desc { | |||
52 | unsigned pad_ctrl:17; | 52 | unsigned pad_ctrl:17; |
53 | unsigned select_input_ofs:12; /* IOMUXC_SELECT_INPUT offset */ | 53 | unsigned select_input_ofs:12; /* IOMUXC_SELECT_INPUT offset */ |
54 | unsigned select_input:3; | 54 | unsigned select_input:3; |
55 | }; | 55 | } iomux_v3_cfg_t; |
56 | |||
57 | static inline unsigned int MUX_CTRL_OFS(iomux_v3_cfg_t *pad) | ||
58 | { | ||
59 | return pad->mux_ctrl_ofs; | ||
60 | } | ||
61 | |||
62 | static inline unsigned int MUX_MODE(iomux_v3_cfg_t *pad) | ||
63 | { | ||
64 | return pad->mux_mode; | ||
65 | } | ||
66 | |||
67 | static inline unsigned int MUX_SELECT_INPUT_OFS(iomux_v3_cfg_t *pad) | ||
68 | { | ||
69 | return pad->select_input_ofs; | ||
70 | } | ||
71 | |||
72 | static inline unsigned int MUX_SELECT_INPUT(iomux_v3_cfg_t *pad) | ||
73 | { | ||
74 | return pad->select_input; | ||
75 | } | ||
76 | |||
77 | static inline unsigned int MUX_PAD_CTRL_OFS(iomux_v3_cfg_t *pad) | ||
78 | { | ||
79 | return pad->pad_ctrl_ofs; | ||
80 | } | ||
81 | |||
82 | static inline unsigned int MUX_PAD_CTRL(iomux_v3_cfg_t *pad) | ||
83 | { | ||
84 | return pad->pad_ctrl; | ||
85 | } | ||
56 | 86 | ||
57 | #define IOMUX_PAD(_pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _select_input_ofs, \ | 87 | #define IOMUX_PAD(_pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _select_input_ofs, \ |
58 | _select_input, _pad_ctrl) \ | 88 | _select_input, _pad_ctrl) \ |
@@ -107,13 +137,13 @@ struct pad_desc { | |||
107 | /* | 137 | /* |
108 | * setups a single pad in the iomuxer | 138 | * setups a single pad in the iomuxer |
109 | */ | 139 | */ |
110 | int mxc_iomux_v3_setup_pad(struct pad_desc *pad); | 140 | int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t *pad); |
111 | 141 | ||
112 | /* | 142 | /* |
113 | * setups mutliple pads | 143 | * setups mutliple pads |
114 | * convenient way to call the above function with tables | 144 | * convenient way to call the above function with tables |
115 | */ | 145 | */ |
116 | int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count); | 146 | int mxc_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t *pad_list, unsigned count); |
117 | 147 | ||
118 | /* | 148 | /* |
119 | * Initialise the iomux controller | 149 | * Initialise the iomux controller |
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c index b318c6a222d5..975ca7cdf9ad 100644 --- a/arch/arm/plat-mxc/iomux-v3.c +++ b/arch/arm/plat-mxc/iomux-v3.c | |||
@@ -32,26 +32,26 @@ | |||
32 | static void __iomem *base; | 32 | static void __iomem *base; |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * setups a single pad in the iomuxer | 35 | * configures a single pad in the iomuxer |
36 | */ | 36 | */ |
37 | int mxc_iomux_v3_setup_pad(struct pad_desc *pad) | 37 | int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t *pad) |
38 | { | 38 | { |
39 | if (pad->mux_ctrl_ofs) | 39 | if (MUX_CTRL_OFS(pad)) |
40 | __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs); | 40 | __raw_writel(MUX_MODE(pad), base + MUX_CTRL_OFS(pad)); |
41 | 41 | ||
42 | if (pad->select_input_ofs) | 42 | if (MUX_SELECT_INPUT_OFS(pad)) |
43 | __raw_writel(pad->select_input, | 43 | __raw_writel(MUX_SELECT_INPUT(pad), |
44 | base + pad->select_input_ofs); | 44 | base + MUX_SELECT_INPUT(pad)); |
45 | 45 | ||
46 | if (!(pad->pad_ctrl & NO_PAD_CTRL) && pad->pad_ctrl_ofs) | 46 | if (!(MUX_PAD_CTRL(pad) & NO_PAD_CTRL) && MUX_PAD_CTRL_OFS(pad)) |
47 | __raw_writel(pad->pad_ctrl, base + pad->pad_ctrl_ofs); | 47 | __raw_writel(MUX_PAD_CTRL(pad), base + MUX_PAD_CTRL_OFS(pad)); |
48 | return 0; | 48 | return 0; |
49 | } | 49 | } |
50 | EXPORT_SYMBOL(mxc_iomux_v3_setup_pad); | 50 | EXPORT_SYMBOL(mxc_iomux_v3_setup_pad); |
51 | 51 | ||
52 | int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count) | 52 | int mxc_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t *pad_list, unsigned count) |
53 | { | 53 | { |
54 | struct pad_desc *p = pad_list; | 54 | iomux_v3_cfg_t *p = pad_list; |
55 | int i; | 55 | int i; |
56 | int ret; | 56 | int ret; |
57 | 57 | ||