Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/amlogic When acquiring a GPIO, disable any conf...
details: https://anonhg.NetBSD.org/src/rev/2710b2b85cb4
branches: trunk
changeset: 839657:2710b2b85cb4
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Mar 02 11:15:55 2019 +0000
description:
When acquiring a GPIO, disable any conflicting pinctrl function groups
diffstat:
sys/arch/arm/amlogic/meson_pinctrl.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diffs (45 lines):
diff -r d416e94803bf -r 2710b2b85cb4 sys/arch/arm/amlogic/meson_pinctrl.c
--- a/sys/arch/arm/amlogic/meson_pinctrl.c Sat Mar 02 03:21:17 2019 +0000
+++ b/sys/arch/arm/amlogic/meson_pinctrl.c Sat Mar 02 11:15:55 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_pinctrl.c,v 1.3 2019/02/25 19:30:17 jmcneill Exp $ */
+/* $NetBSD: meson_pinctrl.c,v 1.4 2019/03/02 11:15:55 jmcneill Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
#include "opt_soc.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: meson_pinctrl.c,v 1.3 2019/02/25 19:30:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_pinctrl.c,v 1.4 2019/03/02 11:15:55 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -321,8 +321,10 @@
{
struct meson_pinctrl_softc * const sc = device_private(dev);
const struct meson_pinctrl_gpio *pin_def;
+ const struct meson_pinctrl_group *group;
struct meson_pinctrl_gpio_pin *gpin;
const u_int *gpio = data;
+ u_int n, bank;
if (len != 12)
return NULL;
@@ -334,6 +336,15 @@
if (pin_def == NULL)
return NULL;
+ /* Disable conflicting groups */
+ for (n = 0; n < sc->sc_conf->ngroups; n++) {
+ group = &sc->sc_conf->groups[n];
+ for (bank = 0; bank < group->nbank; bank++) {
+ if (group->bank[bank] == pin_def->id)
+ meson_pinctrl_set_group(sc, group, false);
+ }
+ }
+
mutex_enter(&sc->sc_lock);
meson_pinctrl_pin_dir(sc, pin_def, flags);
mutex_exit(&sc->sc_lock);
Home |
Main Index |
Thread Index |
Old Index