mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
arm: ep93xx: use gpio_led_register_device
Use gpio_led_register_device to register the two leds connected to the ep93xx. Since this is a common feature for all ep93xx based boards, create a new Kconfig option, EP93XX_SOC_COMMON, to select the LEDS_GPIO_REGISTER feature. The struct gpio_led and struct gpio_led_platform_data variables have been changed to const struct because of: commit9517f925f2
leds: make *struct gpio_led_platform_data.leds const They have also been marked as __initconst because the helper function gpio_led_register_device makes a deep copy of the platform data to allow it to live in init memory: commit4440673a95
leds: provide helper to register "leds-gpio" devices Signed-off-by: Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Ryan Mallon <rmallon@gmail.com>
This commit is contained in:
parent
011b2e8458
commit
a1eacd79a6
2 changed files with 9 additions and 12 deletions
|
@ -2,6 +2,11 @@ if ARCH_EP93XX
|
||||||
|
|
||||||
menu "Cirrus EP93xx Implementation Options"
|
menu "Cirrus EP93xx Implementation Options"
|
||||||
|
|
||||||
|
config EP93XX_SOC_COMMON
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
select LEDS_GPIO_REGISTER
|
||||||
|
|
||||||
config CRUNCH
|
config CRUNCH
|
||||||
bool "Support for MaverickCrunch"
|
bool "Support for MaverickCrunch"
|
||||||
help
|
help
|
||||||
|
|
|
@ -482,7 +482,7 @@ void __init ep93xx_register_spi(struct ep93xx_spi_info *info,
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* EP93xx LEDs
|
* EP93xx LEDs
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
static struct gpio_led ep93xx_led_pins[] = {
|
static const struct gpio_led ep93xx_led_pins[] __initconst = {
|
||||||
{
|
{
|
||||||
.name = "platform:grled",
|
.name = "platform:grled",
|
||||||
.gpio = EP93XX_GPIO_LINE_GRLED,
|
.gpio = EP93XX_GPIO_LINE_GRLED,
|
||||||
|
@ -492,20 +492,11 @@ static struct gpio_led ep93xx_led_pins[] = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct gpio_led_platform_data ep93xx_led_data = {
|
static const struct gpio_led_platform_data ep93xx_led_data __initconst = {
|
||||||
.num_leds = ARRAY_SIZE(ep93xx_led_pins),
|
.num_leds = ARRAY_SIZE(ep93xx_led_pins),
|
||||||
.leds = ep93xx_led_pins,
|
.leds = ep93xx_led_pins,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device ep93xx_leds = {
|
|
||||||
.name = "leds-gpio",
|
|
||||||
.id = -1,
|
|
||||||
.dev = {
|
|
||||||
.platform_data = &ep93xx_led_data,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* EP93xx pwm peripheral handling
|
* EP93xx pwm peripheral handling
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
@ -827,8 +818,9 @@ void __init ep93xx_init_devices(void)
|
||||||
|
|
||||||
platform_device_register(&ep93xx_rtc_device);
|
platform_device_register(&ep93xx_rtc_device);
|
||||||
platform_device_register(&ep93xx_ohci_device);
|
platform_device_register(&ep93xx_ohci_device);
|
||||||
platform_device_register(&ep93xx_leds);
|
|
||||||
platform_device_register(&ep93xx_wdt_device);
|
platform_device_register(&ep93xx_wdt_device);
|
||||||
|
|
||||||
|
gpio_led_register_device(-1, &ep93xx_led_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ep93xx_restart(char mode, const char *cmd)
|
void ep93xx_restart(char mode, const char *cmd)
|
||||||
|
|
Loading…
Reference in a new issue