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 handle GPIO_ACTIVE_LOW flag
details: https://anonhg.NetBSD.org/src/rev/bfa9a67b95bd
branches: trunk
changeset: 342282:bfa9a67b95bd
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Mon Dec 14 20:57:34 2015 +0000
description:
handle GPIO_ACTIVE_LOW flag
diffstat:
sys/arch/arm/nvidia/tegra_gpio.c | 25 ++++++++++++-------------
1 files changed, 12 insertions(+), 13 deletions(-)
diffs (67 lines):
diff -r a487c8beb829 -r bfa9a67b95bd sys/arch/arm/nvidia/tegra_gpio.c
--- a/sys/arch/arm/nvidia/tegra_gpio.c Mon Dec 14 20:01:17 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra_gpio.c Mon Dec 14 20:57:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_gpio.c,v 1.4 2015/12/13 17:39:19 jmcneill Exp $ */
+/* $NetBSD: tegra_gpio.c,v 1.5 2015/12/14 20:57:34 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.4 2015/12/13 17:39:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.5 2015/12/14 20:57:34 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -326,8 +326,14 @@
tegra_gpio_fdt_read(device_t dev, void *priv)
{
struct tegra_gpio_pin *gpin = priv;
+ int val;
- return tegra_gpio_read(gpin);
+ val = tegra_gpio_read(gpin);
+
+ if (gpin->pin_actlo)
+ val = !val;
+
+ return val;
}
static void
@@ -335,6 +341,9 @@
{
struct tegra_gpio_pin *gpin = priv;
+ if (gpin->pin_actlo)
+ val = !val;
+
tegra_gpio_write(gpin, val);
}
@@ -418,11 +427,6 @@
ret = (v >> gpin->pin_no) & 1;
}
-#if 0
- if (gpin->pin_actlo)
- ret = !ret;
-#endif
-
return ret;
}
@@ -431,10 +435,5 @@
{
KASSERT((gpin->pin_flags & GPIO_PIN_OUTPUT) != 0);
-#if 0
- if (gpin->pin_actlo)
- val = !val;
-#endif
-
tegra_gpio_pin_write(&gpin->pin_bank, gpin->pin_no, val);
}
Home |
Main Index |
Thread Index |
Old Index