From 668e63c6701d486c68b49ffffc0e5b7de1a2e95c Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 7 Oct 2013 11:30:50 +0200 Subject: pwm-backlight: Improve readability Add more blank lines to increase readability. While at it, remove a trailing blank line at the end of the file. Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 1fea627394d7..774bce38ba42 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -269,8 +269,10 @@ static int pwm_backlight_remove(struct platform_device *pdev) backlight_device_unregister(bl); pwm_config(pb->pwm, 0, pb->period); pwm_disable(pb->pwm); + if (pb->exit) pb->exit(&pdev->dev); + return 0; } @@ -282,10 +284,13 @@ static int pwm_backlight_suspend(struct device *dev) if (pb->notify) pb->notify(pb->dev, 0); + pwm_config(pb->pwm, 0, pb->period); pwm_disable(pb->pwm); + if (pb->notify_after) pb->notify_after(pb->dev, 0); + return 0; } @@ -294,6 +299,7 @@ static int pwm_backlight_resume(struct device *dev) struct backlight_device *bl = dev_get_drvdata(dev); backlight_update_status(bl); + return 0; } #endif @@ -317,4 +323,3 @@ module_platform_driver(pwm_backlight_driver); MODULE_DESCRIPTION("PWM based Backlight Driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:pwm-backlight"); - -- cgit v1.2.1 From 62b744a87c1170b339f993aa3cfb22465974816a Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 7 Oct 2013 11:32:02 +0200 Subject: pwm-backlight: Refactor backlight power on/off In preparation for adding an optional regulator and enable GPIO to the driver, split the power on and power off sequences into separate functions to reduce code duplication at the multiple call sites. Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 53 +++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 774bce38ba42..ab9d5e6012a4 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -35,6 +35,31 @@ struct pwm_bl_data { void (*exit)(struct device *); }; +static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness, + int max) +{ + int duty_cycle, err; + + if (pb->levels) { + duty_cycle = pb->levels[brightness]; + max = pb->levels[max]; + } else { + duty_cycle = brightness; + } + + duty_cycle = (duty_cycle * (pb->period - pb->lth_brightness) / max) + + pb->lth_brightness; + + pwm_config(pb->pwm, duty_cycle, pb->period); + pwm_enable(pb->pwm); +} + +static void pwm_backlight_power_off(struct pwm_bl_data *pb) +{ + pwm_config(pb->pwm, 0, pb->period); + pwm_disable(pb->pwm); +} + static int pwm_backlight_update_status(struct backlight_device *bl) { struct pwm_bl_data *pb = bl_get_data(bl); @@ -49,24 +74,10 @@ static int pwm_backlight_update_status(struct backlight_device *bl) if (pb->notify) brightness = pb->notify(pb->dev, brightness); - if (brightness == 0) { - pwm_config(pb->pwm, 0, pb->period); - pwm_disable(pb->pwm); - } else { - int duty_cycle; - - if (pb->levels) { - duty_cycle = pb->levels[brightness]; - max = pb->levels[max]; - } else { - duty_cycle = brightness; - } - - duty_cycle = pb->lth_brightness + - (duty_cycle * (pb->period - pb->lth_brightness) / max); - pwm_config(pb->pwm, duty_cycle, pb->period); - pwm_enable(pb->pwm); - } + if (brightness > 0) + pwm_backlight_power_on(pb, brightness, max); + else + pwm_backlight_power_off(pb); if (pb->notify_after) pb->notify_after(pb->dev, brightness); @@ -267,8 +278,7 @@ static int pwm_backlight_remove(struct platform_device *pdev) struct pwm_bl_data *pb = bl_get_data(bl); backlight_device_unregister(bl); - pwm_config(pb->pwm, 0, pb->period); - pwm_disable(pb->pwm); + pwm_backlight_power_off(pb); if (pb->exit) pb->exit(&pdev->dev); @@ -285,8 +295,7 @@ static int pwm_backlight_suspend(struct device *dev) if (pb->notify) pb->notify(pb->dev, 0); - pwm_config(pb->pwm, 0, pb->period); - pwm_disable(pb->pwm); + pwm_backlight_power_off(pb); if (pb->notify_after) pb->notify_after(pb->dev, 0); -- cgit v1.2.1 From 97c38437115aa0c3fb2d50c488814b503ba529e0 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 2 Oct 2013 18:01:02 +0200 Subject: pwm-backlight: Track enable state Follow up patches will add support for more complex means of powering the backlight on and off such as using a regulator. To prevent calls to the regulator API from becoming unbalanced, keep track of the enabled state internally. Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index ab9d5e6012a4..4053efbe5edb 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -27,6 +27,7 @@ struct pwm_bl_data { unsigned int period; unsigned int lth_brightness; unsigned int *levels; + bool enabled; int (*notify)(struct device *, int brightness); void (*notify_after)(struct device *, @@ -40,6 +41,9 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness, { int duty_cycle, err; + if (pb->enabled) + return; + if (pb->levels) { duty_cycle = pb->levels[brightness]; max = pb->levels[max]; @@ -52,12 +56,18 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness, pwm_config(pb->pwm, duty_cycle, pb->period); pwm_enable(pb->pwm); + pb->enabled = true; } static void pwm_backlight_power_off(struct pwm_bl_data *pb) { + if (!pb->enabled) + return; + pwm_config(pb->pwm, 0, pb->period); pwm_disable(pb->pwm); + + pb->enabled = false; } static int pwm_backlight_update_status(struct backlight_device *bl) @@ -216,6 +226,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->check_fb = data->check_fb; pb->exit = data->exit; pb->dev = &pdev->dev; + pb->enabled = false; pb->pwm = devm_pwm_get(&pdev->dev, NULL); if (IS_ERR(pb->pwm)) { -- cgit v1.2.1 From 8265b2e4e62632b01f998095d1bbda4d281629fe Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 30 Aug 2013 12:32:18 +0200 Subject: pwm-backlight: Use new enable_gpio field Make use of the new enable_gpio field and allow it to be set from DT as well. Now that all legacy users of platform data have been converted to initialize this field to an invalid value, it is safe to use the field from the driver. Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 57 +++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 7 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 4053efbe5edb..cdef4a346555 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -10,6 +10,8 @@ * published by the Free Software Foundation. */ +#include +#include #include #include #include @@ -28,6 +30,8 @@ struct pwm_bl_data { unsigned int lth_brightness; unsigned int *levels; bool enabled; + int enable_gpio; + unsigned long enable_gpio_flags; int (*notify)(struct device *, int brightness); void (*notify_after)(struct device *, @@ -55,6 +59,14 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness, pb->lth_brightness; pwm_config(pb->pwm, duty_cycle, pb->period); + + if (gpio_is_valid(pb->enable_gpio)) { + if (pb->enable_gpio_flags & PWM_BACKLIGHT_GPIO_ACTIVE_LOW) + gpio_set_value(pb->enable_gpio, 0); + else + gpio_set_value(pb->enable_gpio, 1); + } + pwm_enable(pb->pwm); pb->enabled = true; } @@ -67,6 +79,13 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb) pwm_config(pb->pwm, 0, pb->period); pwm_disable(pb->pwm); + if (gpio_is_valid(pb->enable_gpio)) { + if (pb->enable_gpio_flags & PWM_BACKLIGHT_GPIO_ACTIVE_LOW) + gpio_set_value(pb->enable_gpio, 1); + else + gpio_set_value(pb->enable_gpio, 0); + } + pb->enabled = false; } @@ -119,6 +138,7 @@ static int pwm_backlight_parse_dt(struct device *dev, struct platform_pwm_backlight_data *data) { struct device_node *node = dev->of_node; + enum of_gpio_flags flags; struct property *prop; int length; u32 value; @@ -159,11 +179,13 @@ static int pwm_backlight_parse_dt(struct device *dev, data->max_brightness--; } - /* - * TODO: Most users of this driver use a number of GPIOs to control - * backlight power. Support for specifying these needs to be - * added. - */ + data->enable_gpio = of_get_named_gpio_flags(node, "enable-gpios", 0, + &flags); + if (data->enable_gpio == -EPROBE_DEFER) + return -EPROBE_DEFER; + + if (gpio_is_valid(data->enable_gpio) && (flags & OF_GPIO_ACTIVE_LOW)) + data->enable_gpio_flags |= PWM_BACKLIGHT_GPIO_ACTIVE_LOW; return 0; } @@ -221,6 +243,8 @@ static int pwm_backlight_probe(struct platform_device *pdev) } else max = data->max_brightness; + pb->enable_gpio = data->enable_gpio; + pb->enable_gpio_flags = data->enable_gpio_flags; pb->notify = data->notify; pb->notify_after = data->notify_after; pb->check_fb = data->check_fb; @@ -228,6 +252,22 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->dev = &pdev->dev; pb->enabled = false; + if (gpio_is_valid(pb->enable_gpio)) { + unsigned long flags; + + if (pb->enable_gpio_flags & PWM_BACKLIGHT_GPIO_ACTIVE_LOW) + flags = GPIOF_OUT_INIT_HIGH; + else + flags = GPIOF_OUT_INIT_LOW; + + ret = gpio_request_one(pb->enable_gpio, flags, "enable"); + if (ret < 0) { + dev_err(&pdev->dev, "failed to request GPIO#%d: %d\n", + pb->enable_gpio, ret); + goto err_alloc; + } + } + pb->pwm = devm_pwm_get(&pdev->dev, NULL); if (IS_ERR(pb->pwm)) { dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n"); @@ -236,7 +276,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) if (IS_ERR(pb->pwm)) { dev_err(&pdev->dev, "unable to request legacy PWM\n"); ret = PTR_ERR(pb->pwm); - goto err_alloc; + goto err_gpio; } } @@ -261,7 +301,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) if (IS_ERR(bl)) { dev_err(&pdev->dev, "failed to register backlight\n"); ret = PTR_ERR(bl); - goto err_alloc; + goto err_gpio; } if (data->dft_brightness > data->max_brightness) { @@ -277,6 +317,9 @@ static int pwm_backlight_probe(struct platform_device *pdev) platform_set_drvdata(pdev, bl); return 0; +err_gpio: + if (gpio_is_valid(pb->enable_gpio)) + gpio_free(pb->enable_gpio); err_alloc: if (data->exit) data->exit(&pdev->dev); -- cgit v1.2.1 From 22ceeee16eb8f0d04de3ef43a5174fb30ec18af9 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 30 Aug 2013 12:38:34 +0200 Subject: pwm-backlight: Add power supply support Backlights require a power supply to work properly. This commit adds a regulator to power up and power down the backlight. Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index cdef4a346555..eec6c98527f9 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -21,6 +21,7 @@ #include #include #include +#include #include struct pwm_bl_data { @@ -30,6 +31,7 @@ struct pwm_bl_data { unsigned int lth_brightness; unsigned int *levels; bool enabled; + struct regulator *power_supply; int enable_gpio; unsigned long enable_gpio_flags; int (*notify)(struct device *, @@ -60,6 +62,10 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness, pwm_config(pb->pwm, duty_cycle, pb->period); + err = regulator_enable(pb->power_supply); + if (err < 0) + dev_err(pb->dev, "failed to enable power supply\n"); + if (gpio_is_valid(pb->enable_gpio)) { if (pb->enable_gpio_flags & PWM_BACKLIGHT_GPIO_ACTIVE_LOW) gpio_set_value(pb->enable_gpio, 0); @@ -86,6 +92,7 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb) gpio_set_value(pb->enable_gpio, 0); } + regulator_disable(pb->power_supply); pb->enabled = false; } @@ -268,6 +275,12 @@ static int pwm_backlight_probe(struct platform_device *pdev) } } + pb->power_supply = devm_regulator_get(&pdev->dev, "power"); + if (IS_ERR(pb->power_supply)) { + ret = PTR_ERR(pb->power_supply); + goto err_gpio; + } + pb->pwm = devm_pwm_get(&pdev->dev, NULL); if (IS_ERR(pb->pwm)) { dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n"); -- cgit v1.2.1 From 8f43e18e2769b3b28383903d501b4da29e388aad Mon Sep 17 00:00:00 2001 From: Mike Dunn Date: Sun, 22 Sep 2013 09:59:56 -0700 Subject: pwm-backlight: Allow for non-increasing brightness levels Currently the driver assumes that the values specified in the brightness-levels device tree property increase as they are parsed from left to right. But boards that invert the signal between the PWM output and the backlight will need to specify decreasing brightness-levels. This patch removes the assumption that the last element of the array is the maximum value, and instead searches the array for the maximum value and uses that in the duty cycle calculation. Signed-off-by: Mike Dunn Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index eec6c98527f9..32e96e3525a1 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -34,6 +34,7 @@ struct pwm_bl_data { struct regulator *power_supply; int enable_gpio; unsigned long enable_gpio_flags; + unsigned int scale; int (*notify)(struct device *, int brightness); void (*notify_after)(struct device *, @@ -42,23 +43,20 @@ struct pwm_bl_data { void (*exit)(struct device *); }; -static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness, - int max) +static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness) { + unsigned int lth = pb->lth_brightness; int duty_cycle, err; if (pb->enabled) return; - if (pb->levels) { + if (pb->levels) duty_cycle = pb->levels[brightness]; - max = pb->levels[max]; - } else { + else duty_cycle = brightness; - } - duty_cycle = (duty_cycle * (pb->period - pb->lth_brightness) / max) + - pb->lth_brightness; + duty_cycle = (duty_cycle * (pb->period - lth) / pb->scale) + lth; pwm_config(pb->pwm, duty_cycle, pb->period); @@ -100,7 +98,6 @@ static int pwm_backlight_update_status(struct backlight_device *bl) { struct pwm_bl_data *pb = bl_get_data(bl); int brightness = bl->props.brightness; - int max = bl->props.max_brightness; if (bl->props.power != FB_BLANK_UNBLANK || bl->props.fb_blank != FB_BLANK_UNBLANK || @@ -111,7 +108,7 @@ static int pwm_backlight_update_status(struct backlight_device *bl) brightness = pb->notify(pb->dev, brightness); if (brightness > 0) - pwm_backlight_power_on(pb, brightness, max); + pwm_backlight_power_on(pb, brightness); else pwm_backlight_power_off(pb); @@ -218,7 +215,6 @@ static int pwm_backlight_probe(struct platform_device *pdev) struct backlight_properties props; struct backlight_device *bl; struct pwm_bl_data *pb; - unsigned int max; int ret; if (!data) { @@ -245,10 +241,15 @@ static int pwm_backlight_probe(struct platform_device *pdev) } if (data->levels) { - max = data->levels[data->max_brightness]; + unsigned int i; + + for (i = 0; i <= data->max_brightness; i++) + if (data->levels[i] > pb->scale) + pb->scale = data->levels[i]; + pb->levels = data->levels; } else - max = data->max_brightness; + pb->scale = data->max_brightness; pb->enable_gpio = data->enable_gpio; pb->enable_gpio_flags = data->enable_gpio_flags; @@ -304,7 +305,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) pwm_set_period(pb->pwm, data->pwm_period_ns); pb->period = pwm_get_period(pb->pwm); - pb->lth_brightness = data->lth_brightness * (pb->period / max); + pb->lth_brightness = data->lth_brightness * (pb->period / pb->scale); memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_RAW; -- cgit v1.2.1 From e4bfeda96872bfe6015cd360008b77cd3b981b2b Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 18 Oct 2013 10:46:24 +0200 Subject: pwm-backlight: Fix brightness adjustment Split adjustment of the brightness (by changing the PWM duty cycle) from the power on sequence. This fixes an issue where the brightness can no longer be updated once the backlight has been enabled. Reported-by: Marc Dietrich Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 32e96e3525a1..f77a7b0ca5e6 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -45,21 +45,11 @@ struct pwm_bl_data { static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness) { - unsigned int lth = pb->lth_brightness; int duty_cycle, err; if (pb->enabled) return; - if (pb->levels) - duty_cycle = pb->levels[brightness]; - else - duty_cycle = brightness; - - duty_cycle = (duty_cycle * (pb->period - lth) / pb->scale) + lth; - - pwm_config(pb->pwm, duty_cycle, pb->period); - err = regulator_enable(pb->power_supply); if (err < 0) dev_err(pb->dev, "failed to enable power supply\n"); @@ -94,10 +84,24 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb) pb->enabled = false; } +static int compute_duty_cycle(struct pwm_bl_data *pb, int brightness) +{ + unsigned int lth = pb->lth_brightness; + int duty_cycle; + + if (pb->levels) + duty_cycle = pb->levels[brightness]; + else + duty_cycle = brightness; + + return (duty_cycle * (pb->period - lth) / pb->scale) + lth; +} + static int pwm_backlight_update_status(struct backlight_device *bl) { struct pwm_bl_data *pb = bl_get_data(bl); int brightness = bl->props.brightness; + int duty_cycle; if (bl->props.power != FB_BLANK_UNBLANK || bl->props.fb_blank != FB_BLANK_UNBLANK || @@ -107,9 +111,11 @@ static int pwm_backlight_update_status(struct backlight_device *bl) if (pb->notify) brightness = pb->notify(pb->dev, brightness); - if (brightness > 0) + if (brightness > 0) { + duty_cycle = compute_duty_cycle(pb, brightness); + pwm_config(pb->pwm, duty_cycle, pb->period); pwm_backlight_power_on(pb, brightness); - else + } else pwm_backlight_power_off(pb); if (pb->notify_after) -- cgit v1.2.1 From 1dea1fd09246ada581a99d0669108eea94b7bfee Mon Sep 17 00:00:00 2001 From: Huayi Li Date: Wed, 9 Oct 2013 10:33:02 +0800 Subject: pwm_backlight: avoid short blank screen while doing hibernation Use SIMPLE_DEV_PM_OPS macro will initialize the member "freeze" and "thaw" of pwm_backlight_pm_ops as below, .freeze = suspend_fn, .thaw = resume_fn, then during the process of making hibernation snapshot, screen will be blank at the moment of freezing, and then light at the moment of thawing. this is not the right user experience for suspending to disk. so this patch drops freeze and thaw callback, make the LCD is always lighting before the final shutdown. Signed-off-by: Huayi Li Signed-off-by: Barry Song Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index f77a7b0ca5e6..299533491a95 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -387,8 +387,14 @@ static int pwm_backlight_resume(struct device *dev) } #endif -static SIMPLE_DEV_PM_OPS(pwm_backlight_pm_ops, pwm_backlight_suspend, - pwm_backlight_resume); +static const struct dev_pm_ops pwm_backlight_pm_ops = { +#ifdef CONFIG_PM_SLEEP + .suspend = pwm_backlight_suspend, + .resume = pwm_backlight_resume, + .poweroff = pwm_backlight_suspend, + .restore = pwm_backlight_resume, +#endif +}; static struct platform_driver pwm_backlight_driver = { .driver = { -- cgit v1.2.1 From 73d4e2b82b4bb1571b1a7f97012c0db8a0faef42 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 22 Oct 2013 09:37:05 +0200 Subject: pwm-backlight: Remove unused variable I forgot to remove this during earlier cleanup patches and only checked various builds for errors, not warnings. Reported-by: kbuild test robot Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 299533491a95..368232af78d2 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -45,7 +45,7 @@ struct pwm_bl_data { static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness) { - int duty_cycle, err; + int err; if (pb->enabled) return; -- cgit v1.2.1