From owner-svn-src-head@FreeBSD.ORG Sat May 10 12:58:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBDBA71B; Sat, 10 May 2014 12:58:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 AEEA8B13; Sat, 10 May 2014 12:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ACwITg008725; Sat, 10 May 2014 12:58:18 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ACwI9O008724; Sat, 10 May 2014 12:58:18 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405101258.s4ACwI9O008724@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 10 May 2014 12:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265814 - head/sys/mips/atheros 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.18 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: Sat, 10 May 2014 12:58:19 -0000 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)