Add default_brightness field to struct led_pwm. Initialize led device brightness with the given default_brightness. Signed-off-by: Boris BREZILLON <linux-arm@xxxxxxxxxxx> diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c index 12d4977..492ac22 100644 --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c @@ -137,7 +137,7 @@ static int led_pwm_probe(struct platform_device *pdev) led_dat->active_low = cur_led->active_low; led_dat->period = cur_led->pwm_period_ns; led_dat->cdev.brightness_set = led_pwm_set; - led_dat->cdev.brightness = LED_OFF; + led_dat->cdev.brightness = cur_led->default_brightness; led_dat->cdev.max_brightness = cur_led->max_brightness; led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME; diff --git a/include/linux/leds_pwm.h b/include/linux/leds_pwm.h index a65e964..7a90214 100644 --- a/include/linux/leds_pwm.h +++ b/include/linux/leds_pwm.h @@ -10,6 +10,7 @@ struct led_pwm { unsigned pwm_id __deprecated; u8 active_low; unsigned max_brightness; + unsigned default_brightness; unsigned pwm_period_ns; }; -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-leds" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html