- New Device Support
- None - New Functionality - None - Core Frameworks - Reject legacy PWM request for device defined in DT - Fix-ups - Remove unnecessary MODULE_ALIAS(); adp8860_bl, adp8870_bl - Simplify code: pm8941-wled - Supply default-brightness logic; pm8941-wled - Bug Fixes - Clean up OF node; 88pm860x_bl - Ensure struct is zeroed; lp855x_bl -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJWOzLmAAoJEFGvii+H/Hdhrd8P/3HB4ueeFN2lEUx+/m9/8uRT 4YGXhza47bpVgLF0fPj/jHx5aRDIrwxd8yXqYSmVjNqwgtJ9u2gSRS9K3HM0g0ic P8UhsdWc71zdFzr1qvWo6iI6oWoVfC0QiDBBufxLAwD4fULkO3xRzdrhE4KXDRBz jOOH+noUReTK+waUinBObbYll2LFP5Rg+GI7JzApB+zCykgSxhT4rqGiihbdtQjS fzKVk10DgKaoEfb1ePRxL8LXmipANPF5tt1jHb8i8iZm1NQH0U3nk+HS01wLuX2q DsvX5XY+aAzT99suGZUpswEGgF8Fj5d182EOUyCCR567JH7zCVMhjZjRL7LZGGId gJ7ZS8kzhiULPPvETpjx8xurwje+3aY5O1M3moCi/CH70hJSENwj6+l8M8RW/Z76 b9LD4ZOHTuZxY9k2cX+oKsVlLL0ysXYwEsie1bDnROm6bx6duakq7KtSy+G5Zh9e QOUqMvQm4ThjqV3NfOl+sjdzt62p7IlnocBVx9PMMQfGlk9EtzvR1RGtqr/5PMiX g7YIHlt0RxU/8NnGkYLk132cFah74saCgTr/swxWy1jCVX4sTFXz1l9Shxa6+Twc Uu+RIjosQNxNiL1Tsve/R9je/EMROYKvNIPI/rP+Zq2ogEtYTjARboa7Qy9XWBmb S/pimL/8yHHrMArrjGlc =Jkv1 -----END PGP SIGNATURE----- Merge tag 'backlight-for-linus-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "New Device Support - None New Functionality: - None Core Frameworks: - Reject legacy PWM request for device defined in DT Fix-ups: - Remove unnecessary MODULE_ALIAS(); adp8860_bl, adp8870_bl - Simplify code: pm8941-wled - Supply default-brightness logic; pm8941-wled Bug Fixes: - Clean up OF node; 88pm860x_bl - Ensure struct is zeroed; lp855x_bl" * tag 'backlight-for-linus-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: pm8941-wled: Add default-brightness property backlight: pm8941-wled: Fix ptr_ret.cocci warnings backlight: pwm: Reject legacy PWM request for device defined in DT backlight: 88pm860x_bl: Add missing of_node_put backlight: adp8870: Remove unnecessary MODULE_ALIAS() backlight: adp8860: Remove unnecessary MODULE_ALIAS() backlight: lp855x: Make sure props struct is zeroed
This commit is contained in:
commit
5bc23a0cde
|
@ -5,6 +5,8 @@ Required properties:
|
|||
- reg: slave address
|
||||
|
||||
Optional properties:
|
||||
- default-brightness: brightness value on boot, value from: 0-4095
|
||||
default: 2048
|
||||
- label: The name of the backlight device
|
||||
- qcom,cs-out: bool; enable current sink output
|
||||
- qcom,cabc: bool; enable content adaptive backlight control
|
||||
|
|
|
@ -180,6 +180,7 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev,
|
|||
data->iset = PM8606_WLED_CURRENT(iset);
|
||||
of_property_read_u32(np, "marvell,88pm860x-pwm",
|
||||
&data->pwm);
|
||||
of_node_put(np);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -819,4 +819,3 @@ module_i2c_driver(adp8860_driver);
|
|||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
|
||||
MODULE_DESCRIPTION("ADP8860 Backlight driver");
|
||||
MODULE_ALIAS("i2c:adp8860-backlight");
|
||||
|
|
|
@ -992,4 +992,3 @@ module_i2c_driver(adp8870_driver);
|
|||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
|
||||
MODULE_DESCRIPTION("ADP8870 Backlight driver");
|
||||
MODULE_ALIAS("i2c:adp8870-backlight");
|
||||
|
|
|
@ -283,6 +283,7 @@ static int lp855x_backlight_register(struct lp855x *lp)
|
|||
struct lp855x_platform_data *pdata = lp->pdata;
|
||||
const char *name = pdata->name ? : DEFAULT_BL_NAME;
|
||||
|
||||
memset(&props, 0, sizeof(props));
|
||||
props.type = BACKLIGHT_PLATFORM;
|
||||
props.max_brightness = MAX_BRIGHTNESS;
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
#include <linux/of_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
/* From DT binding */
|
||||
#define PM8941_WLED_DEFAULT_BRIGHTNESS 2048
|
||||
|
||||
#define PM8941_WLED_REG_VAL_BASE 0x40
|
||||
#define PM8941_WLED_REG_VAL_MAX 0xFFF
|
||||
|
||||
|
@ -373,6 +376,7 @@ static int pm8941_wled_probe(struct platform_device *pdev)
|
|||
struct backlight_device *bl;
|
||||
struct pm8941_wled *wled;
|
||||
struct regmap *regmap;
|
||||
u32 val;
|
||||
int rc;
|
||||
|
||||
regmap = dev_get_regmap(pdev->dev.parent, NULL);
|
||||
|
@ -395,16 +399,17 @@ static int pm8941_wled_probe(struct platform_device *pdev)
|
|||
if (rc)
|
||||
return rc;
|
||||
|
||||
val = PM8941_WLED_DEFAULT_BRIGHTNESS;
|
||||
of_property_read_u32(pdev->dev.of_node, "default-brightness", &val);
|
||||
|
||||
memset(&props, 0, sizeof(struct backlight_properties));
|
||||
props.type = BACKLIGHT_RAW;
|
||||
props.brightness = val;
|
||||
props.max_brightness = PM8941_WLED_REG_VAL_MAX;
|
||||
bl = devm_backlight_device_register(&pdev->dev, wled->name,
|
||||
&pdev->dev, wled,
|
||||
&pm8941_wled_ops, &props);
|
||||
if (IS_ERR(bl))
|
||||
return PTR_ERR(bl);
|
||||
|
||||
return 0;
|
||||
return PTR_ERR_OR_ZERO(bl);
|
||||
};
|
||||
|
||||
static const struct of_device_id pm8941_wled_match_table[] = {
|
||||
|
|
|
@ -271,19 +271,18 @@ static int pwm_backlight_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
pb->pwm = devm_pwm_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(pb->pwm)) {
|
||||
ret = PTR_ERR(pb->pwm);
|
||||
if (ret == -EPROBE_DEFER)
|
||||
goto err_alloc;
|
||||
|
||||
if (IS_ERR(pb->pwm) && PTR_ERR(pb->pwm) != -EPROBE_DEFER
|
||||
&& !pdev->dev.of_node) {
|
||||
dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
|
||||
pb->legacy = true;
|
||||
pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");
|
||||
if (IS_ERR(pb->pwm)) {
|
||||
dev_err(&pdev->dev, "unable to request legacy PWM\n");
|
||||
ret = PTR_ERR(pb->pwm);
|
||||
goto err_alloc;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ERR(pb->pwm)) {
|
||||
ret = PTR_ERR(pb->pwm);
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(&pdev->dev, "unable to request PWM\n");
|
||||
goto err_alloc;
|
||||
}
|
||||
|
||||
dev_dbg(&pdev->dev, "got pwm for backlight\n");
|
||||
|
|
Loading…
Reference in New Issue