diff options
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/Kconfig | 20 | ||||
-rw-r--r-- | drivers/video/backlight/Makefile | 2 | ||||
-rw-r--r-- | drivers/video/backlight/aat2870_bl.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/ams369fg06.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/atmel-pwm-bl.c | 223 | ||||
-rw-r--r-- | drivers/video/backlight/backlight.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/bd6107.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/gpio_backlight.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/ipaq_micro_bl.c | 83 | ||||
-rw-r--r-- | drivers/video/backlight/jornada720_lcd.c | 37 | ||||
-rw-r--r-- | drivers/video/backlight/ld9040.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/lp855x_bl.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/lp8788_bl.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/lv5207lp.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/pandora_bl.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/pwm_bl.c | 13 | ||||
-rw-r--r-- | drivers/video/backlight/s6e63m0.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/tps65217_bl.c | 6 |
18 files changed, 116 insertions, 330 deletions
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 5d449059a556..8d03924749b8 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -178,17 +178,6 @@ config BACKLIGHT_ATMEL_LCDC If in doubt, it's safe to enable this option; it doesn't kick in unless the board's description says it's wired that way. -config BACKLIGHT_ATMEL_PWM - tristate "Atmel PWM backlight control" - depends on ATMEL_PWM - help - Say Y here if you want to use the PWM peripheral in Atmel AT91 and - AVR32 devices. This driver will need additional platform data to know - which PWM instance to use and how to configure it. - - To compile this driver as a module, choose M here: the module will be - called atmel-pwm-bl. - config BACKLIGHT_EP93XX tristate "Cirrus EP93xx Backlight Driver" depends on FB_EP93XX @@ -207,6 +196,15 @@ config BACKLIGHT_GENERIC known as the Corgi backlight driver. If you have a Sharp Zaurus SL-C7xx, SL-Cxx00 or SL-6000x say y. +config BACKLIGHT_IPAQ_MICRO + tristate "iPAQ microcontroller backlight driver" + depends on MFD_IPAQ_MICRO + default y + help + Say y to enable the backlight driver for Compaq iPAQ handheld + computers. Say yes if you have one of the h3100/h3600/h3700 + machines. + config BACKLIGHT_LM3533 tristate "Backlight Driver for LM3533" depends on BACKLIGHT_CLASS_DEVICE diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index bb820024f346..fcd50b732165 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -25,7 +25,6 @@ obj-$(CONFIG_BACKLIGHT_ADP8860) += adp8860_bl.o obj-$(CONFIG_BACKLIGHT_ADP8870) += adp8870_bl.o obj-$(CONFIG_BACKLIGHT_APPLE) += apple_bl.o obj-$(CONFIG_BACKLIGHT_AS3711) += as3711_bl.o -obj-$(CONFIG_BACKLIGHT_ATMEL_PWM) += atmel-pwm-bl.o obj-$(CONFIG_BACKLIGHT_BD6107) += bd6107.o obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o @@ -36,6 +35,7 @@ obj-$(CONFIG_BACKLIGHT_GENERIC) += generic_bl.o obj-$(CONFIG_BACKLIGHT_GPIO) += gpio_backlight.o obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o obj-$(CONFIG_BACKLIGHT_HP700) += jornada720_bl.o +obj-$(CONFIG_BACKLIGHT_IPAQ_MICRO) += ipaq_micro_bl.o obj-$(CONFIG_BACKLIGHT_LM3533) += lm3533_bl.o obj-$(CONFIG_BACKLIGHT_LM3630A) += lm3630a_bl.o obj-$(CONFIG_BACKLIGHT_LM3639) += lm3639_bl.o diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c index ec5350f2c28a..86234c31d79c 100644 --- a/drivers/video/backlight/aat2870_bl.c +++ b/drivers/video/backlight/aat2870_bl.c @@ -67,11 +67,6 @@ static inline int aat2870_bl_disable(struct aat2870_bl_driver_data *aat2870_bl) return aat2870->write(aat2870, AAT2870_BL_CH_EN, 0x0); } -static int aat2870_bl_get_brightness(struct backlight_device *bd) -{ - return bd->props.brightness; -} - static int aat2870_bl_update_status(struct backlight_device *bd) { struct aat2870_bl_driver_data *aat2870_bl = bl_get_data(bd); @@ -120,7 +115,6 @@ static int aat2870_bl_check_fb(struct backlight_device *bd, struct fb_info *fi) static const struct backlight_ops aat2870_bl_ops = { .options = BL_CORE_SUSPENDRESUME, - .get_brightness = aat2870_bl_get_brightness, .update_status = aat2870_bl_update_status, .check_fb = aat2870_bl_check_fb, }; diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index d8952c4aa689..4726c8be626f 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c @@ -410,11 +410,6 @@ static int ams369fg06_set_power(struct lcd_device *ld, int power) return ams369fg06_power(lcd, power); } -static int ams369fg06_get_brightness(struct backlight_device *bd) -{ - return bd->props.brightness; -} - static int ams369fg06_set_brightness(struct backlight_device *bd) { int ret = 0; @@ -443,7 +438,6 @@ static struct lcd_ops ams369fg06_lcd_ops = { }; static const struct backlight_ops ams369fg06_backlight_ops = { - .get_brightness = ams369fg06_get_brightness, .update_status = ams369fg06_set_brightness, }; diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c deleted file mode 100644 index 261b1a4ec3d8..000000000000 --- a/drivers/video/backlight/atmel-pwm-bl.c +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (C) 2008 Atmel Corporation - * - * Backlight driver using Atmel PWM peripheral. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - */ -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/platform_device.h> -#include <linux/fb.h> -#include <linux/gpio.h> -#include <linux/backlight.h> -#include <linux/atmel_pwm.h> -#include <linux/atmel-pwm-bl.h> -#include <linux/slab.h> - -struct atmel_pwm_bl { - const struct atmel_pwm_bl_platform_data *pdata; - struct backlight_device *bldev; - struct platform_device *pdev; - struct pwm_channel pwmc; - int gpio_on; -}; - -static void atmel_pwm_bl_set_gpio_on(struct atmel_pwm_bl *pwmbl, int on) -{ - if (!gpio_is_valid(pwmbl->gpio_on)) - return; - - gpio_set_value(pwmbl->gpio_on, on ^ pwmbl->pdata->on_active_low); -} - -static int atmel_pwm_bl_set_intensity(struct backlight_device *bd) -{ - struct atmel_pwm_bl *pwmbl = bl_get_data(bd); - int intensity = bd->props.brightness; - int pwm_duty; - - if (bd->props.power != FB_BLANK_UNBLANK) - intensity = 0; - if (bd->props.fb_blank != FB_BLANK_UNBLANK) - intensity = 0; - - if (pwmbl->pdata->pwm_active_low) - pwm_duty = pwmbl->pdata->pwm_duty_min + intensity; - else - pwm_duty = pwmbl->pdata->pwm_duty_max - intensity; - - if (pwm_duty > pwmbl->pdata->pwm_duty_max) - pwm_duty = pwmbl->pdata->pwm_duty_max; - if (pwm_duty < pwmbl->pdata->pwm_duty_min) - pwm_duty = pwmbl->pdata->pwm_duty_min; - - if (!intensity) { - atmel_pwm_bl_set_gpio_on(pwmbl, 0); - pwm_channel_writel(&pwmbl->pwmc, PWM_CUPD, pwm_duty); - pwm_channel_disable(&pwmbl->pwmc); - } else { - pwm_channel_enable(&pwmbl->pwmc); - pwm_channel_writel(&pwmbl->pwmc, PWM_CUPD, pwm_duty); - atmel_pwm_bl_set_gpio_on(pwmbl, 1); - } - - return 0; -} - -static int atmel_pwm_bl_get_intensity(struct backlight_device *bd) -{ - struct atmel_pwm_bl *pwmbl = bl_get_data(bd); - u32 cdty; - u32 intensity; - - cdty = pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY); - if (pwmbl->pdata->pwm_active_low) - intensity = cdty - pwmbl->pdata->pwm_duty_min; - else - intensity = pwmbl->pdata->pwm_duty_max - cdty; - - return intensity & 0xffff; -} - -static int atmel_pwm_bl_init_pwm(struct atmel_pwm_bl *pwmbl) -{ - unsigned long pwm_rate = pwmbl->pwmc.mck; - unsigned long prescale = DIV_ROUND_UP(pwm_rate, - (pwmbl->pdata->pwm_frequency * - pwmbl->pdata->pwm_compare_max)) - 1; - - /* - * Prescale must be power of two and maximum 0xf in size because of - * hardware limit. PWM speed will be: - * PWM module clock speed / (2 ^ prescale). - */ - prescale = fls(prescale); - if (prescale > 0xf) - prescale = 0xf; - - pwm_channel_writel(&pwmbl->pwmc, PWM_CMR, prescale); - pwm_channel_writel(&pwmbl->pwmc, PWM_CDTY, - pwmbl->pdata->pwm_duty_min + - pwmbl->bldev->props.brightness); - pwm_channel_writel(&pwmbl->pwmc, PWM_CPRD, - pwmbl->pdata->pwm_compare_max); - - dev_info(&pwmbl->pdev->dev, "Atmel PWM backlight driver (%lu Hz)\n", - pwmbl->pwmc.mck / pwmbl->pdata->pwm_compare_max / - (1 << prescale)); - - return pwm_channel_enable(&pwmbl->pwmc); -} - -static const struct backlight_ops atmel_pwm_bl_ops = { - .get_brightness = atmel_pwm_bl_get_intensity, - .update_status = atmel_pwm_bl_set_intensity, -}; - -static int atmel_pwm_bl_probe(struct platform_device *pdev) -{ - struct backlight_properties props; - const struct atmel_pwm_bl_platform_data *pdata; - struct backlight_device *bldev; - struct atmel_pwm_bl *pwmbl; - unsigned long flags; - int retval; - - pdata = dev_get_platdata(&pdev->dev); - if (!pdata) - return -ENODEV; - - if (pdata->pwm_compare_max < pdata->pwm_duty_max || - pdata->pwm_duty_min > pdata->pwm_duty_max || - pdata->pwm_frequency == 0) - return -EINVAL; - - pwmbl = devm_kzalloc(&pdev->dev, sizeof(struct atmel_pwm_bl), - GFP_KERNEL); - if (!pwmbl) - return -ENOMEM; - - pwmbl->pdev = pdev; - pwmbl->pdata = pdata; - pwmbl->gpio_on = pdata->gpio_on; - - retval = pwm_channel_alloc(pdata->pwm_channel, &pwmbl->pwmc); - if (retval) - return retval; - - if (gpio_is_valid(pwmbl->gpio_on)) { - /* Turn display off by default. */ - if (pdata->on_active_low) - flags = GPIOF_OUT_INIT_HIGH; - else - flags = GPIOF_OUT_INIT_LOW; - - retval = devm_gpio_request_one(&pdev->dev, pwmbl->gpio_on, - flags, "gpio_atmel_pwm_bl"); - if (retval) - goto err_free_pwm; - } - - memset(&props, 0, sizeof(struct backlight_properties)); - props.type = BACKLIGHT_RAW; - props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min; - bldev = devm_backlight_device_register(&pdev->dev, "atmel-pwm-bl", - &pdev->dev, pwmbl, &atmel_pwm_bl_ops, - &props); - if (IS_ERR(bldev)) { - retval = PTR_ERR(bldev); - goto err_free_pwm; - } - - pwmbl->bldev = bldev; - - platform_set_drvdata(pdev, pwmbl); - - /* Power up the backlight by default at middle intesity. */ - bldev->props.power = FB_BLANK_UNBLANK; - bldev->props.brightness = bldev->props.max_brightness / 2; - - retval = atmel_pwm_bl_init_pwm(pwmbl); - if (retval) - goto err_free_pwm; - - atmel_pwm_bl_set_intensity(bldev); - - return 0; - -err_free_pwm: - pwm_channel_free(&pwmbl->pwmc); - - return retval; -} - -static int atmel_pwm_bl_remove(struct platform_device *pdev) -{ - struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev); - - atmel_pwm_bl_set_gpio_on(pwmbl, 0); - pwm_channel_disable(&pwmbl->pwmc); - pwm_channel_free(&pwmbl->pwmc); - - return 0; -} - -static struct platform_driver atmel_pwm_bl_driver = { - .driver = { - .name = "atmel-pwm-bl", - }, - /* REVISIT add suspend() and resume() */ - .probe = atmel_pwm_bl_probe, - .remove = atmel_pwm_bl_remove, -}; - -module_platform_driver(atmel_pwm_bl_driver); - -MODULE_AUTHOR("Hans-Christian egtvedt <hans-christian.egtvedt@atmel.com>"); -MODULE_DESCRIPTION("Atmel PWM backlight driver"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:atmel-pwm-bl"); diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 428089009cd5..bddc8b17a4d8 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -223,6 +223,8 @@ static ssize_t actual_brightness_show(struct device *dev, mutex_lock(&bd->ops_lock); if (bd->ops && bd->ops->get_brightness) rc = sprintf(buf, "%d\n", bd->ops->get_brightness(bd)); + else + rc = sprintf(buf, "%d\n", bd->props.brightness); mutex_unlock(&bd->ops_lock); return rc; diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index 16dd9bc625bd..fdb2f7e2c6b5 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c @@ -105,11 +105,6 @@ static int bd6107_backlight_update_status(struct backlight_device *backlight) return 0; } -static int bd6107_backlight_get_brightness(struct backlight_device *backlight) -{ - return backlight->props.brightness; -} - static int bd6107_backlight_check_fb(struct backlight_device *backlight, struct fb_info *info) { @@ -121,7 +116,6 @@ static int bd6107_backlight_check_fb(struct backlight_device *backlight, static const struct backlight_ops bd6107_backlight_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = bd6107_backlight_update_status, - .get_brightness = bd6107_backlight_get_brightness, .check_fb = bd6107_backlight_check_fb, }; diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 1cea68848f1a..aaead04a2d54 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -44,11 +44,6 @@ static int gpio_backlight_update_status(struct backlight_device *bl) return 0; } -static int gpio_backlight_get_brightness(struct backlight_device *bl) -{ - return bl->props.brightness; -} - static int gpio_backlight_check_fb(struct backlight_device *bl, struct fb_info *info) { @@ -60,7 +55,6 @@ static int gpio_backlight_check_fb(struct backlight_device *bl, static const struct backlight_ops gpio_backlight_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = gpio_backlight_update_status, - .get_brightness = gpio_backlight_get_brightness, .check_fb = gpio_backlight_check_fb, }; diff --git a/drivers/video/backlight/ipaq_micro_bl.c b/drivers/video/backlight/ipaq_micro_bl.c new file mode 100644 index 000000000000..347dc11d4ceb --- /dev/null +++ b/drivers/video/backlight/ipaq_micro_bl.c @@ -0,0 +1,83 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * iPAQ microcontroller backlight support + * Author : Linus Walleij <linus.walleij@linaro.org> + */ + +#include <linux/backlight.h> +#include <linux/err.h> +#include <linux/fb.h> +#include <linux/init.h> +#include <linux/mfd/ipaq-micro.h> +#include <linux/module.h> +#include <linux/platform_device.h> + +static int micro_bl_update_status(struct backlight_device *bd) +{ + struct ipaq_micro *micro = dev_get_drvdata(&bd->dev); + int intensity = bd->props.brightness; + struct ipaq_micro_msg msg = { + .id = MSG_BACKLIGHT, + .tx_len = 3, + }; + + if (bd->props.power != FB_BLANK_UNBLANK) + intensity = 0; + if (bd->props.state & (BL_CORE_FBBLANK | BL_CORE_SUSPENDED)) + intensity = 0; + + /* + * Message format: + * Byte 0: backlight instance (usually 1) + * Byte 1: on/off + * Byte 2: intensity, 0-255 + */ + msg.tx_data[0] = 0x01; + msg.tx_data[1] = intensity > 0 ? 1 : 0; + msg.tx_data[2] = intensity; + return ipaq_micro_tx_msg_sync(micro, &msg); +} + +static const struct backlight_ops micro_bl_ops = { + .options = BL_CORE_SUSPENDRESUME, + .update_status = micro_bl_update_status, +}; + +static struct backlight_properties micro_bl_props = { + .type = BACKLIGHT_RAW, + .max_brightness = 255, + .power = FB_BLANK_UNBLANK, + .brightness = 64, +}; + +static int micro_backlight_probe(struct platform_device *pdev) +{ + struct backlight_device *bd; + struct ipaq_micro *micro = dev_get_drvdata(pdev->dev.parent); + + bd = devm_backlight_device_register(&pdev->dev, "ipaq-micro-backlight", + &pdev->dev, micro, µ_bl_ops, + µ_bl_props); + if (IS_ERR(bd)) + return PTR_ERR(bd); + + platform_set_drvdata(pdev, bd); + backlight_update_status(bd); + + return 0; +} + +static struct platform_driver micro_backlight_device_driver = { + .driver = { + .name = "ipaq-micro-backlight", + }, + .probe = micro_backlight_probe, +}; +module_platform_driver(micro_backlight_device_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("driver for iPAQ Atmel micro backlight"); +MODULE_ALIAS("platform:ipaq-micro-backlight"); diff --git a/drivers/video/backlight/jornada720_lcd.c b/drivers/video/backlight/jornada720_lcd.c index da3876c9b3ae..228bc319de19 100644 --- a/drivers/video/backlight/jornada720_lcd.c +++ b/drivers/video/backlight/jornada720_lcd.c @@ -43,37 +43,38 @@ static int jornada_lcd_get_contrast(struct lcd_device *ld) jornada_ssp_start(); - if (jornada_ssp_byte(GETCONTRAST) != TXDUMMY) { - dev_err(&ld->dev, "get contrast failed\n"); - jornada_ssp_end(); - return -ETIMEDOUT; - } else { + if (jornada_ssp_byte(GETCONTRAST) == TXDUMMY) { ret = jornada_ssp_byte(TXDUMMY); - jornada_ssp_end(); - return ret; + goto success; } + + dev_err(&ld->dev, "failed to set contrast\n"); + ret = -ETIMEDOUT; + +success: + jornada_ssp_end(); + return ret; } static int jornada_lcd_set_contrast(struct lcd_device *ld, int value) { - int ret; + int ret = 0; jornada_ssp_start(); /* start by sending our set contrast cmd to mcu */ - ret = jornada_ssp_byte(SETCONTRAST); - - /* push the new value */ - if (jornada_ssp_byte(value) != TXDUMMY) { - dev_err(&ld->dev, "set contrast failed\n"); - jornada_ssp_end(); - return -ETIMEDOUT; + if (jornada_ssp_byte(SETCONTRAST) == TXDUMMY) { + /* if successful push the new value */ + if (jornada_ssp_byte(value) == TXDUMMY) + goto success; } - /* if we get here we can assume everything went well */ - jornada_ssp_end(); + dev_err(&ld->dev, "failed to set contrast\n"); + ret = -ETIMEDOUT; - return 0; +success: + jornada_ssp_end(); + return ret; } static int jornada_lcd_set_power(struct lcd_device *ld, int power) diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c index 506a6c236039..ccb44e8e4927 100644 --- a/drivers/video/backlight/ld9040.c +++ b/drivers/video/backlight/ld9040.c @@ -642,11 +642,6 @@ static int ld9040_get_power(struct lcd_device *ld) return lcd->power; } -static int ld9040_get_brightness(struct backlight_device *bd) -{ - return bd->props.brightness; -} - static int ld9040_set_brightness(struct backlight_device *bd) { int ret = 0, brightness = bd->props.brightness; @@ -674,7 +669,6 @@ static struct lcd_ops ld9040_lcd_ops = { }; static const struct backlight_ops ld9040_backlight_ops = { - .get_brightness = ld9040_get_brightness, .update_status = ld9040_set_brightness, }; diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index 2ca3a040007b..dcdd5443efcf 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c @@ -274,15 +274,9 @@ static int lp855x_bl_update_status(struct backlight_device *bl) return 0; } -static int lp855x_bl_get_brightness(struct backlight_device *bl) -{ - return bl->props.brightness; -} - static const struct backlight_ops lp855x_bl_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = lp855x_bl_update_status, - .get_brightness = lp855x_bl_get_brightness, }; static int lp855x_backlight_register(struct lp855x *lp) diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c index daba34dc46d4..d6c4f6a2d43e 100644 --- a/drivers/video/backlight/lp8788_bl.c +++ b/drivers/video/backlight/lp8788_bl.c @@ -176,15 +176,9 @@ static int lp8788_bl_update_status(struct backlight_device *bl_dev) return 0; } -static int lp8788_bl_get_brightness(struct backlight_device *bl_dev) -{ - return bl_dev->props.brightness; -} - static const struct backlight_ops lp8788_bl_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = lp8788_bl_update_status, - .get_brightness = lp8788_bl_get_brightness, }; static int lp8788_backlight_register(struct lp8788_bl *bl) diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c index 1802b2d1357d..8ab7297b118a 100644 --- a/drivers/video/backlight/lv5207lp.c +++ b/drivers/video/backlight/lv5207lp.c @@ -70,11 +70,6 @@ static int lv5207lp_backlight_update_status(struct backlight_device *backlight) return 0; } -static int lv5207lp_backlight_get_brightness(struct backlight_device *backlight) -{ - return backlight->props.brightness; -} - static int lv5207lp_backlight_check_fb(struct backlight_device *backlight, struct fb_info *info) { @@ -86,7 +81,6 @@ static int lv5207lp_backlight_check_fb(struct backlight_device *backlight, static const struct backlight_ops lv5207lp_backlight_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = lv5207lp_backlight_update_status, - .get_brightness = lv5207lp_backlight_get_brightness, .check_fb = lv5207lp_backlight_check_fb, }; diff --git a/drivers/video/backlight/pandora_bl.c b/drivers/video/backlight/pandora_bl.c index 2098c5d6efb9..2e3f82063c03 100644 --- a/drivers/video/backlight/pandora_bl.c +++ b/drivers/video/backlight/pandora_bl.c @@ -100,15 +100,9 @@ done: return 0; } -static int pandora_backlight_get_brightness(struct backlight_device *bl) -{ - return bl->props.brightness; -} - static const struct backlight_ops pandora_backlight_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = pandora_backlight_update_status, - .get_brightness = pandora_backlight_get_brightness, }; static int pandora_backlight_probe(struct platform_device *pdev) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 38ca88bc5c3e..d7a3d13e72ec 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -115,11 +115,6 @@ static int pwm_backlight_update_status(struct backlight_device *bl) return 0; } -static int pwm_backlight_get_brightness(struct backlight_device *bl) -{ - return bl->props.brightness; -} - static int pwm_backlight_check_fb(struct backlight_device *bl, struct fb_info *info) { @@ -130,7 +125,6 @@ static int pwm_backlight_check_fb(struct backlight_device *bl, static const struct backlight_ops pwm_backlight_ops = { .update_status = pwm_backlight_update_status, - .get_brightness = pwm_backlight_get_brightness, .check_fb = pwm_backlight_check_fb, }; @@ -245,13 +239,10 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->dev = &pdev->dev; pb->enabled = false; - pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable"); + pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable"); if (IS_ERR(pb->enable_gpio)) { ret = PTR_ERR(pb->enable_gpio); - if (ret == -ENOENT) - pb->enable_gpio = NULL; - else - goto err_alloc; + goto err_alloc; } /* diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index 2d6d48196c6d..f3a65c8940ed 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c @@ -597,11 +597,6 @@ static int s6e63m0_get_power(struct lcd_device *ld) return lcd->power; } -static int s6e63m0_get_brightness(struct backlight_device *bd) -{ - return bd->props.brightness; -} - static int s6e63m0_set_brightness(struct backlight_device *bd) { int ret = 0, brightness = bd->props.brightness; @@ -629,7 +624,6 @@ static struct lcd_ops s6e63m0_lcd_ops = { }; static const struct backlight_ops s6e63m0_backlight_ops = { - .get_brightness = s6e63m0_get_brightness, .update_status = s6e63m0_set_brightness, }; diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c index 595dcf561020..2e04d93aa0ef 100644 --- a/drivers/video/backlight/tps65217_bl.c +++ b/drivers/video/backlight/tps65217_bl.c @@ -109,15 +109,9 @@ static int tps65217_bl_update_status(struct backlight_device *bl) return rc; } -static int tps65217_bl_get_brightness(struct backlight_device *bl) -{ - return bl->props.brightness; -} - static const struct backlight_ops tps65217_bl_ops = { .options = BL_CORE_SUSPENDRESUME, .update_status = tps65217_bl_update_status, - .get_brightness = tps65217_bl_get_brightness }; static int tps65217_bl_hw_init(struct tps65217_bl *tps65217_bl, |