Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c Enable always-on and boot-on regulators at attac...



details:   https://anonhg.NetBSD.org/src/rev/3cd159e9d9e0
branches:  trunk
changeset: 999307:3cd159e9d9e0
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue May 28 09:52:17 2019 +0000

description:
Enable always-on and boot-on regulators at attach time

diffstat:

 sys/dev/i2c/axppmic.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r fe8eb144b6a9 -r 3cd159e9d9e0 sys/dev/i2c/axppmic.c
--- a/sys/dev/i2c/axppmic.c     Tue May 28 09:24:33 2019 +0000
+++ b/sys/dev/i2c/axppmic.c     Tue May 28 09:52:17 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: axppmic.c,v 1.21 2019/05/27 23:28:41 jmcneill Exp $ */
+/* $NetBSD: axppmic.c,v 1.22 2019/05/28 09:52:17 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.21 2019/05/27 23:28:41 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.22 2019/05/28 09:52:17 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1037,10 +1037,16 @@
        if (of_getprop_uint32(phandle, "regulator-min-microvolt", &min_uvol) == 0 &&
            of_getprop_uint32(phandle, "regulator-max-microvolt", &max_uvol) == 0) {
                if (uvol < min_uvol || uvol > max_uvol) {
-                       aprint_debug_dev(self, "fix voltage %u uV -> %u/%u uV\n", uvol, min_uvol, max_uvol);
+                       aprint_debug_dev(self, "fix voltage %u uV -> %u/%u uV\n",
+                           uvol, min_uvol, max_uvol);
                        axpreg_set_voltage(self, min_uvol, max_uvol);
                }
        }
+
+       if (of_hasprop(phandle, "regulator-always-on") ||
+           of_hasprop(phandle, "regulator-boot-on")) {
+               axpreg_enable(self, true);
+       }
 }
 
 CFATTACH_DECL_NEW(axppmic, sizeof(struct axppmic_softc),



Home | Main Index | Thread Index | Old Index