aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Moll <moll.markus@arcor.de>2020-09-22 21:31:15 +0200
committerPavel Machek <pavel@ucw.cz>2020-09-24 14:22:59 +0200
commit47e64678cd6e7281f8817a632603086c4a5521ad (patch)
treee4e0e3f3ec1474ac5fb5f53a45a4c9e96a7c7543
parentd5d8cefecb9dba59aa44c8a99f517d9dee3273ab (diff)
leds: pca9532: read pwm settings from device treepavels-for-next
While the two pca9532 pwms can be configured in the platform data struct, there was no corresponding dt binding. Users need to configure the pwm if some leds should blink or continue blinking during boot. Signed-off-by: Markus Moll <mmoll@de.pepperl-fuchs.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
-rw-r--r--drivers/leds/leds-pca9532.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index d37fd9577d4b20..27d02716547250 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -480,6 +480,11 @@ pca9532_of_populate_pdata(struct device *dev, struct device_node *np)
if (!pdata)
return ERR_PTR(-ENOMEM);
+ of_property_read_u8_array(np, "nxp,pwm", &pdata->pwm[0],
+ ARRAY_SIZE(pdata->pwm));
+ of_property_read_u8_array(np, "nxp,psc", &pdata->psc[0],
+ ARRAY_SIZE(pdata->psc));
+
for_each_available_child_of_node(np, child) {
if (of_property_read_string(child, "label",
&pdata->leds[i].name))