diff options
author | Felix Fietkau <nbd@nbd.name> | 2018-04-09 09:55:48 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-04-27 15:19:19 +0200 |
commit | 771f1ca3ffe10871893751ab384de3b7a9b06610 (patch) | |
tree | b9b095a1fa53905ed11ac67578d903097ab2ae21 /target/linux/brcm63xx/patches-4.4/000-4.9-01-spi-introduce-max_message_size-hook-in-spi_master.patch | |
parent | 1de74df8b9bbaafd147a2380fa306140b79b60d9 (diff) | |
download | upstream-771f1ca3ffe10871893751ab384de3b7a9b06610.tar.gz upstream-771f1ca3ffe10871893751ab384de3b7a9b06610.tar.bz2 upstream-771f1ca3ffe10871893751ab384de3b7a9b06610.zip |
brcm63xx: remove linux 4.4 support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/brcm63xx/patches-4.4/000-4.9-01-spi-introduce-max_message_size-hook-in-spi_master.patch')
-rw-r--r-- | target/linux/brcm63xx/patches-4.4/000-4.9-01-spi-introduce-max_message_size-hook-in-spi_master.patch | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.9-01-spi-introduce-max_message_size-hook-in-spi_master.patch b/target/linux/brcm63xx/patches-4.4/000-4.9-01-spi-introduce-max_message_size-hook-in-spi_master.patch deleted file mode 100644 index 76a66a3bb7..0000000000 --- a/target/linux/brcm63xx/patches-4.4/000-4.9-01-spi-introduce-max_message_size-hook-in-spi_master.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 5090cc6ae2f79ee779e5faf7c8a28edf42b7d738 Mon Sep 17 00:00:00 2001 -From: Heiner Kallweit <hkallweit1@gmail.com> -Date: Wed, 17 Aug 2016 21:08:01 +0200 -Subject: [PATCH] spi: introduce max_message_size hook in spi_master - -Recently a maximum transfer size was was introduced in struct spi_master. -However there are also spi controllers with a maximum message size, e.g. -fsl-espi has a max message size of 64KB. -Introduce a hook max_message_size to deal with such limitations. - -Also make sure that spi_max_transfer_size doesn't return greater values -than spi_max_message_size, even if hook max_transfer_size is not set. - -Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> -Signed-off-by: Mark Brown <broonie@kernel.org> ---- - include/linux/spi/spi.h | 25 +++++++++++++++++++++---- - 1 file changed, 21 insertions(+), 4 deletions(-) - ---- a/include/linux/spi/spi.h -+++ b/include/linux/spi/spi.h -@@ -304,6 +304,8 @@ static inline void spi_unregister_driver - * @min_speed_hz: Lowest supported transfer speed - * @max_speed_hz: Highest supported transfer speed - * @flags: other constraints relevant to this driver -+ * @max_message_size: function that returns the max message size for -+ * a &spi_device; may be %NULL, so the default %SIZE_MAX will be used. - * @bus_lock_spinlock: spinlock for SPI bus locking - * @bus_lock_mutex: mutex for SPI bus locking - * @bus_lock_flag: indicates that the SPI bus is locked for exclusive use -@@ -429,10 +431,11 @@ struct spi_master { - #define SPI_MASTER_MUST_TX BIT(4) /* requires tx */ - - /* -- * on some hardware transfer size may be constrained -+ * on some hardware transfer / message size may be constrained - * the limit may depend on device transfer settings - */ - size_t (*max_transfer_size)(struct spi_device *spi); -+ size_t (*max_message_size)(struct spi_device *spi); - - /* lock and mutex for SPI bus locking */ - spinlock_t bus_lock_spinlock; -@@ -844,12 +847,26 @@ extern int spi_async_locked(struct spi_d - struct spi_message *message); - - static inline size_t --spi_max_transfer_size(struct spi_device *spi) -+spi_max_message_size(struct spi_device *spi) - { - struct spi_master *master = spi->master; -- if (!master->max_transfer_size) -+ if (!master->max_message_size) - return SIZE_MAX; -- return master->max_transfer_size(spi); -+ return master->max_message_size(spi); -+} -+ -+static inline size_t -+spi_max_transfer_size(struct spi_device *spi) -+{ -+ struct spi_master *master = spi->master; -+ size_t tr_max = SIZE_MAX; -+ size_t msg_max = spi_max_message_size(spi); -+ -+ if (master->max_transfer_size) -+ tr_max = master->max_transfer_size(spi); -+ -+ /* transfer size limit must not be greater than messsage size limit */ -+ return min(tr_max, msg_max); - } - - /*---------------------------------------------------------------------------*/ |