summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-07-27 15:53:54 -0400
committerMark Brown <broonie@kernel.org>2018-07-30 07:02:07 -0400
commitc79bdbb490a1d05c6169cbffd37c19f5aa96587a (patch)
tree91dede400599d84cdee53ac054eb2f1b25ef2a8a
parent516ddd79068dc02b9101bf9551a9ef7dce217b5b (diff)
spi: dw: export dw_spi_set_cs
Export dw_spi_set_cs so it can be used from the various IP integration modules. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-dw.c3
-rw-r--r--drivers/spi/spi-dw.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 0d8ccb8be5ec..683a4f137a25 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -133,7 +133,7 @@ static inline void dw_spi_debugfs_remove(struct dw_spi *dws)
133} 133}
134#endif /* CONFIG_DEBUG_FS */ 134#endif /* CONFIG_DEBUG_FS */
135 135
136static void dw_spi_set_cs(struct spi_device *spi, bool enable) 136void dw_spi_set_cs(struct spi_device *spi, bool enable)
137{ 137{
138 struct dw_spi *dws = spi_controller_get_devdata(spi->controller); 138 struct dw_spi *dws = spi_controller_get_devdata(spi->controller);
139 struct chip_data *chip = spi_get_ctldata(spi); 139 struct chip_data *chip = spi_get_ctldata(spi);
@@ -145,6 +145,7 @@ static void dw_spi_set_cs(struct spi_device *spi, bool enable)
145 if (!enable) 145 if (!enable)
146 dw_writel(dws, DW_SPI_SER, BIT(spi->chip_select)); 146 dw_writel(dws, DW_SPI_SER, BIT(spi->chip_select));
147} 147}
148EXPORT_SYMBOL_GPL(dw_spi_set_cs);
148 149
149/* Return the max entries we can fill into tx fifo */ 150/* Return the max entries we can fill into tx fifo */
150static inline u32 tx_max(struct dw_spi *dws) 151static inline u32 tx_max(struct dw_spi *dws)
diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
index 446013022849..0168b08364d5 100644
--- a/drivers/spi/spi-dw.h
+++ b/drivers/spi/spi-dw.h
@@ -245,6 +245,7 @@ struct dw_spi_chip {
245 void (*cs_control)(u32 command); 245 void (*cs_control)(u32 command);
246}; 246};
247 247
248extern void dw_spi_set_cs(struct spi_device *spi, bool enable);
248extern int dw_spi_add_host(struct device *dev, struct dw_spi *dws); 249extern int dw_spi_add_host(struct device *dev, struct dw_spi *dws);
249extern void dw_spi_remove_host(struct dw_spi *dws); 250extern void dw_spi_remove_host(struct dw_spi *dws);
250extern int dw_spi_suspend_host(struct dw_spi *dws); 251extern int dw_spi_suspend_host(struct dw_spi *dws);