spi: spi_amd: Add support for SPI MEM framework
authorRaju Rangoju <Raju.Rangoju@amd.com>
Thu, 29 Feb 2024 13:45:44 +0000 (19:15 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 25 Mar 2024 20:30:06 +0000 (20:30 +0000)
commit6defadbe6cbc3a87dc39c119a6748d19bfba0544
tree860643c24af7502ba1ffb7486b223c551cbca37b
parentbdeef5dcea6b164f4bd614655821b1ef12ebec9a
spi: spi_amd: Add support for SPI MEM framework

Add support to the SPI controller driver to use SPI MEM framework.
SPI subsystem utilizing the SPI memory operations allows to re-use
SPI controller drivers for both SPI NOR devices, regular SPI devices
as well as SPI NAND devices.

Add below functions of spi_mem_ops to support SPI MEM framework
- exec-op(): to execute the memory operations.
- supports_op(): to check if the memory operation is supported.
- adjust_op_size(): to split data transfers so that they don’t exceed the
  max transfer size supported by the controller.

Suggested-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
Co-developed-by: Krishnamoorthi M <krishnamoorthi.m@amd.com>
Signed-off-by: Krishnamoorthi M <krishnamoorthi.m@amd.com>
Co-developed-by: Akshata MukundShetty <akshata.mukundshetty@amd.com>
Signed-off-by: Akshata MukundShetty <akshata.mukundshetty@amd.com>
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
Link: https://msgid.link/r/20240229134544.3461757-1-Raju.Rangoju@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-amd.c