diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-24 06:57:46 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-01-28 02:28:35 -0500 |
commit | ef19660b0aac537928a13a4087908cc23fa4c002 (patch) | |
tree | 1ca52e1f02f6544db7809275a43339c392276753 /arch/arm/mach-mxs/gpio.c | |
parent | 376e9c5848abef8c72c09bd89f2f7ee128caa104 (diff) |
ARM i.MX23/28: deobfuscate gpio initialization
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@freescale.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mxs/gpio.c')
-rw-r--r-- | arch/arm/mach-mxs/gpio.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/arm/mach-mxs/gpio.c b/arch/arm/mach-mxs/gpio.c index d7ad7a61366d..36df2d751749 100644 --- a/arch/arm/mach-mxs/gpio.c +++ b/arch/arm/mach-mxs/gpio.c | |||
@@ -297,20 +297,17 @@ int __init mxs_gpio_init(struct mxs_gpio_port *port, int cnt) | |||
297 | .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \ | 297 | .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \ |
298 | } | 298 | } |
299 | 299 | ||
300 | #define DEFINE_REGISTER_FUNCTION(prefix) \ | ||
301 | int __init prefix ## _register_gpios(void) \ | ||
302 | { \ | ||
303 | return mxs_gpio_init(prefix ## _gpio_ports, \ | ||
304 | ARRAY_SIZE(prefix ## _gpio_ports)); \ | ||
305 | } | ||
306 | |||
307 | #ifdef CONFIG_SOC_IMX23 | 300 | #ifdef CONFIG_SOC_IMX23 |
308 | static struct mxs_gpio_port mx23_gpio_ports[] = { | 301 | static struct mxs_gpio_port mx23_gpio_ports[] = { |
309 | DEFINE_MXS_GPIO_PORT(MX23, 0), | 302 | DEFINE_MXS_GPIO_PORT(MX23, 0), |
310 | DEFINE_MXS_GPIO_PORT(MX23, 1), | 303 | DEFINE_MXS_GPIO_PORT(MX23, 1), |
311 | DEFINE_MXS_GPIO_PORT(MX23, 2), | 304 | DEFINE_MXS_GPIO_PORT(MX23, 2), |
312 | }; | 305 | }; |
313 | DEFINE_REGISTER_FUNCTION(mx23) | 306 | |
307 | int __init mx23_register_gpios(void) | ||
308 | { | ||
309 | return mxs_gpio_init(mx23_gpio_ports, ARRAY_SIZE(mx23_gpio_ports)); | ||
310 | } | ||
314 | #endif | 311 | #endif |
315 | 312 | ||
316 | #ifdef CONFIG_SOC_IMX28 | 313 | #ifdef CONFIG_SOC_IMX28 |
@@ -321,5 +318,9 @@ static struct mxs_gpio_port mx28_gpio_ports[] = { | |||
321 | DEFINE_MXS_GPIO_PORT(MX28, 3), | 318 | DEFINE_MXS_GPIO_PORT(MX28, 3), |
322 | DEFINE_MXS_GPIO_PORT(MX28, 4), | 319 | DEFINE_MXS_GPIO_PORT(MX28, 4), |
323 | }; | 320 | }; |
324 | DEFINE_REGISTER_FUNCTION(mx28) | 321 | |
322 | int __init mx28_register_gpios(void) | ||
323 | { | ||
324 | return mxs_gpio_init(mx28_gpio_ports, ARRAY_SIZE(mx28_gpio_ports)); | ||
325 | } | ||
325 | #endif | 326 | #endif |