Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/nvidia update PM field in set_config



details:   https://anonhg.NetBSD.org/src/rev/0f3d4bfaed7d
branches:  trunk
changeset: 808155:0f3d4bfaed7d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri May 08 17:00:51 2015 +0000

description:
update PM field in set_config

diffstat:

 sys/arch/arm/nvidia/tegra_mpio.c |  20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r 95dd36e18cfa -r 0f3d4bfaed7d sys/arch/arm/nvidia/tegra_mpio.c
--- a/sys/arch/arm/nvidia/tegra_mpio.c  Fri May 08 15:13:53 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra_mpio.c  Fri May 08 17:00:51 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_mpio.c,v 1.1 2015/05/07 23:55:11 jmcneill Exp $ */
+/* $NetBSD: tegra_mpio.c,v 1.2 2015/05/08 17:00:51 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_mpio.c,v 1.1 2015/05/07 23:55:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_mpio.c,v 1.2 2015/05/08 17:00:51 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -439,7 +439,20 @@
 tegra_mpio_pinmux_set_config(u_int reg, int flags, const char *func)
 {
        struct tegra_mpio_softc * const sc = tegra_mpio_lookup_softc();
+       const struct tegra_mpio_pinmux *pm;
        uint32_t val;
+       int funcno, n;
+
+       pm = tegra_mpio_lookup_pinmux(reg);
+       KASSERT(pm != NULL);
+
+       for (n = 0, funcno = -1; n < __arraycount(pm->pm_func); n++) {
+               if (strcmp(pm->pm_func[n], func) == 0) {
+                       funcno = n;
+                       break;
+               }
+       }
+       KASSERT(funcno != -1);
 
        val = MPIO_READ(sc, reg);
 
@@ -473,6 +486,9 @@
                val &= ~PINMUX_AUX_OD;
        }
 
+       val &= ~PINMUX_AUX_PM;
+       val |= __SHIFTIN(funcno, PINMUX_AUX_PM);
+
        MPIO_WRITE(sc, reg, val);
 }
 



Home | Main Index | Thread Index | Old Index