forked from Minki/linux
- New Device Support
- Add support for PMI8994 to Qualcom WLED - Add support for KTD259 to Kinetic KTD253 - Fix-ups - Device Tree related fix-ups; kinetic,ktd253 - Use proper sequence during sync_toggle; qcom-wled - Fix Wmisleading-indentation warnings; jornada720_bl - Bug Fixes - Fix sync toggle on WLED4; qcom-wled - Fix FSC update on WLED5; qcom-wled -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmCJICgACgkQUa+KL4f8 d2F+Qw/9EohNYW2uP+PdN8BHze+vfw4toYqjV2fEHmYhwFq/CBPBdsTB2KGqPqc6 pNJe/GYA4S2mqIR/2jUZyJBq56kBuxmbHRLnwHQPxJRHawlB15JUWJLZp3Uw260f AC1OKzEByKIPKHFMmClkRTQXd/mfGEf+hlfHraIKu0Vn29mPXkmoLhBDJNHinL8m ojCuSJdPw3xuwKVDOVmJ0kY0tAXHOgON7U3VJNbAPZzl34tSFey41scqzYF2fOPm rPoXRYPD1pskw2lF966whuz5+4X0+YDN8nOgTNIf8o3/QhUNfOebdMvmCckAKuPr 7cIj0mDTp/BOqZUeUhl9J8dJsClf3mdiWaqEvg/WZAl9z5gycp/eq22111mJiuWx kH2+lDoyBwtaCQu6CkgLFfvMF5MY9dgSMbF9ozSMOw/bZp0RZUuY5W0nMQ68NEuz wvYtOHfE2pBvRxnbA2SWPiFEEyH1Zu0iRC3Ox7j0RCw9baYVTJYAqNMEcwXeCMfr p/W+olbcMz/DoQGqwXn+45m0AvJcV/IBwKhtUcSuKwkDaA72OOQKrVYV73E4nkAx vNLBZT7ablgEj9sm8BwAUyfwhUDab2X7kmhb+mqvTBkOlkBsKke8LjHbcTXDPMqs Ej1/mokgBr9zIjE5/3annh/bSM2hHHET8+/n4NO5xeh8ZYVxfpI= =nJl6 -----END PGP SIGNATURE----- Merge tag 'backlight-next-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "New Device Support: - Add support for PMI8994 to Qualcom WLED - Add support for KTD259 to Kinetic KTD253 Fix-ups: - Device Tree related fix-ups; kinetic,ktd253 - Use proper sequence during sync_toggle; qcom-wled - Fix Wmisleading-indentation warnings; jornada720_bl Bug Fixes: - Fix sync toggle on WLED4; qcom-wled - Fix FSC update on WLED5; qcom-wled" * tag 'backlight-next-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: journada720: Fix Wmisleading-indentation warning backlight: qcom-wled: Correct the sync_toggle sequence backlight: qcom-wled: Fix FSC update issue for WLED5 dt-bindings: backlight: Add Kinetic KTD259 bindings backlight: ktd253: Support KTD259 backlight: qcom-wled: Use sink_addr for sync toggle dt-bindings: backlight: qcom-wled: Add PMI8994 compatible
This commit is contained in:
commit
c969f2451b
@ -4,13 +4,13 @@
|
|||||||
$id: http://devicetree.org/schemas/leds/backlight/kinetic,ktd253.yaml#
|
$id: http://devicetree.org/schemas/leds/backlight/kinetic,ktd253.yaml#
|
||||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||||
|
|
||||||
title: Kinetic Technologies KTD253 one-wire backlight
|
title: Kinetic Technologies KTD253 and KTD259 one-wire backlight
|
||||||
|
|
||||||
maintainers:
|
maintainers:
|
||||||
- Linus Walleij <linus.walleij@linaro.org>
|
- Linus Walleij <linus.walleij@linaro.org>
|
||||||
|
|
||||||
description: |
|
description: |
|
||||||
The Kinetic Technologies KTD253 is a white LED backlight that is
|
The Kinetic Technologies KTD253 and KTD259 are white LED backlights
|
||||||
controlled by a single GPIO line. If you just turn on the backlight
|
controlled by a single GPIO line. If you just turn on the backlight
|
||||||
it goes to maximum backlight then you can set the level of backlight
|
it goes to maximum backlight then you can set the level of backlight
|
||||||
using pulses on the enable wire. This is sometimes referred to as
|
using pulses on the enable wire. This is sometimes referred to as
|
||||||
@ -21,7 +21,10 @@ allOf:
|
|||||||
|
|
||||||
properties:
|
properties:
|
||||||
compatible:
|
compatible:
|
||||||
const: kinetic,ktd253
|
items:
|
||||||
|
- enum:
|
||||||
|
- kinetic,ktd253
|
||||||
|
- kinetic,ktd259
|
||||||
|
|
||||||
enable-gpios:
|
enable-gpios:
|
||||||
description: GPIO to use to enable/disable and dim the backlight.
|
description: GPIO to use to enable/disable and dim the backlight.
|
||||||
|
@ -19,6 +19,7 @@ properties:
|
|||||||
compatible:
|
compatible:
|
||||||
enum:
|
enum:
|
||||||
- qcom,pm8941-wled
|
- qcom,pm8941-wled
|
||||||
|
- qcom,pmi8994-wled
|
||||||
- qcom,pmi8998-wled
|
- qcom,pmi8998-wled
|
||||||
- qcom,pm660l-wled
|
- qcom,pm660l-wled
|
||||||
- qcom,pm8150l-wled
|
- qcom,pm8150l-wled
|
||||||
|
@ -66,30 +66,30 @@ static int jornada_bl_update_status(struct backlight_device *bd)
|
|||||||
} else /* turn on backlight */
|
} else /* turn on backlight */
|
||||||
PPSR |= PPC_LDD1;
|
PPSR |= PPC_LDD1;
|
||||||
|
|
||||||
/* send command to our mcu */
|
/* send command to our mcu */
|
||||||
if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) {
|
if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) {
|
||||||
dev_info(&bd->dev, "failed to set brightness\n");
|
dev_info(&bd->dev, "failed to set brightness\n");
|
||||||
ret = -ETIMEDOUT;
|
ret = -ETIMEDOUT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* at this point we expect that the mcu has accepted
|
* at this point we expect that the mcu has accepted
|
||||||
* our command and is waiting for our new value
|
* our command and is waiting for our new value
|
||||||
* please note that maximum brightness is 255,
|
* please note that maximum brightness is 255,
|
||||||
* but due to physical layout it is equal to 0, so we simply
|
* but due to physical layout it is equal to 0, so we simply
|
||||||
* invert the value (MAX VALUE - NEW VALUE).
|
* invert the value (MAX VALUE - NEW VALUE).
|
||||||
*/
|
*/
|
||||||
if (jornada_ssp_byte(BL_MAX_BRIGHT - bd->props.brightness)
|
if (jornada_ssp_byte(BL_MAX_BRIGHT - bd->props.brightness)
|
||||||
!= TXDUMMY) {
|
!= TXDUMMY) {
|
||||||
dev_err(&bd->dev, "set brightness failed\n");
|
dev_err(&bd->dev, "set brightness failed\n");
|
||||||
ret = -ETIMEDOUT;
|
ret = -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If infact we get an TXDUMMY as output we are happy and dont
|
* If infact we get an TXDUMMY as output we are happy and dont
|
||||||
* make any further comments about it
|
* make any further comments about it
|
||||||
*/
|
*/
|
||||||
out:
|
out:
|
||||||
jornada_ssp_end();
|
jornada_ssp_end();
|
||||||
|
|
||||||
|
@ -173,6 +173,7 @@ static int ktd253_backlight_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
static const struct of_device_id ktd253_backlight_of_match[] = {
|
static const struct of_device_id ktd253_backlight_of_match[] = {
|
||||||
{ .compatible = "kinetic,ktd253" },
|
{ .compatible = "kinetic,ktd253" },
|
||||||
|
{ .compatible = "kinetic,ktd259" },
|
||||||
{ /* sentinel */ }
|
{ /* sentinel */ }
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, ktd253_backlight_of_match);
|
MODULE_DEVICE_TABLE(of, ktd253_backlight_of_match);
|
||||||
|
@ -336,34 +336,34 @@ static int wled3_sync_toggle(struct wled *wled)
|
|||||||
unsigned int mask = GENMASK(wled->max_string_count - 1, 0);
|
unsigned int mask = GENMASK(wled->max_string_count - 1, 0);
|
||||||
|
|
||||||
rc = regmap_update_bits(wled->regmap,
|
rc = regmap_update_bits(wled->regmap,
|
||||||
wled->ctrl_addr + WLED3_SINK_REG_SYNC,
|
wled->sink_addr + WLED3_SINK_REG_SYNC,
|
||||||
mask, mask);
|
mask, WLED3_SINK_REG_SYNC_CLEAR);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rc = regmap_update_bits(wled->regmap,
|
rc = regmap_update_bits(wled->regmap,
|
||||||
wled->ctrl_addr + WLED3_SINK_REG_SYNC,
|
wled->sink_addr + WLED3_SINK_REG_SYNC,
|
||||||
mask, WLED3_SINK_REG_SYNC_CLEAR);
|
mask, mask);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wled5_sync_toggle(struct wled *wled)
|
static int wled5_mod_sync_toggle(struct wled *wled)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
|
||||||
val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_REG_SYNC_MOD_A_BIT :
|
|
||||||
WLED5_SINK_REG_SYNC_MOD_B_BIT;
|
|
||||||
rc = regmap_update_bits(wled->regmap,
|
rc = regmap_update_bits(wled->regmap,
|
||||||
wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
|
wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
|
||||||
WLED5_SINK_REG_SYNC_MASK, val);
|
WLED5_SINK_REG_SYNC_MASK, 0);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_REG_SYNC_MOD_A_BIT :
|
||||||
|
WLED5_SINK_REG_SYNC_MOD_B_BIT;
|
||||||
return regmap_update_bits(wled->regmap,
|
return regmap_update_bits(wled->regmap,
|
||||||
wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
|
wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
|
||||||
WLED5_SINK_REG_SYNC_MASK, 0);
|
WLED5_SINK_REG_SYNC_MASK, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wled_ovp_fault_status(struct wled *wled, bool *fault_set)
|
static int wled_ovp_fault_status(struct wled *wled, bool *fault_set)
|
||||||
@ -445,10 +445,23 @@ static int wled_update_status(struct backlight_device *bl)
|
|||||||
goto unlock_mutex;
|
goto unlock_mutex;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = wled->wled_sync_toggle(wled);
|
if (wled->version < 5) {
|
||||||
if (rc < 0) {
|
rc = wled->wled_sync_toggle(wled);
|
||||||
dev_err(wled->dev, "wled sync failed rc:%d\n", rc);
|
if (rc < 0) {
|
||||||
goto unlock_mutex;
|
dev_err(wled->dev, "wled sync failed rc:%d\n", rc);
|
||||||
|
goto unlock_mutex;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* For WLED5 toggling the MOD_SYNC_BIT updates the
|
||||||
|
* brightness
|
||||||
|
*/
|
||||||
|
rc = wled5_mod_sync_toggle(wled);
|
||||||
|
if (rc < 0) {
|
||||||
|
dev_err(wled->dev, "wled mod sync failed rc:%d\n",
|
||||||
|
rc);
|
||||||
|
goto unlock_mutex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1459,7 +1472,7 @@ static int wled_configure(struct wled *wled)
|
|||||||
size = ARRAY_SIZE(wled5_opts);
|
size = ARRAY_SIZE(wled5_opts);
|
||||||
*cfg = wled5_config_defaults;
|
*cfg = wled5_config_defaults;
|
||||||
wled->wled_set_brightness = wled5_set_brightness;
|
wled->wled_set_brightness = wled5_set_brightness;
|
||||||
wled->wled_sync_toggle = wled5_sync_toggle;
|
wled->wled_sync_toggle = wled3_sync_toggle;
|
||||||
wled->wled_cabc_config = wled5_cabc_config;
|
wled->wled_cabc_config = wled5_cabc_config;
|
||||||
wled->wled_ovp_delay = wled5_ovp_delay;
|
wled->wled_ovp_delay = wled5_ovp_delay;
|
||||||
wled->wled_auto_detection_required =
|
wled->wled_auto_detection_required =
|
||||||
|
Loading…
Reference in New Issue
Block a user