All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] backlight: pwm_bl: Fix condition to set enable gpio as output
@ 2017-04-16 10:35 ` Paul Kocialkowski
  0 siblings, 0 replies; 22+ messages in thread
From: Paul Kocialkowski @ 2017-04-16 10:35 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Thierry Reding, Lee Jones, Daniel Thompson, Jingoo Han,
	Bartlomiej Zolnierkiewicz, linux-pwm-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Paul Kocialkowski

The move to a dedicated pwm_backlight_initial_power_state function in
commit 7613c922315e308a6486d802abed2eb74443dffd modified the condition
to set the enable gpio as output. This breaks specific use cases using
that GPIO, such as tegra124-based nyan Chromebooks where backlight
stopped working.

This puts the condition back to the way it was before the move.

Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
---
 drivers/video/backlight/pwm_bl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index d7efcb632f7d..e81b2b55be2b 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -304,7 +304,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	 * early. Leave the decision of the initial backlight state for later.
 	 */
 	if (pb->enable_gpio &&
-	    gpiod_get_direction(pb->enable_gpio) == GPIOF_DIR_IN)
+	   (gpiod_get_direction(pb->enable_gpio) == GPIOF_DIR_IN ||
+	    gpiod_get_value(pb->enable_gpio) != 0))
 		gpiod_direction_output(pb->enable_gpio, 1);
 
 	pb->power_supply = devm_regulator_get(&pdev->dev, "power");
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-04-22 13:00 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-16 10:35 [PATCH] backlight: pwm_bl: Fix condition to set enable gpio as output Paul Kocialkowski
2017-04-16 10:35 ` Paul Kocialkowski
2017-04-16 10:35 ` Paul Kocialkowski
     [not found] ` <20170416103546.3021-1-contact-W9ppeneeCTY@public.gmane.org>
2017-04-16 20:55   ` Geert Uytterhoeven
2017-04-16 20:55     ` Geert Uytterhoeven
2017-04-16 20:55     ` Geert Uytterhoeven
     [not found]     ` <CAMuHMdV1+caNwbuk=Kw7cRUxcp1iC=YArnQXf2mcn+qnc6+OOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-17 15:38       ` Paul Kocialkowski
2017-04-17 15:38         ` Paul Kocialkowski
2017-04-17 15:38         ` Paul Kocialkowski
2017-04-17 19:36         ` Geert Uytterhoeven
2017-04-17 19:36           ` Geert Uytterhoeven
     [not found]           ` <CAMuHMdVLUmT_NJt86tspYEZnsFEiEwiNu_19RQu0qhtcyP1SdQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-18  8:46             ` Paul Kocialkowski
2017-04-18  8:46               ` Paul Kocialkowski
2017-04-18  8:46               ` Paul Kocialkowski
     [not found]               ` <1492505196.2014.0.camel-W9ppeneeCTY@public.gmane.org>
2017-04-20  9:55                 ` Daniel Thompson
2017-04-20  9:55                   ` Daniel Thompson
2017-04-20  9:55                   ` Daniel Thompson
     [not found]                   ` <e5a9e6ce-b1dd-96ae-c051-60be7cbfbe1d-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-04-20 10:16                     ` Geert Uytterhoeven
2017-04-20 10:16                       ` Geert Uytterhoeven
2017-04-20 10:16                       ` Geert Uytterhoeven
2017-04-22 13:00                   ` Paul Kocialkowski
2017-04-22 13:00                     ` Paul Kocialkowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.