From 9d3e52644089acd264ea971f966b52205cfb37e8 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Wed, 13 May 2009 11:48:01 +0100 Subject: [PATCH] S3C: Add a flag to allow leds to start "on" Gives a way to start a LED in the "on" state, to use with the backlight trigger for example. Signed-off-by: Michel Pollet --- arch/arm/mach-s3c2410/include/mach/leds-gpio.h | 1 + drivers/leds/leds-s3c24xx.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-s3c2410/include/mach/leds-gpio.h b/arch/arm/mach-s3c2410/include/mach/leds-gpio.h index d8a7672519b..d89a074f764 100644 --- a/arch/arm/mach-s3c2410/include/mach/leds-gpio.h +++ b/arch/arm/mach-s3c2410/include/mach/leds-gpio.h @@ -16,6 +16,7 @@ #define S3C24XX_LEDF_ACTLOW (1<<0) /* LED is on when GPIO low */ #define S3C24XX_LEDF_TRISTATE (1<<1) /* tristate to turn off */ +#define S3C24XX_LEDF_STARTON (1<<2) /* Initialise 'on' */ struct s3c24xx_led_platdata { unsigned int gpio; diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c index aa7acf3b922..505612cac64 100644 --- a/drivers/leds/leds-s3c24xx.c +++ b/drivers/leds/leds-s3c24xx.c @@ -84,6 +84,7 @@ static int s3c24xx_led_probe(struct platform_device *dev) led->cdev.default_trigger = pdata->def_trigger; led->cdev.name = pdata->name; led->cdev.flags |= LED_CORE_SUSPENDRESUME; + led->cdev.brightness = pdata->flags & S3C24XX_LEDF_STARTON ? 1 : 0; led->pdata = pdata; @@ -94,7 +95,8 @@ static int s3c24xx_led_probe(struct platform_device *dev) s3c2410_gpio_cfgpin(pdata->gpio, S3C2410_GPIO_INPUT); } else { s3c2410_gpio_pullup(pdata->gpio, 0); - s3c2410_gpio_setpin(pdata->gpio, 0); + /* backlight led needs to be turned on early on */ + s3c2410_gpio_setpin(pdata->gpio, led->cdev.brightness); s3c2410_gpio_cfgpin(pdata->gpio, S3C2410_GPIO_OUTPUT); } -- 2.11.4.GIT