Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2016 13:09:31 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304290 - head/sys/arm/allwinner
Message-ID:  <201608171309.u7HD9VCh036482@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <dev/extres/clk/clk.h>
 #include <dev/extres/hwreset/hwreset.h>
 
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
 #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);
 	}



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