From 954d437d266207e6cb6c5d5706891ddde3671b6e Mon Sep 17 00:00:00 2001 From: Mayuresh Chitale Date: Thu, 16 Nov 2023 22:13:35 +0530 Subject: [PATCH] drivers: xilinx_spi: Add xfer callback Add the xfer callback which is used by the MMC_SPI driver and generally by the dm_spi_xfer callback. Signed-off-by: Mayuresh Chitale Tested-by: Love Kumar Link: https://lore.kernel.org/r/20231116164336.140171-3-mchitale@ventanamicro.com Signed-off-by: Michal Simek --- drivers/spi/xilinx_spi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index d9faceec18..b63cda2091 100644 --- a/drivers/spi/xilinx_spi.c +++ b/drivers/spi/xilinx_spi.c @@ -278,6 +278,18 @@ static void xilinx_spi_startup_block(struct udevice *dev) spi_cs_deactivate(dev); } +static int xilinx_spi_xfer(struct udevice *dev, unsigned int bitlen, + const void *dout, void *din, unsigned long flags) +{ + struct dm_spi_slave_plat *slave_plat = dev_get_parent_plat(dev); + int ret; + + spi_cs_activate(dev, slave_plat->cs); + ret = start_transfer(dev, dout, din, bitlen / 8); + spi_cs_deactivate(dev); + return ret; +} + static int xilinx_spi_mem_exec_op(struct spi_slave *spi, const struct spi_mem_op *op) { @@ -427,6 +439,7 @@ static const struct spi_controller_mem_ops xilinx_spi_mem_ops = { static const struct dm_spi_ops xilinx_spi_ops = { .claim_bus = xilinx_spi_claim_bus, .release_bus = xilinx_spi_release_bus, + .xfer = xilinx_spi_xfer, .set_speed = xilinx_spi_set_speed, .set_mode = xilinx_spi_set_mode, .mem_ops = &xilinx_spi_mem_ops, -- 2.39.5