diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-09 21:43:32 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-04-02 21:30:34 -0400 |
commit | 48b1e3e80f742bff0f469245f2d05007af9af92e (patch) | |
tree | 0d9f611aa68f6bb9c850cac35d56bdf39389a133 | |
parent | dc3465a943ed2dd5de37d3d60df5c4e11c49efcb (diff) |
ARM: shmobile: marzen: Add GPIO LEDs
The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
support them.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/mach-shmobile/board-marzen.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index 5852331743e7..a88f7f3594c7 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/io.h> | 27 | #include <linux/io.h> |
28 | #include <linux/leds.h> | ||
28 | #include <linux/dma-mapping.h> | 29 | #include <linux/dma-mapping.h> |
29 | #include <linux/pinctrl/machine.h> | 30 | #include <linux/pinctrl/machine.h> |
30 | #include <linux/regulator/fixed.h> | 31 | #include <linux/regulator/fixed.h> |
@@ -168,12 +169,43 @@ static struct platform_device usb_phy_device = { | |||
168 | .num_resources = ARRAY_SIZE(usb_phy_resources), | 169 | .num_resources = ARRAY_SIZE(usb_phy_resources), |
169 | }; | 170 | }; |
170 | 171 | ||
172 | /* LEDS */ | ||
173 | static struct gpio_led marzen_leds[] = { | ||
174 | { | ||
175 | .name = "led2", | ||
176 | .gpio = 157, | ||
177 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
178 | }, { | ||
179 | .name = "led3", | ||
180 | .gpio = 158, | ||
181 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
182 | }, { | ||
183 | .name = "led4", | ||
184 | .gpio = 159, | ||
185 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
186 | }, | ||
187 | }; | ||
188 | |||
189 | static struct gpio_led_platform_data marzen_leds_pdata = { | ||
190 | .leds = marzen_leds, | ||
191 | .num_leds = ARRAY_SIZE(marzen_leds), | ||
192 | }; | ||
193 | |||
194 | static struct platform_device leds_device = { | ||
195 | .name = "leds-gpio", | ||
196 | .id = 0, | ||
197 | .dev = { | ||
198 | .platform_data = &marzen_leds_pdata, | ||
199 | }, | ||
200 | }; | ||
201 | |||
171 | static struct platform_device *marzen_devices[] __initdata = { | 202 | static struct platform_device *marzen_devices[] __initdata = { |
172 | ð_device, | 203 | ð_device, |
173 | &sdhi0_device, | 204 | &sdhi0_device, |
174 | &thermal_device, | 205 | &thermal_device, |
175 | &hspi_device, | 206 | &hspi_device, |
176 | &usb_phy_device, | 207 | &usb_phy_device, |
208 | &leds_device, | ||
177 | }; | 209 | }; |
178 | 210 | ||
179 | /* USB */ | 211 | /* USB */ |