Call spi_mem_default_supports_op() in supports_op to honor the
slave's supported single/dual/quad mode settings.

Signed-off-by: SkyLake.Huang <[email protected]>
Signed-off-by: Weijie Gao <[email protected]>
---
 drivers/spi/mtk_spim.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/spi/mtk_spim.c b/drivers/spi/mtk_spim.c
index cd9b9d305ef..2b2c31b4b3f 100644
--- a/drivers/spi/mtk_spim.c
+++ b/drivers/spi/mtk_spim.c
@@ -359,6 +359,9 @@ static bool mtk_spim_supports_op(struct spi_slave *slave,
        struct udevice *bus = dev_get_parent(slave->dev);
        struct mtk_spim_priv *priv = dev_get_priv(bus);
 
+       if (!spi_mem_default_supports_op(slave, op))
+               return false;
+
        if (op->cmd.buswidth == 0 || op->cmd.buswidth > 4 ||
            op->addr.buswidth > 4 || op->dummy.buswidth > 4 ||
            op->data.buswidth > 4)
-- 
2.34.1

Reply via email to