summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Packham <chris.packham@alliedtelesis.co.nz>2019-11-07 05:42:35 +0100
committerMark Brown <broonie@kernel.org>2019-11-07 14:11:18 +0100
commit05766050d5bd9af24dcaec6b29255a6f2b324543 (patch)
tree4a13becaf069e37f8241de308126980d5a1c7068
parentspi: bcm-qspi: Convert to use CS GPIO descriptors (diff)
downloadlinux-05766050d5bd9af24dcaec6b29255a6f2b324543.tar.xz
linux-05766050d5bd9af24dcaec6b29255a6f2b324543.zip
spi: spi-mem: fallback to using transfers when CS gpios are used
Devices with chip selects driven via GPIO are not compatible with the spi-mem operations. Fallback to using standard spi transfers when the device is connected with a gpio CS. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20191107044235.4864-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 9f0fa9f3116d..e5a46f0eb93b 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -286,7 +286,7 @@ int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
if (!spi_mem_internal_supports_op(mem, op))
return -ENOTSUPP;
- if (ctlr->mem_ops) {
+ if (ctlr->mem_ops && !mem->spi->cs_gpiod) {
ret = spi_mem_access_start(mem);
if (ret)
return ret;