Adding the config option SPI_ADVANCE for non SPL code.

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

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.
-- 
2.17.1

Reply via email to