== Changes to existing drivers ==
- Supply MODULE_DEVICE_TABLE() to ensure probing - Constify struct; da9052_bl - Enable compile test; lcd_l4f00242t03, lcd_lms283fg05, backlight_gpio - Suspend/resume bugfix; lp855x_bl - devm_gpiod_get_optional() API fixup; pwm_bl - Error handling fixup; backlight -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJViXR7AAoJEFGvii+H/HdhZPsP/3kxXQNCt2voEj96MFLXWLwq 1cbWbPboslNkdYPY9ygLTIqop/NOoEwiZMLE2Ea3uBDFewLU27vEX4waG+ILITjG /KxBAUXnNvFTrv9X+5hiOm6D+6kLk2M2eEygSC6f9QgBXP4VjApkVvpehdDKWT5x X11wlfx/TYhLcj5iggyW39fACp8Aig7LvOigS7fjfhwn1PAjWVw6NLrxmIlysWbH 8qMfL0u8Ks5BYSh4xr5ATrB6OLx5Hu3mv9d8AK8o4XsRXOrFtR/dMThOLcJq/bFi 4Vp4roi/30RSpow1yKPS3+TBRFbn2PG+6G6GVbWCO/uVkQiaxteyM79P0gEy5Y2a 8WvV3vOMYY1/FszCOIfrJbj4No5/Bc2fObLXYDursLYMOPhUNrWeyRxbLfHTpKR3 kim8XFGzLE5qFLqQWheqkHDq24y1iz6fl4YEZ8avf1rnDfzNJx8fnHk2uXZrW6ru HdjXbGC4pht1j6uM+DDROZ3iM5+2AMb/ASPLSCqslXXG82BCva3wasrMd3RttEQN bUltoWgWAMonIYoNx3CYwOGS9sWFllq1b0dTl1qDQPRT55sR4zcMZbMp16A0whJ7 bJQMflbkgWDCeiMg5vXrImxmBBwfAe6IQ3yfEMUNNf+CzJxVnGjvpWvDWHo5iqhd Ul8lq/XdnXvpSSUugWhM =8cYG -----END PGP SIGNATURE----- Merge tag 'backlight-for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "Changes to existing drivers: - supply MODULE_DEVICE_TABLE() to ensure probing - constify struct; da9052_bl - enable compile test; lcd_l4f00242t03, lcd_lms283fg05, backlight_gpio - suspend/resume bugfix; lp855x_bl - devm_gpiod_get_optional() API fixup; pwm_bl - error handling fixup; backlight" * tag 'backlight-for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: Change the return type of backlight_update_status() to int backlight: pwm_bl: Simplify usage of devm_gpiod_get_optional backlight: lp855x: Don't clear level on suspend/blank backlight: Allow compile test of GPIO consumers if !GPIOLIB video: backlight: da9052: Constify platform_device_id gpio-backlight: Discover driver during boot time
This commit is contained in:
Коммит
d59b92f93d
|
@ -36,14 +36,16 @@ config LCD_CORGI
|
|||
|
||||
config LCD_L4F00242T03
|
||||
tristate "Epson L4F00242T03 LCD"
|
||||
depends on SPI_MASTER && GPIOLIB
|
||||
depends on SPI_MASTER
|
||||
depends on GPIOLIB || COMPILE_TEST
|
||||
help
|
||||
SPI driver for Epson L4F00242T03. This provides basic support
|
||||
for init and powering the LCD up/down through a sysfs interface.
|
||||
|
||||
config LCD_LMS283GF05
|
||||
tristate "Samsung LMS283GF05 LCD"
|
||||
depends on SPI_MASTER && GPIOLIB
|
||||
depends on SPI_MASTER
|
||||
depends on GPIOLIB || COMPILE_TEST
|
||||
help
|
||||
SPI driver for Samsung LMS283GF05. This provides basic support
|
||||
for powering the LCD up/down through a sysfs interface.
|
||||
|
@ -434,7 +436,7 @@ config BACKLIGHT_AS3711
|
|||
|
||||
config BACKLIGHT_GPIO
|
||||
tristate "Generic GPIO based Backlight Driver"
|
||||
depends on GPIOLIB
|
||||
depends on GPIOLIB || COMPILE_TEST
|
||||
help
|
||||
If you have a LCD backlight adjustable by GPIO, say Y to enable
|
||||
this driver.
|
||||
|
|
|
@ -152,7 +152,7 @@ static int da9052_backlight_remove(struct platform_device *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_device_id da9052_wled_ids[] = {
|
||||
static const struct platform_device_id da9052_wled_ids[] = {
|
||||
{
|
||||
.name = "da9052-wled1",
|
||||
.driver_data = DA9052_TYPE_WLED1,
|
||||
|
|
|
@ -146,6 +146,8 @@ static struct of_device_id gpio_backlight_of_match[] = {
|
|||
{ .compatible = "gpio-backlight" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, gpio_backlight_of_match);
|
||||
#endif
|
||||
|
||||
static struct platform_driver gpio_backlight_driver = {
|
||||
|
|
|
@ -257,21 +257,15 @@ static void lp855x_pwm_ctrl(struct lp855x *lp, int br, int max_br)
|
|||
static int lp855x_bl_update_status(struct backlight_device *bl)
|
||||
{
|
||||
struct lp855x *lp = bl_get_data(bl);
|
||||
int brightness = bl->props.brightness;
|
||||
|
||||
if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
|
||||
bl->props.brightness = 0;
|
||||
brightness = 0;
|
||||
|
||||
if (lp->mode == PWM_BASED) {
|
||||
int br = bl->props.brightness;
|
||||
int max_br = bl->props.max_brightness;
|
||||
|
||||
lp855x_pwm_ctrl(lp, br, max_br);
|
||||
|
||||
} else if (lp->mode == REGISTER_BASED) {
|
||||
u8 val = bl->props.brightness;
|
||||
|
||||
lp855x_write_byte(lp, lp->cfg->reg_brightness, val);
|
||||
}
|
||||
if (lp->mode == PWM_BASED)
|
||||
lp855x_pwm_ctrl(lp, brightness, bl->props.max_brightness);
|
||||
else if (lp->mode == REGISTER_BASED)
|
||||
lp855x_write_byte(lp, lp->cfg->reg_brightness, (u8)brightness);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -241,7 +241,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
|
|||
pb->dev = &pdev->dev;
|
||||
pb->enabled = false;
|
||||
|
||||
pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
|
||||
pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
|
||||
GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(pb->enable_gpio)) {
|
||||
ret = PTR_ERR(pb->enable_gpio);
|
||||
goto err_alloc;
|
||||
|
@ -263,9 +264,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
|
|||
pb->enable_gpio = gpio_to_desc(data->enable_gpio);
|
||||
}
|
||||
|
||||
if (pb->enable_gpio)
|
||||
gpiod_direction_output(pb->enable_gpio, 1);
|
||||
|
||||
pb->power_supply = devm_regulator_get(&pdev->dev, "power");
|
||||
if (IS_ERR(pb->power_supply)) {
|
||||
ret = PTR_ERR(pb->power_supply);
|
||||
|
|
|
@ -117,12 +117,16 @@ struct backlight_device {
|
|||
int use_count;
|
||||
};
|
||||
|
||||
static inline void backlight_update_status(struct backlight_device *bd)
|
||||
static inline int backlight_update_status(struct backlight_device *bd)
|
||||
{
|
||||
int ret = -ENOENT;
|
||||
|
||||
mutex_lock(&bd->update_lock);
|
||||
if (bd->ops && bd->ops->update_status)
|
||||
bd->ops->update_status(bd);
|
||||
ret = bd->ops->update_status(bd);
|
||||
mutex_unlock(&bd->update_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern struct backlight_device *backlight_device_register(const char *name,
|
||||
|
|
Загрузка…
Ссылка в новой задаче