Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/fdt Use enable gpio to turn the display...



details:   https://anonhg.NetBSD.org/src/rev/ce38114cf70b
branches:  trunk
changeset: 318834:ce38114cf70b
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun May 06 10:45:32 2018 +0000
description:
Use enable gpio to turn the display on/off

diffstat:

 sys/dev/fdt/pwm_backlight.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (46 lines):

diff -r 8f9506276d6a -r ce38114cf70b sys/dev/fdt/pwm_backlight.c
--- a/sys/dev/fdt/pwm_backlight.c       Sun May 06 10:43:52 2018 +0000
+++ b/sys/dev/fdt/pwm_backlight.c       Sun May 06 10:45:32 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pwm_backlight.c,v 1.1 2018/05/06 10:33:21 jmcneill Exp $ */
+/* $NetBSD: pwm_backlight.c,v 1.2 2018/05/06 10:45:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pwm_backlight.c,v 1.1 2018/05/06 10:33:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pwm_backlight.c,v 1.2 2018/05/06 10:45:32 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -100,6 +100,7 @@
                        aprint_error(": couldn't acquire enable gpio\n");
                        return;
                }
+               fdtbus_gpio_write(sc->sc_pin, 1);
        }
 
        levels = fdtbus_get_prop(phandle, "brightness-levels", &len);
@@ -246,7 +247,8 @@
 {
        struct pwm_backlight_softc * const sc = device_private(dev);
 
-       pwm_enable(sc->sc_pwm);
+       if (sc->sc_pin)
+               fdtbus_gpio_write(sc->sc_pin, 1);
 }
 
 static void
@@ -254,7 +256,8 @@
 {
        struct pwm_backlight_softc * const sc = device_private(dev);
 
-       pwm_disable(sc->sc_pwm);
+       if (sc->sc_pin)
+               fdtbus_gpio_write(sc->sc_pin, 0);
 }
 
 static void



Home | Main Index | Thread Index | Old Index