aboutsummaryrefslogtreecommitdiff
path: root/include/spi-mem.h
diff options
context:
space:
mode:
authorPratyush Yadav <p.yadav@ti.com>2021-06-26 00:47:06 +0530
committerJagan Teki <jagan@amarulasolutions.com>2021-06-28 11:56:06 +0530
commit5752d6ae8daacbd2678cbf9a96627dd9c83f215c (patch)
treea91f07905ab81cdb786a4450bdf827c12aaf6209 /include/spi-mem.h
parent2299076e34f8cd5682b1fe20bcc0395f2466bcc6 (diff)
downloadu-boot-5752d6ae8daacbd2678cbf9a96627dd9c83f215c.zip
u-boot-5752d6ae8daacbd2678cbf9a96627dd9c83f215c.tar.gz
u-boot-5752d6ae8daacbd2678cbf9a96627dd9c83f215c.tar.bz2
spi: spi-mem: add spi_mem_dtr_supports_op()
spi_mem_default_supports_op() rejects DTR ops by default to ensure that the controller drivers that haven't been updated with DTR support continue to reject them. It also makes sure that controllers that don't support DTR mode at all (which is most of them at the moment) also reject them. This means that controller drivers that want to support DTR mode can't use spi_mem_default_supports_op(). Driver authors have to roll their own supports_op() function and mimic the buswidth checks. Or even worse, driver authors might skip it completely or get it wrong. Add spi_mem_dtr_supports_op(). It provides a basic sanity check for DTR ops and performs the buswidth requirement check. Move the logic for checking buswidth in spi_mem_default_supports_op() to a separate function so the logic is not repeated twice. Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Acked-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'include/spi-mem.h')
-rw-r--r--include/spi-mem.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/spi-mem.h b/include/spi-mem.h
index de3c11c..32ffdc2 100644
--- a/include/spi-mem.h
+++ b/include/spi-mem.h
@@ -249,6 +249,8 @@ spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
int spi_mem_adjust_op_size(struct spi_slave *slave, struct spi_mem_op *op);
bool spi_mem_supports_op(struct spi_slave *slave, const struct spi_mem_op *op);
+bool spi_mem_dtr_supports_op(struct spi_slave *slave,
+ const struct spi_mem_op *op);
bool spi_mem_default_supports_op(struct spi_slave *slave,
const struct spi_mem_op *op);