aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-2.6.38/920-04-spi-gpio-implement-spi-delay.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-04-16 18:30:57 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-04-16 18:30:57 +0000
commit80a4ffa1e2bc5f3ef893251babb2371c502f04ad (patch)
treee6fb6200183e257b8f8cf45857f359b053bd2a0d /target/linux/generic/patches-2.6.38/920-04-spi-gpio-implement-spi-delay.patch
parenta0559785226c7d84cf34686c0d5be8f4e15fdfe6 (diff)
downloadmaster-187ad058-80a4ffa1e2bc5f3ef893251babb2371c502f04ad.tar.gz
master-187ad058-80a4ffa1e2bc5f3ef893251babb2371c502f04ad.tar.bz2
master-187ad058-80a4ffa1e2bc5f3ef893251babb2371c502f04ad.zip
kernel: reorganize 2.6.38 patches, clean up block2mtd patches
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26690 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/patches-2.6.38/920-04-spi-gpio-implement-spi-delay.patch')
-rw-r--r--target/linux/generic/patches-2.6.38/920-04-spi-gpio-implement-spi-delay.patch58
1 files changed, 0 insertions, 58 deletions
diff --git a/target/linux/generic/patches-2.6.38/920-04-spi-gpio-implement-spi-delay.patch b/target/linux/generic/patches-2.6.38/920-04-spi-gpio-implement-spi-delay.patch
deleted file mode 100644
index 4b145c2734..0000000000
--- a/target/linux/generic/patches-2.6.38/920-04-spi-gpio-implement-spi-delay.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Implement the SPI-GPIO delay function for busses that need speed limitation.
-
---mb
-
-
-
---- a/drivers/spi/spi_gpio.c
-+++ b/drivers/spi/spi_gpio.c
-@@ -21,6 +21,7 @@
- #include <linux/init.h>
- #include <linux/platform_device.h>
- #include <linux/gpio.h>
-+#include <linux/delay.h>
-
- #include <linux/spi/spi.h>
- #include <linux/spi/spi_bitbang.h>
-@@ -69,6 +70,7 @@ struct spi_gpio {
- * #define SPI_MOSI_GPIO 120
- * #define SPI_SCK_GPIO 121
- * #define SPI_N_CHIPSEL 4
-+ * #undef NEED_SPIDELAY
- * #include "spi_gpio.c"
- */
-
-@@ -76,6 +78,7 @@ struct spi_gpio {
- #define DRIVER_NAME "spi_gpio"
-
- #define GENERIC_BITBANG /* vs tight inlines */
-+#define NEED_SPIDELAY 1
-
- /* all functions referencing these symbols must define pdata */
- #define SPI_MISO_GPIO ((pdata)->miso)
-@@ -120,12 +123,20 @@ static inline int getmiso(const struct s
- #undef pdata
-
- /*
-- * NOTE: this clocks "as fast as we can". It "should" be a function of the
-- * requested device clock. Software overhead means we usually have trouble
-- * reaching even one Mbit/sec (except when we can inline bitops), so for now
-- * we'll just assume we never need additional per-bit slowdowns.
-+ * NOTE: to clock "as fast as we can", set spi_device.max_speed_hz
-+ * and spi_transfer.speed_hz to 0.
-+ * Otherwise this is a function of the requested device clock.
-+ * Software overhead means we usually have trouble
-+ * reaching even one Mbit/sec (except when we can inline bitops). So on small
-+ * embedded devices with fast SPI slaves you usually don't need a delay.
- */
--#define spidelay(nsecs) do {} while (0)
-+static inline void spidelay(unsigned nsecs)
-+{
-+#ifdef NEED_SPIDELAY
-+ if (unlikely(nsecs))
-+ ndelay(nsecs);
-+#endif /* NEED_SPIDELAY */
-+}
-
- #include "spi_bitbang_txrx.h"
-