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 tegra_gpio_acquire: if a pin is required...
details: https://anonhg.NetBSD.org/src/rev/8d0ebc93763a
branches: trunk
changeset: 338034:8d0ebc93763a
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat May 09 12:07:11 2015 +0000
description:
tegra_gpio_acquire: if a pin is required and not in GPIO mode, switch configuration instead of bailing out
diffstat:
sys/arch/arm/nvidia/tegra_gpio.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r f5f46e08919b -r 8d0ebc93763a sys/arch/arm/nvidia/tegra_gpio.c
--- a/sys/arch/arm/nvidia/tegra_gpio.c Sat May 09 12:06:31 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra_gpio.c Sat May 09 12:07:11 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_gpio.c,v 1.2 2015/05/02 17:06:53 jmcneill Exp $ */
+/* $NetBSD: tegra_gpio.c,v 1.3 2015/05/09 12:07:11 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
#include "locators.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.2 2015/05/02 17:06:53 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.3 2015/05/09 12:07:11 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -298,7 +298,7 @@
const uint32_t cnf = GPIO_READ(&bank, GPIO_CNF_REG);
if ((cnf & __BIT(pin)) == 0)
- return NULL;
+ GPIO_WRITE(&bank, GPIO_CNF_REG, cnf | __BIT(pin));
gpin = kmem_alloc(sizeof(*gpin), KM_SLEEP);
gpin->pin_bank = bank;
Home |
Main Index |
Thread Index |
Old Index