summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-07-18 15:24:54 +0300
committerMark Brown <broonie@kernel.org>2018-07-18 15:24:54 +0300
commitb86d77123c6e1ecc102aa49c2378999737092891 (patch)
tree974a88da29c12bcd31dccbfcd6ea91d83a2b1e73 /drivers/spi
parent5f8f80356eccfaae1db8a827626ae4fc2eb62831 (diff)
parent62dbbae483b6452e688b8e26c4d024d484117697 (diff)
downloadlinux-b86d77123c6e1ecc102aa49c2378999737092891.tar.xz
Merge tag 'spi-dw-set-cs' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-4.19
spi: dw: Allow custom set_cs_callback Allow platform specific drivers to provide their own set_cs callback when the IP integration requires it.
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-dw.c3
-rw-r--r--drivers/spi/spi-dw.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index f693bfe95ab9..0d8ccb8be5ec 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -505,6 +505,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
master->dev.of_node = dev->of_node;
master->flags = SPI_MASTER_GPIO_SS;
+ if (dws->set_cs)
+ master->set_cs = dws->set_cs;
+
/* Basic HW init */
spi_hw_init(dev, dws);
diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
index 2cde2473b3e9..446013022849 100644
--- a/drivers/spi/spi-dw.h
+++ b/drivers/spi/spi-dw.h
@@ -112,6 +112,7 @@ struct dw_spi {
u32 reg_io_width; /* DR I/O width in bytes */
u16 bus_num;
u16 num_cs; /* supported slave numbers */
+ void (*set_cs)(struct spi_device *spi, bool enable);
/* Current message transfer state info */
size_t len;