From owner-svn-src-head@freebsd.org Wed Aug 17 13:09:32 2016 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 5F3CFBBD762; Wed, 17 Aug 2016 13:09:32 +0000 (UTC) (envelope-from manu@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 3222B1ECA; Wed, 17 Aug 2016 13:09:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HD9VF6036483; Wed, 17 Aug 2016 13:09:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HD9VCh036482; Wed, 17 Aug 2016 13:09:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608171309.u7HD9VCh036482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 13:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304290 - head/sys/arm/allwinner X-SVN-Group: head 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.22 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: Wed, 17 Aug 2016 13:09:32 -0000 Author: manu Date: Wed Aug 17 13:09:31 2016 New Revision: 304290 URL: https://svnweb.freebsd.org/changeset/base/304290 Log: Only set pud settings if this is a pullup or pulldown configuration. This removes the need to set the MMC pins with pullups in our DTS. Thanks to jmcneill@ for spotting this. Tested on Orange Pi One (Allwinner H3). MFC after: 1 week Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:36 2016 (r304289) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 13:09:31 2016 (r304290) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #if defined(__aarch64__) #include "opt_soc.h" #endif @@ -599,7 +601,9 @@ aw_fdt_configure_pins(device_t dev, phan a10_gpio_set_function(sc, pin_num, pin_func); if (a10_gpio_get_drv(sc, pin_num) != pin_drive) a10_gpio_set_drv(sc, pin_num, pin_drive); - if (a10_gpio_get_pud(sc, pin_num) != pin_pull) + if (a10_gpio_get_pud(sc, pin_num) != pin_pull && + (pin_pull == SUN4I_PINCTRL_PULL_UP || + pin_pull == SUN4I_PINCTRL_PULL_DOWN)) a10_gpio_set_pud(sc, pin_num, pin_pull); A10_GPIO_UNLOCK(sc); }