1 From df07ed6a52d9f6027ff1753c00b3128fa18dde31 Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Mon, 11 Jan 2010 04:29:48 +0100
4 Subject: [PATCH] /opt/Projects/openwrt/target/linux/xburst/patches-2.6.31/400-spi-gpio-3wire.patch
7 drivers/spi/spi_gpio.c | 14 +++++++++-----
8 1 files changed, 9 insertions(+), 5 deletions(-)
10 diff --git a/drivers/spi/spi_gpio.c b/drivers/spi/spi_gpio.c
11 index 26bd03e..5f89c21 100644
12 --- a/drivers/spi/spi_gpio.c
13 +++ b/drivers/spi/spi_gpio.c
14 @@ -243,9 +243,11 @@ spi_gpio_request(struct spi_gpio_platform_data *pdata, const char *label)
18 - value = spi_gpio_alloc(SPI_MISO_GPIO, label, true);
21 + if (SPI_MISO_GPIO != SPI_MOSI_GPIO) {
22 + value = spi_gpio_alloc(SPI_MISO_GPIO, label, true);
27 value = spi_gpio_alloc(SPI_SCK_GPIO, label, false);
29 @@ -308,7 +310,8 @@ static int __init spi_gpio_probe(struct platform_device *pdev)
31 spi_master_put(spi_gpio->bitbang.master);
33 - gpio_free(SPI_MISO_GPIO);
34 + if (SPI_MISO_GPIO != SPI_MOSI_GPIO)
35 + gpio_free(SPI_MISO_GPIO);
36 gpio_free(SPI_MOSI_GPIO);
37 gpio_free(SPI_SCK_GPIO);
38 spi_master_put(master);
39 @@ -332,7 +335,8 @@ static int __exit spi_gpio_remove(struct platform_device *pdev)
41 platform_set_drvdata(pdev, NULL);
43 - gpio_free(SPI_MISO_GPIO);
44 + if (SPI_MISO_GPIO != SPI_MOSI_GPIO)
45 + gpio_free(SPI_MISO_GPIO);
46 gpio_free(SPI_MOSI_GPIO);
47 gpio_free(SPI_SCK_GPIO);