summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx/mach-smdk6410.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-02-17 19:19:31 +0100
committerBen Dooks <ben-linux@fluff.org>2010-02-24 02:58:41 +0100
commita7a81d0bbd7820b279b14dbe00041a603c3cbf84 (patch)
treefb41da5e7fa872c4e66262f18dbac7f48da41a42 /arch/arm/mach-s3c64xx/mach-smdk6410.c
parentARM: SMDK6410: Add initial support for WM1192-EV1 PMIC board (diff)
downloadlinux-a7a81d0bbd7820b279b14dbe00041a603c3cbf84.tar.xz
linux-a7a81d0bbd7820b279b14dbe00041a603c3cbf84.zip
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.c30
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 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/i2c.h>
+#include <linux/leds.h>
#include <linux/fb.h>
#include <linux/gpio.h>
#include <linux/delay.h>
@@ -33,6 +34,7 @@
#endif
#ifdef CONFIG_SMDK6410_WM1192_EV1
+#include <linux/mfd/wm831x/core.h>
#include <linux/mfd/wm831x/pdata.h>
#endif
@@ -471,11 +473,38 @@ static struct wm8350_platform_data __initdata smdk6410_wm8350_pdata = {
#endif
#ifdef CONFIG_SMDK6410_WM1192_EV1
+static struct gpio_led wm1192_pmic_leds[] = {
+ {
+ .name = "PMIC:red:power",
+ .gpio = GPIO_BOARD_START + 3,
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ },
+};
+
+static struct gpio_led_platform_data wm1192_pmic_led = {
+ .num_leds = ARRAY_SIZE(wm1192_pmic_leds),
+ .leds = wm1192_pmic_leds,
+};
+
+static struct platform_device wm1192_pmic_led_dev = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &wm1192_pmic_led,
+ },
+};
+
static int wm1192_pre_init(struct wm831x *wm831x)
{
+ int ret;
+
/* Configure the IRQ line */
s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP);
+ ret = platform_device_register(&wm1192_pmic_led_dev);
+ if (ret != 0)
+ dev_err(wm831x->dev, "Failed to add PMIC LED: %d\n", ret);
+
return 0;
}
@@ -522,6 +551,7 @@ static struct wm831x_pdata smdk6410_wm1192_pdata = {
&smdk6410_vddint, /* DCDC2 */
&wm1192_dcdc3,
},
+ .gpio_base = GPIO_BOARD_START,
.ldo = {
&wm1192_ldo1, /* LDO1 */
&smdk6410_vdduh_mmc, /* LDO2 */