diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-05-28 15:05:02 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-07-07 03:59:57 -0400 |
commit | 5b8d628ca4036e76a2d892f2c1d01b58d232809e (patch) | |
tree | e7e6107cc728527afba516ad87e2e0e7c308910a /arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | |
parent | 47e837b54c01083ce153493882fb8d74d108ae4a (diff) |
ARM: mx5: convert to new leds-gpio registration helper
This gets rid of per machine struct platform_device definitions and allows
to move the platform data and led definition to .init.rodata.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c')
-rw-r--r-- | arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c index 31c871ec46a6..261923997643 100644 --- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c +++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | |||
@@ -74,7 +74,7 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { | |||
74 | #define GPIO_LED1 IMX_GPIO_NR(3, 30) | 74 | #define GPIO_LED1 IMX_GPIO_NR(3, 30) |
75 | #define GPIO_SWITCH1 IMX_GPIO_NR(3, 31) | 75 | #define GPIO_SWITCH1 IMX_GPIO_NR(3, 31) |
76 | 76 | ||
77 | static struct gpio_led eukrea_mbimxsd_leds[] = { | 77 | static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = { |
78 | { | 78 | { |
79 | .name = "led1", | 79 | .name = "led1", |
80 | .default_trigger = "heartbeat", | 80 | .default_trigger = "heartbeat", |
@@ -83,19 +83,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = { | |||
83 | }, | 83 | }, |
84 | }; | 84 | }; |
85 | 85 | ||
86 | static struct gpio_led_platform_data eukrea_mbimxsd_led_info = { | 86 | static const struct gpio_led_platform_data |
87 | eukrea_mbimxsd_led_info __initconst = { | ||
87 | .leds = eukrea_mbimxsd_leds, | 88 | .leds = eukrea_mbimxsd_leds, |
88 | .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), | 89 | .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), |
89 | }; | 90 | }; |
90 | 91 | ||
91 | static struct platform_device eukrea_mbimxsd_leds_gpio = { | ||
92 | .name = "leds-gpio", | ||
93 | .id = -1, | ||
94 | .dev = { | ||
95 | .platform_data = &eukrea_mbimxsd_led_info, | ||
96 | }, | ||
97 | }; | ||
98 | |||
99 | static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { | 92 | static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { |
100 | { | 93 | { |
101 | .gpio = GPIO_SWITCH1, | 94 | .gpio = GPIO_SWITCH1, |
@@ -112,10 +105,6 @@ static const struct gpio_keys_platform_data | |||
112 | .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons), | 105 | .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons), |
113 | }; | 106 | }; |
114 | 107 | ||
115 | static struct platform_device *platform_devices[] __initdata = { | ||
116 | &eukrea_mbimxsd_leds_gpio, | ||
117 | }; | ||
118 | |||
119 | static const struct imxuart_platform_data uart_pdata __initconst = { | 108 | static const struct imxuart_platform_data uart_pdata __initconst = { |
120 | .flags = IMXUART_HAVE_RTSCTS, | 109 | .flags = IMXUART_HAVE_RTSCTS, |
121 | }; | 110 | }; |
@@ -154,6 +143,6 @@ void __init eukrea_mbimxsd51_baseboard_init(void) | |||
154 | i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, | 143 | i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, |
155 | ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); | 144 | ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); |
156 | 145 | ||
157 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 146 | gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); |
158 | imx_add_gpio_keys(&eukrea_mbimxsd_button_data); | 147 | imx_add_gpio_keys(&eukrea_mbimxsd_button_data); |
159 | } | 148 | } |