Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 May 2014 12:58:18 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265814 - head/sys/mips/atheros
Message-ID:  <201405101258.s4ACwI9O008724@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Sat May 10 12:58:18 2014
New Revision: 265814
URL: http://svnweb.freebsd.org/changeset/base/265814

Log:
  Remove an old mistake of mine.  This has sneak in the code i sent to gonzo
  at that time, but AFAIK it is only used on routerboards.
  
  Enabling GPIO_FUNC_SPI_CS[1|2]_EN will claim the use of gpio pins 0 and 1
  respectivelly for use as SPI CS pins.
  
  When really needed, this can still be enabled on kernel hints using the
  function_set and function_clear knobs.

Modified:
  head/sys/mips/atheros/ar71xx_gpio.c

Modified: head/sys/mips/atheros/ar71xx_gpio.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_gpio.c	Sat May 10 12:19:02 2014	(r265813)
+++ head/sys/mips/atheros/ar71xx_gpio.c	Sat May 10 12:58:18 2014	(r265814)
@@ -352,7 +352,6 @@ ar71xx_gpio_attach(device_t dev)
 	int error = 0;
 	int i, j, maxpin;
 	int mask, pinon;
-	int old = 0;
 
 	KASSERT((device_get_unit(dev) == 0),
 	    ("ar71xx_gpio: Only one gpio module supported"));
@@ -391,19 +390,12 @@ ar71xx_gpio_attach(device_t dev)
 	    "function_set", &mask) == 0) {
 		device_printf(dev, "function_set: 0x%x\n", mask);
 		ar71xx_gpio_function_enable(sc, mask);
-		old = 1;
 	}
 	/* Disable function bits that are required */
 	if (resource_int_value(device_get_name(dev), device_get_unit(dev),
 	    "function_clear", &mask) == 0) {
 		device_printf(dev, "function_clear: 0x%x\n", mask);
 		ar71xx_gpio_function_disable(sc, mask);
-		old = 1;
-	}
-	/* Handle previous behaviour */
-	if (old == 0) {
-		ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS1_EN);
-		ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS2_EN);
 	}
 
 	/* Configure all pins as input */
@@ -457,8 +449,6 @@ ar71xx_gpio_detach(device_t dev)
 
 	KASSERT(mtx_initialized(&sc->gpio_mtx), ("gpio mutex not initialized"));
 
-	ar71xx_gpio_function_disable(sc, GPIO_FUNC_SPI_CS1_EN);
-	ar71xx_gpio_function_disable(sc, GPIO_FUNC_SPI_CS2_EN);
 	bus_generic_detach(dev);
 
 	if (sc->gpio_mem_res)



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