Skip to content

Commit 9e87a8d

Browse files
MerlijnWajerpavelmachek
authored andcommitted
leds: lp55xx: initialise output direction from dts
Commit a5d3d1a ("leds: lp55xx: Initialize enable GPIO direction to output") attempts to fix this, but the fix did not work since at least for the Nokia N900 the value needs to be set to HIGH, per the device tree. So rather than hardcoding the value to a potentially invalid value for some devices, let's set direction in lp55xx_init_device. Fixes: a5d3d1a ("leds: lp55xx: Initialize enable GPIO direction to output") Fixes: 92a8156 ("leds: lp55xx: Add multicolor framework support to lp55xx") Fixes: ac219bf ("leds: lp55xx: Convert to use GPIO descriptors") Signed-off-by: Merlijn Wajer <merlijn@wizzup.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
1 parent e9af026 commit 9e87a8d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/leds/leds-lp55xx-common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ int lp55xx_init_device(struct lp55xx_chip *chip)
439439
return -EINVAL;
440440

441441
if (pdata->enable_gpiod) {
442+
gpiod_direction_output(pdata->enable_gpiod, 0);
443+
442444
gpiod_set_consumer_name(pdata->enable_gpiod, "LP55xx enable");
443445
gpiod_set_value(pdata->enable_gpiod, 0);
444446
usleep_range(1000, 2000); /* Keep enable down at least 1ms */
@@ -694,7 +696,7 @@ struct lp55xx_platform_data *lp55xx_of_populate_pdata(struct device *dev,
694696
of_property_read_u8(np, "clock-mode", &pdata->clock_mode);
695697

696698
pdata->enable_gpiod = devm_gpiod_get_optional(dev, "enable",
697-
GPIOD_OUT_LOW);
699+
GPIOD_ASIS);
698700
if (IS_ERR(pdata->enable_gpiod))
699701
return ERR_CAST(pdata->enable_gpiod);
700702

0 commit comments

Comments
 (0)