aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic-2.6/patches-2.6.28/920-02-spi-gpio-without-cs.patch
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2009-12-27 21:28:02 +0000
committerImre Kaloz <kaloz@openwrt.org>2009-12-27 21:28:02 +0000
commit2434746dd4bc0c8c00d5a94e44f05604e2dca304 (patch)
tree180b2c74131eb4d4bd7c855e1de0ca28bda8127c /target/linux/generic-2.6/patches-2.6.28/920-02-spi-gpio-without-cs.patch
parent4060780e57e972944be3a83db84bc37948949698 (diff)
downloadupstream-2434746dd4bc0c8c00d5a94e44f05604e2dca304.tar.gz
upstream-2434746dd4bc0c8c00d5a94e44f05604e2dca304.tar.bz2
upstream-2434746dd4bc0c8c00d5a94e44f05604e2dca304.zip
switch ixp4xx and ubicom32 to 2.6.30, get rid of 2.6.28 files
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18952 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic-2.6/patches-2.6.28/920-02-spi-gpio-without-cs.patch')
-rw-r--r--target/linux/generic-2.6/patches-2.6.28/920-02-spi-gpio-without-cs.patch73
1 files changed, 0 insertions, 73 deletions
diff --git a/target/linux/generic-2.6/patches-2.6.28/920-02-spi-gpio-without-cs.patch b/target/linux/generic-2.6/patches-2.6.28/920-02-spi-gpio-without-cs.patch
deleted file mode 100644
index 8b2198ef14..0000000000
--- a/target/linux/generic-2.6/patches-2.6.28/920-02-spi-gpio-without-cs.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-Optionally omit the CS signal, if there's only one device on the bus.
-
---mb
-
-
-
---- a/drivers/spi/spi_gpio.c
-+++ b/drivers/spi/spi_gpio.c
-@@ -178,8 +178,10 @@ static void spi_gpio_chipselect(struct s
- if (is_active)
- setsck(spi, spi->mode & SPI_CPOL);
-
-- /* SPI is normally active-low */
-- gpio_set_value(cs, (spi->mode & SPI_CS_HIGH) ? is_active : !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);
-+ }
- }
-
- static int spi_gpio_setup(struct spi_device *spi)
-@@ -191,15 +193,17 @@ static int spi_gpio_setup(struct spi_dev
- return -EINVAL;
-
- if (!spi->controller_state) {
-- status = gpio_request(cs, spi->dev.bus_id);
-- if (status)
-- return status;
-- status = gpio_direction_output(cs, spi->mode & SPI_CS_HIGH);
-+ if (cs != SPI_GPIO_NO_CHIPSELECT) {
-+ status = gpio_request(cs, spi->dev.bus_id);
-+ if (status)
-+ return status;
-+ status = gpio_direction_output(cs, spi->mode & SPI_CS_HIGH);
-+ }
- }
- if (!status)
- status = spi_bitbang_setup(spi);
- if (status) {
-- if (!spi->controller_state)
-+ if (!spi->controller_state && cs != SPI_GPIO_NO_CHIPSELECT)
- gpio_free(cs);
- }
- return status;
-@@ -209,7 +213,8 @@ static void spi_gpio_cleanup(struct spi_
- {
- unsigned long cs = (unsigned long) spi->controller_data;
-
-- gpio_free(cs);
-+ if (cs != SPI_GPIO_NO_CHIPSELECT)
-+ gpio_free(cs);
- spi_bitbang_cleanup(spi);
- }
-
---- a/include/linux/spi/spi_gpio.h
-+++ b/include/linux/spi/spi_gpio.h
-@@ -25,10 +25,16 @@
- * ...
- * };
- *
-+ * If chipselect is not used (there's only one device on the bus), assign
-+ * SPI_GPIO_NO_CHIPSELECT to the controller_data:
-+ * .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT;
-+ *
- * If the bitbanged bus is later switched to a "native" controller,
- * that platform_device and controller_data should be removed.
- */
-
-+#define SPI_GPIO_NO_CHIPSELECT ((unsigned long)-1l)
-+
- /**
- * struct spi_gpio_platform_data - parameter for bitbanged SPI master
- * @sck: number of the GPIO used for clock output