Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Dec 2017 21:40:52 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326595 - head/sys/arm/allwinner
Message-ID:  <201712052140.vB5LeqJ0025168@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Tue Dec  5 21:40:52 2017
New Revision: 326595
URL: https://svnweb.freebsd.org/changeset/base/326595

Log:
  a10_gpio: Don't do read/set dance if pin is already configured for output
  
  This fixes some regulator issues with a83t/BananaPi-M3; the pin value was
  getting clobbered as we reconfigured the pin when initializing the
  regulator.
  
  Discussed with:	ian

Modified:
  head/sys/arm/allwinner/a10_gpio.c

Modified: head/sys/arm/allwinner/a10_gpio.c
==============================================================================
--- head/sys/arm/allwinner/a10_gpio.c	Tue Dec  5 21:38:24 2017	(r326594)
+++ head/sys/arm/allwinner/a10_gpio.c	Tue Dec  5 21:40:52 2017	(r326595)
@@ -353,7 +353,8 @@ a10_gpio_pin_configure(struct a10_gpio_softc *sc, uint
 	/* Manage input/output. */
 	if (flags & GPIO_PIN_INPUT) {
 		err = a10_gpio_set_function(sc, pin, A10_GPIO_INPUT);
-	} else if (flags & GPIO_PIN_OUTPUT) {
+	} else if ((flags & GPIO_PIN_OUTPUT) &&
+	    a10_gpio_get_function(sc, pin) != A10_GPIO_OUTPUT) {
 		if (flags & GPIO_PIN_PRESET_LOW) {
 			a10_gpio_pin_set_locked(sc, pin, 0);
 		} else if (flags & GPIO_PIN_PRESET_HIGH) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712052140.vB5LeqJ0025168>