diff options
author | Talel Shenhar <talel@amazon.com> | 2018-10-11 14:20:07 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-10-11 15:11:04 +0100 |
commit | f2d704794864a4bb486f2a0eaed40f25dd87303f (patch) | |
tree | 9b0b39d17cd6cec53a7e3196b025a2668cf1abe7 /drivers/spi/spi-dw.c | |
parent | d49a30366793210cd64759edcdf7099a2e32efd6 (diff) | |
download | linux-stable-f2d704794864a4bb486f2a0eaed40f25dd87303f.tar.gz linux-stable-f2d704794864a4bb486f2a0eaed40f25dd87303f.tar.bz2 linux-stable-f2d704794864a4bb486f2a0eaed40f25dd87303f.zip |
dw: spi: add support for Amazon's Alpine spi controller
Add support for a new devicetree compatible string called
'amazon,alpine-apb-ssi', which is necessary for the Amazon Alpine spi
controller. 'amazon,alpine-dw-apb-ssi' is used in the dw spi driver if
specified in the devicetree. Otherwise, fall back to driver default
behavior, i.e. original dw IP hw driver behavior.
Signed-off-by: Talel Shenhar <talel@amazon.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-dw.c')
-rw-r--r-- | drivers/spi/spi-dw.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 3e205ab60cd4..b705f2bdb8b9 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -144,6 +144,8 @@ void dw_spi_set_cs(struct spi_device *spi, bool enable) if (!enable) dw_writel(dws, DW_SPI_SER, BIT(spi->chip_select)); + else if (dws->cs_override) + dw_writel(dws, DW_SPI_SER, 0); } EXPORT_SYMBOL_GPL(dw_spi_set_cs); @@ -463,6 +465,10 @@ static void spi_hw_init(struct device *dev, struct dw_spi *dws) dws->fifo_len = (fifo == 1) ? 0 : fifo; dev_dbg(dev, "Detected FIFO size: %u bytes\n", dws->fifo_len); } + + /* enable HW fixup for explicit CS deselect for Amazon's alpine chip */ + if (dws->cs_override) + dw_writel(dws, DW_SPI_CS_OVERRIDE, 0xF); } int dw_spi_add_host(struct device *dev, struct dw_spi *dws) |