From owner-svn-src-head@freebsd.org Tue Dec 5 21:40:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7447AE83980; Tue, 5 Dec 2017 21:40:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41918735C1; Tue, 5 Dec 2017 21:40:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB5LeqX2025169; Tue, 5 Dec 2017 21:40:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB5LeqJ0025168; Tue, 5 Dec 2017 21:40:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712052140.vB5LeqJ0025168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 5 Dec 2017 21:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326595 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 326595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2017 21:40:53 -0000 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) {