diff mbox series

[v11,7/8] spi: Add the spi advance options for non SPL

Message ID 20240304031046.25998-8-venkatesh.abbarapu@amd.com
State New
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series spi-nor: Add parallel and stacked memories support | expand

Commit Message

Venkatesh Yadav Abbarapu March 4, 2024, 3:10 a.m. UTC
Adding the config option SPI_ADVANCE for non SPL code.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
---
 drivers/spi/Kconfig      | 7 +++++++
 drivers/spi/spi-uclass.c | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 69b184b0d9..e5640bcbe4 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -50,6 +50,13 @@  config SPI_DIRMAP
 	  improvements as it automates the whole process of sending SPI memory
 	  operations every time a new region is accessed.
 
+config SPI_ADVANCE
+	bool "Enable the advance feature"
+	default y
+	help
+	  Enable the SPI advance feature support. By default this is set to y.
+	  If you intend not to use the advance feature support you should say n here.
+
 if DM_SPI
 
 config ALTERA_SPI
diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
index 992394c295..736159aa47 100644
--- a/drivers/spi/spi-uclass.c
+++ b/drivers/spi/spi-uclass.c
@@ -447,11 +447,12 @@  int _spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
 	slave = dev_get_parent_priv(dev);
 	bus_data = dev_get_uclass_priv(bus);
 
+#if CONFIG_IS_ENABLED(SPI_ADVANCE)
 	if ((dev_read_bool(dev, "parallel-memories")) && !slave->multi_cs_cap) {
 		dev_err(dev, "controller doesn't support multi CS\n");
 		return -EINVAL;
 	}
-
+#endif
 	/*
 	 * In case the operation speed is not yet established by
 	 * dm_spi_claim_bus() ensure the bus is configured properly.