From patchwork Thu Dec 9 20:34:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 396042 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB9KZO6L015930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 9 Dec 2010 20:35:46 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PQnD1-0003ga-Mm; Thu, 09 Dec 2010 20:35:23 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PQnD1-0003gV-4x for spi-devel-general@lists.sourceforge.net; Thu, 09 Dec 2010 20:35:23 +0000 X-ACL-Warn: Received: from na3sys009aog103.obsmtp.com ([74.125.149.71]) by sog-mx-1.v43.ch3.sourceforge.com with smtp (Exim 4.69) id 1PQnCy-0002JL-PZ for spi-devel-general@lists.sourceforge.net; Thu, 09 Dec 2010 20:35:23 +0000 Received: from source ([74.125.83.42]) by na3sys009aob103.postini.com ([74.125.148.12]) with SMTP ID DSNKTQE9eQ51AvoPvj7jog3LtScVE+wZNZxc@postini.com; Thu, 09 Dec 2010 12:35:20 PST Received: by mail-gw0-f42.google.com with SMTP id 20so2421632gwb.1 for ; Thu, 09 Dec 2010 12:35:05 -0800 (PST) Received: by 10.151.105.16 with SMTP id h16mr75308ybm.75.1291926904932; Thu, 09 Dec 2010 12:35:04 -0800 (PST) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id p30sm935055ybk.20.2010.12.09.12.35.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Dec 2010 12:35:04 -0800 (PST) From: Ben Gardiner To: spi-devel-general@lists.sourceforge.net, Grant Likely , David Brownell Subject: [RFC][PATCH v2 3/3] spi-gpio: use _cansleep when CONFIG_SLOWER_SPI_GPIO is defined Date: Thu, 9 Dec 2010 15:34:56 -0500 Message-Id: <986eb10f4a662940f631235efa4b679acdcdab80.1291925752.git.bengardiner@nanometrics.ca> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: <1290205185-11956-1-git-send-email-bengardiner@nanometrics.ca> X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. X-Headers-End: 1PQnCy-0002JL-PZ Cc: linux-kernel@vger.kernel.org, Michael Buesch X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 09 Dec 2010 20:35:46 +0000 (UTC) diff --git a/drivers/spi/spi_gpio.c b/drivers/spi/spi_gpio.c index b31fddd..537ce13 100644 --- a/drivers/spi/spi_gpio.c +++ b/drivers/spi/spi_gpio.c @@ -78,6 +78,12 @@ struct spi_gpio { #define GENERIC_BITBANG /* vs tight inlines */ +#if defined(CONFIG_SLOWER_SPI_GPIO) +#define spi_gpio_gpio_set_value gpio_set_value_cansleep +#else +#define spi_gpio_gpio_set_value gpio_set_value +#endif + /* all functions referencing these symbols must define pdata */ #define SPI_MISO_GPIO ((pdata)->miso) #define SPI_MOSI_GPIO ((pdata)->mosi) @@ -105,12 +111,12 @@ spi_to_pdata(const struct spi_device *spi) static inline void setsck(const struct spi_device *spi, int is_on) { - gpio_set_value(SPI_SCK_GPIO, is_on); + spi_gpio_gpio_set_value(SPI_SCK_GPIO, is_on); } static inline void setmosi(const struct spi_device *spi, int is_on) { - gpio_set_value(SPI_MOSI_GPIO, is_on); + spi_gpio_gpio_set_value(SPI_MOSI_GPIO, is_on); } static inline int getmiso(const struct spi_device *spi) @@ -222,7 +228,8 @@ static void spi_gpio_chipselect(struct spi_device *spi, int is_active) if (cs != SPI_GPIO_NO_CHIPSELECT) { /* SPI is normally active-low */ - gpio_set_value(cs, (spi->mode & SPI_CS_HIGH) ? is_active : !is_active); + spi_gpio_gpio_set_value(cs, (spi->mode & SPI_CS_HIGH) ? + is_active : !is_active); } }