diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-11-04 10:48:46 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-12-16 08:46:14 -0500 |
commit | 7bd1822135175354e1662cc890a156f1d89dc211 (patch) | |
tree | 91c0278ee0cfb2728bee25ff9fd3ca171d225ab8 /arch/arm/mach-mx2/pcm038.c | |
parent | d1900d3a18b114eabc15f6369f64439c248d55f3 (diff) |
[ARM] MX1/MX2: simplify mxc_gpio_setup_multiple_pins
mxc_gpio_setup_multiple_pins used to take several ALLOC_MODE flags. Most
of them are unused, so simplify the function by removing the flags. Also,
instead of using a confusing MXC_GPIO_ALLOC_MODE_RELEASE flag in a function
having alloc in its name, add a mxc_gpio_release_multiple_pins function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2/pcm038.c')
-rw-r--r-- | arch/arm/mach-mx2/pcm038.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index ac516b1d3f77..91a1e4bbccbc 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c | |||
@@ -64,15 +64,14 @@ static int mxc_uart0_pins[] = { | |||
64 | static int uart_mxc_port0_init(struct platform_device *pdev) | 64 | static int uart_mxc_port0_init(struct platform_device *pdev) |
65 | { | 65 | { |
66 | return mxc_gpio_setup_multiple_pins(mxc_uart0_pins, | 66 | return mxc_gpio_setup_multiple_pins(mxc_uart0_pins, |
67 | ARRAY_SIZE(mxc_uart0_pins), | 67 | ARRAY_SIZE(mxc_uart0_pins), "UART0"); |
68 | MXC_GPIO_ALLOC_MODE_NORMAL, "UART0"); | ||
69 | } | 68 | } |
70 | 69 | ||
71 | static int uart_mxc_port0_exit(struct platform_device *pdev) | 70 | static int uart_mxc_port0_exit(struct platform_device *pdev) |
72 | { | 71 | { |
73 | return mxc_gpio_setup_multiple_pins(mxc_uart0_pins, | 72 | mxc_gpio_release_multiple_pins(mxc_uart0_pins, |
74 | ARRAY_SIZE(mxc_uart0_pins), | 73 | ARRAY_SIZE(mxc_uart0_pins)); |
75 | MXC_GPIO_ALLOC_MODE_RELEASE, "UART0"); | 74 | return 0; |
76 | } | 75 | } |
77 | 76 | ||
78 | static int mxc_uart1_pins[] = { | 77 | static int mxc_uart1_pins[] = { |
@@ -85,15 +84,14 @@ static int mxc_uart1_pins[] = { | |||
85 | static int uart_mxc_port1_init(struct platform_device *pdev) | 84 | static int uart_mxc_port1_init(struct platform_device *pdev) |
86 | { | 85 | { |
87 | return mxc_gpio_setup_multiple_pins(mxc_uart1_pins, | 86 | return mxc_gpio_setup_multiple_pins(mxc_uart1_pins, |
88 | ARRAY_SIZE(mxc_uart1_pins), | 87 | ARRAY_SIZE(mxc_uart1_pins), "UART1"); |
89 | MXC_GPIO_ALLOC_MODE_NORMAL, "UART1"); | ||
90 | } | 88 | } |
91 | 89 | ||
92 | static int uart_mxc_port1_exit(struct platform_device *pdev) | 90 | static int uart_mxc_port1_exit(struct platform_device *pdev) |
93 | { | 91 | { |
94 | return mxc_gpio_setup_multiple_pins(mxc_uart1_pins, | 92 | mxc_gpio_release_multiple_pins(mxc_uart1_pins, |
95 | ARRAY_SIZE(mxc_uart1_pins), | 93 | ARRAY_SIZE(mxc_uart1_pins)); |
96 | MXC_GPIO_ALLOC_MODE_RELEASE, "UART1"); | 94 | return 0; |
97 | } | 95 | } |
98 | 96 | ||
99 | static int mxc_uart2_pins[] = { PE10_PF_UART3_CTS, | 97 | static int mxc_uart2_pins[] = { PE10_PF_UART3_CTS, |
@@ -104,15 +102,14 @@ static int mxc_uart2_pins[] = { PE10_PF_UART3_CTS, | |||
104 | static int uart_mxc_port2_init(struct platform_device *pdev) | 102 | static int uart_mxc_port2_init(struct platform_device *pdev) |
105 | { | 103 | { |
106 | return mxc_gpio_setup_multiple_pins(mxc_uart2_pins, | 104 | return mxc_gpio_setup_multiple_pins(mxc_uart2_pins, |
107 | ARRAY_SIZE(mxc_uart2_pins), | 105 | ARRAY_SIZE(mxc_uart2_pins), "UART2"); |
108 | MXC_GPIO_ALLOC_MODE_NORMAL, "UART2"); | ||
109 | } | 106 | } |
110 | 107 | ||
111 | static int uart_mxc_port2_exit(struct platform_device *pdev) | 108 | static int uart_mxc_port2_exit(struct platform_device *pdev) |
112 | { | 109 | { |
113 | return mxc_gpio_setup_multiple_pins(mxc_uart2_pins, | 110 | mxc_gpio_release_multiple_pins(mxc_uart2_pins, |
114 | ARRAY_SIZE(mxc_uart2_pins), | 111 | ARRAY_SIZE(mxc_uart2_pins)); |
115 | MXC_GPIO_ALLOC_MODE_RELEASE, "UART2"); | 112 | return 0; |
116 | } | 113 | } |
117 | 114 | ||
118 | static struct imxuart_platform_data uart_pdata[] = { | 115 | static struct imxuart_platform_data uart_pdata[] = { |
@@ -155,15 +152,13 @@ static int mxc_fec_pins[] = { | |||
155 | static void gpio_fec_active(void) | 152 | static void gpio_fec_active(void) |
156 | { | 153 | { |
157 | mxc_gpio_setup_multiple_pins(mxc_fec_pins, | 154 | mxc_gpio_setup_multiple_pins(mxc_fec_pins, |
158 | ARRAY_SIZE(mxc_fec_pins), | 155 | ARRAY_SIZE(mxc_fec_pins), "FEC"); |
159 | MXC_GPIO_ALLOC_MODE_NORMAL, "FEC"); | ||
160 | } | 156 | } |
161 | 157 | ||
162 | static void gpio_fec_inactive(void) | 158 | static void gpio_fec_inactive(void) |
163 | { | 159 | { |
164 | mxc_gpio_setup_multiple_pins(mxc_fec_pins, | 160 | mxc_gpio_release_multiple_pins(mxc_fec_pins, |
165 | ARRAY_SIZE(mxc_fec_pins), | 161 | ARRAY_SIZE(mxc_fec_pins)); |
166 | MXC_GPIO_ALLOC_MODE_RELEASE, "FEC"); | ||
167 | } | 162 | } |
168 | 163 | ||
169 | static struct platform_device *platform_devices[] __initdata = { | 164 | static struct platform_device *platform_devices[] __initdata = { |