[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-86-gf14d2fa
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2010-01-05 15:17:51
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via f14d2fa858aab5596833825188397db5f17eed93 (commit)
via 6e4cf40a7ab6f291cfabdf943d63d5af5fb43eb3 (commit)
from 944119a37c8adcdfc0a86a485d9b8ee587dacc2e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f14d2fa858aab5596833825188397db5f17eed93
Author: Fabien Marteau <fab...@ar...>
Date: Tue Jan 5 16:16:32 2010 +0100
[LINUX] Not refreshed patches
commit 6e4cf40a7ab6f291cfabdf943d63d5af5fb43eb3
Author: Fabien Marteau <fab...@ar...>
Date: Tue Jan 5 16:15:49 2010 +0100
[LINUX] Improve spi_gpio for single data pin
-----------------------------------------------------------------------
Summary of changes:
.../2.6.29/348-armadeus-plat-mxc-gpio.patch | 7 -
.../349-armadeus-spi-backport_2.6.32.2.patch | 5 -
...-spi-improve_spi_gpio_for_single_data_pin.patch | 162 ++++++++++++++++++++
3 files changed, 162 insertions(+), 12 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/350-armadeus-spi-improve_spi_gpio_for_single_data_pin.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/348-armadeus-plat-mxc-gpio.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/348-armadeus-plat-mxc-gpio.patch
index 2480c91..f487571 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/348-armadeus-plat-mxc-gpio.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/348-armadeus-plat-mxc-gpio.patch
@@ -1,10 +1,3 @@
-
-Fix mxc_gpio_set() to have the same behavior than others platform *_gpio_set()
-When value=0 set pin to 0, else set pin to 1
-
-Signed-off-by : Fabien Marteau <fab...@ar...>
----
-
Index: linux-2.6.29.6/arch/arm/plat-mxc/gpio.c
===================================================================
--- linux-2.6.29.6.orig/arch/arm/plat-mxc/gpio.c 2010-01-05 15:27:43.000000000 +0100
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/349-armadeus-spi-backport_2.6.32.2.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/349-armadeus-spi-backport_2.6.32.2.patch
index 0d9bf0c..6d03c52 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/349-armadeus-spi-backport_2.6.32.2.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/349-armadeus-spi-backport_2.6.32.2.patch
@@ -1,8 +1,3 @@
-Backport spi driver from 2.6.32.2 to use half duplex capabilities.
-
-Signed-off-by: Fabien Marteau <fab...@ar...>
----
-
Index: linux-2.6.29.6/drivers/spi/spi_bitbang.c
===================================================================
--- linux-2.6.29.6.orig/drivers/spi/spi_bitbang.c 2010-01-05 15:43:18.000000000 +0100
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/350-armadeus-spi-improve_spi_gpio_for_single_data_pin.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/350-armadeus-spi-improve_spi_gpio_for_single_data_pin.patch
new file mode 100644
index 0000000..f0b1623
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/350-armadeus-spi-improve_spi_gpio_for_single_data_pin.patch
@@ -0,0 +1,162 @@
+Index: linux-2.6.29.6/drivers/spi/spi_bitbang.c
+===================================================================
+--- linux-2.6.29.6.orig/drivers/spi/spi_bitbang.c 2010-01-05 16:09:08.000000000 +0100
++++ linux-2.6.29.6/drivers/spi/spi_bitbang.c 2010-01-05 16:09:28.000000000 +0100
+@@ -396,6 +396,22 @@
+ unsigned long flags;
+ int status = 0;
+
++ if (spi->master->flags & SPI_MASTER_NO_RX) {
++ struct spi_transfer *xfer;
++ list_for_each_entry(xfer, &m->transfers, transfer_list) {
++ if (xfer->rx_buf)
++ return -EINVAL;
++ }
++ }
++
++ if (spi->master->flags & SPI_MASTER_NO_TX) {
++ struct spi_transfer *xfer;
++ list_for_each_entry(xfer, &m->transfers, transfer_list) {
++ if (xfer->tx_buf)
++ return -EINVAL;
++ }
++ }
++
+ m->actual_length = 0;
+ m->status = -EINPROGRESS;
+
+Index: linux-2.6.29.6/drivers/spi/spi_gpio.c
+===================================================================
+--- linux-2.6.29.6.orig/drivers/spi/spi_gpio.c 2010-01-05 16:12:12.000000000 +0100
++++ linux-2.6.29.6/drivers/spi/spi_gpio.c 2010-01-05 16:13:51.000000000 +0100
+@@ -109,12 +109,19 @@
+
+ static inline void setmosi(const struct spi_device *spi, int is_on)
+ {
+- gpio_set_value(SPI_MOSI_GPIO, is_on);
++ if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI)
++ {
++ gpio_set_value(SPI_MOSI_GPIO, is_on);
++ }
++
+ }
+
+ static inline int getmiso(const struct spi_device *spi)
+ {
+- return !!gpio_get_value(SPI_MISO_GPIO);
++ if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO)
++ return !!gpio_get_value(SPI_MISO_GPIO);
++ else
++ return 0;
+ }
+
+ #undef pdata
+@@ -233,20 +240,31 @@
+ }
+
+ static int __init
+-spi_gpio_request(struct spi_gpio_platform_data *pdata, const char *label)
++spi_gpio_request(struct spi_gpio_platform_data *pdata, const char *label,
++ u16 *res_flags)
+ {
+ int value;
+
+ /* NOTE: SPI_*_GPIO symbols may reference "pdata" */
++ if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI) {
++ value = spi_gpio_alloc(SPI_MOSI_GPIO, label, false);
++ if (value)
++ goto done;
++ } else {
++ /* HW configuration without MOSI pin */
++ *res_flags |= SPI_MASTER_NO_TX;
++ }
+
+- value = spi_gpio_alloc(SPI_MOSI_GPIO, label, false);
+- if (value)
+- goto done;
+-
+- value = spi_gpio_alloc(SPI_MISO_GPIO, label, true);
+- if (value)
+- goto free_mosi;
++ if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO) {
++ value = spi_gpio_alloc(SPI_MISO_GPIO, label, true);
++ if (value)
++ goto free_mosi;
++ } else {
++ /* HW configuration without MISO pin */
++ *res_flags |= SPI_MASTER_NO_RX;
++ }
+
++ printk("alloc SCK\n");
+ value = spi_gpio_alloc(SPI_SCK_GPIO, label, false);
+ if (value)
+ goto free_miso;
+@@ -254,9 +272,11 @@
+ goto done;
+
+ free_miso:
+- gpio_free(SPI_MISO_GPIO);
++ if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO)
++ gpio_free(SPI_MISO_GPIO);
+ free_mosi:
+- gpio_free(SPI_MOSI_GPIO);
++ if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI)
++ gpio_free(SPI_MOSI_GPIO);
+ done:
+ return value;
+ }
+@@ -267,17 +287,16 @@
+ struct spi_master *master;
+ struct spi_gpio *spi_gpio;
+ struct spi_gpio_platform_data *pdata;
+-
++ u16 master_flags = 0;
++ printk("init spi_gpio_probe\n");
+ pdata = pdev->dev.platform_data;
+ #ifdef GENERIC_BITBANG
+ if (!pdata || !pdata->num_chipselect)
+ return -ENODEV;
+ #endif
+-
+- status = spi_gpio_request(pdata, dev_name(&pdev->dev));
++ status = spi_gpio_request(pdata, dev_name(&pdev->dev),&master_flags);
+ if (status < 0)
+ return status;
+-
+ master = spi_alloc_master(&pdev->dev, sizeof *spi_gpio);
+ if (!master) {
+ status = -ENOMEM;
+@@ -290,6 +309,7 @@
+ if (pdata)
+ spi_gpio->pdata = *pdata;
+
++ master->flags = master_flags;
+ master->bus_num = pdev->id;
+ master->num_chipselect = SPI_N_CHIPSEL;
+ master->setup = spi_gpio_setup;
+@@ -308,8 +328,10 @@
+ if (status < 0) {
+ spi_master_put(spi_gpio->bitbang.master);
+ gpio_free:
+- gpio_free(SPI_MISO_GPIO);
+- gpio_free(SPI_MOSI_GPIO);
++ if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO)
++ gpio_free(SPI_MISO_GPIO);
++ if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI)
++ gpio_free(SPI_MOSI_GPIO);
+ gpio_free(SPI_SCK_GPIO);
+ spi_master_put(master);
+ }
+@@ -332,8 +354,10 @@
+
+ platform_set_drvdata(pdev, NULL);
+
+- gpio_free(SPI_MISO_GPIO);
+- gpio_free(SPI_MOSI_GPIO);
++ if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO)
++ gpio_free(SPI_MISO_GPIO);
++ if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI)
++ gpio_free(SPI_MOSI_GPIO);
+ gpio_free(SPI_SCK_GPIO);
+
+ return status;
hooks/post-receive
--
armadeus
|