diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-02-17 13:19:31 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-02-23 20:58:41 -0500 |
commit | a7a81d0bbd7820b279b14dbe00041a603c3cbf84 (patch) | |
tree | fb41da5e7fa872c4e66262f18dbac7f48da41a42 /arch/arm/mach-s3c64xx/mach-smdk6410.c | |
parent | 60f9101a8881797fecd89450b8a8d17a440e6281 (diff) |
ARM: SMDK6410: Add support for PMIC LED on WM1192-EV1 PMIC module
The PMIC LED on the SMDK6410 CPU board is driven by GPIO4 of the
WM8312 PMIC. Provide software control of this LED.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c64xx/mach-smdk6410.c')
-rw-r--r-- | arch/arm/mach-s3c64xx/mach-smdk6410.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index cf2327f0bf77..a966cacb9b9d 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
24 | #include <linux/leds.h> | ||
24 | #include <linux/fb.h> | 25 | #include <linux/fb.h> |
25 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
26 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
@@ -33,6 +34,7 @@ | |||
33 | #endif | 34 | #endif |
34 | 35 | ||
35 | #ifdef CONFIG_SMDK6410_WM1192_EV1 | 36 | #ifdef CONFIG_SMDK6410_WM1192_EV1 |
37 | #include <linux/mfd/wm831x/core.h> | ||
36 | #include <linux/mfd/wm831x/pdata.h> | 38 | #include <linux/mfd/wm831x/pdata.h> |
37 | #endif | 39 | #endif |
38 | 40 | ||
@@ -471,11 +473,38 @@ static struct wm8350_platform_data __initdata smdk6410_wm8350_pdata = { | |||
471 | #endif | 473 | #endif |
472 | 474 | ||
473 | #ifdef CONFIG_SMDK6410_WM1192_EV1 | 475 | #ifdef CONFIG_SMDK6410_WM1192_EV1 |
476 | static struct gpio_led wm1192_pmic_leds[] = { | ||
477 | { | ||
478 | .name = "PMIC:red:power", | ||
479 | .gpio = GPIO_BOARD_START + 3, | ||
480 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
481 | }, | ||
482 | }; | ||
483 | |||
484 | static struct gpio_led_platform_data wm1192_pmic_led = { | ||
485 | .num_leds = ARRAY_SIZE(wm1192_pmic_leds), | ||
486 | .leds = wm1192_pmic_leds, | ||
487 | }; | ||
488 | |||
489 | static struct platform_device wm1192_pmic_led_dev = { | ||
490 | .name = "leds-gpio", | ||
491 | .id = -1, | ||
492 | .dev = { | ||
493 | .platform_data = &wm1192_pmic_led, | ||
494 | }, | ||
495 | }; | ||
496 | |||
474 | static int wm1192_pre_init(struct wm831x *wm831x) | 497 | static int wm1192_pre_init(struct wm831x *wm831x) |
475 | { | 498 | { |
499 | int ret; | ||
500 | |||
476 | /* Configure the IRQ line */ | 501 | /* Configure the IRQ line */ |
477 | s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP); | 502 | s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP); |
478 | 503 | ||
504 | ret = platform_device_register(&wm1192_pmic_led_dev); | ||
505 | if (ret != 0) | ||
506 | dev_err(wm831x->dev, "Failed to add PMIC LED: %d\n", ret); | ||
507 | |||
479 | return 0; | 508 | return 0; |
480 | } | 509 | } |
481 | 510 | ||
@@ -522,6 +551,7 @@ static struct wm831x_pdata smdk6410_wm1192_pdata = { | |||
522 | &smdk6410_vddint, /* DCDC2 */ | 551 | &smdk6410_vddint, /* DCDC2 */ |
523 | &wm1192_dcdc3, | 552 | &wm1192_dcdc3, |
524 | }, | 553 | }, |
554 | .gpio_base = GPIO_BOARD_START, | ||
525 | .ldo = { | 555 | .ldo = { |
526 | &wm1192_ldo1, /* LDO1 */ | 556 | &wm1192_ldo1, /* LDO1 */ |
527 | &smdk6410_vdduh_mmc, /* LDO2 */ | 557 | &smdk6410_vdduh_mmc, /* LDO2 */ |