X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=target%2Flinux%2Fgeneric-2.6%2Fpatches-2.6.30%2F920-04-spi-gpio-implement-spi-delay.patch;fp=target%2Flinux%2Fgeneric-2.6%2Fpatches-2.6.30%2F920-04-spi-gpio-implement-spi-delay.patch;h=0000000000000000000000000000000000000000;hp=19032881b81e2215320ac36f7288c36c94af9c29;hb=da1bb88a2b900f0392b731ec47c5e1bff956fd8f;hpb=6117c04c9416b295347fb45c37e430f01df1d0d9 diff --git a/target/linux/generic-2.6/patches-2.6.30/920-04-spi-gpio-implement-spi-delay.patch b/target/linux/generic-2.6/patches-2.6.30/920-04-spi-gpio-implement-spi-delay.patch deleted file mode 100644 index 19032881b8..0000000000 --- a/target/linux/generic-2.6/patches-2.6.30/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 - #include - #include -+#include - - #include - #include -@@ -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 */ -+} - - #define EXPAND_BITBANG_TXRX - #include