From 0d201b55bb08b4c4d2994b5df7ad5c54ef7e976a Mon Sep 17 00:00:00 2001 From: Mukesh Kumar Savaliya Date: Tue, 16 Mar 2021 16:35:11 +0530 Subject: [PATCH] spi: spi-msm-geni: Don't touch GPIOs per each xfer for LA VM This change is to fix the GPIOs being configured to sleep state after every transfer on LA side for TVM usecase. SPI framework calls unprepare_transfer_hardware for every message transferred, driver tries to keep PINs to sleep state and hence it goes to GPIO mode making LE transfer to fail. For TVM usecases, it's expected that Client controls the SOC infra resources including PINs, hence GPIOs must be configured to sleep state when client ends the session. With this change, we are keeping GPIOs in LA configured active state for the LE VM session. Change-Id: I58c7a0b919750cf47b382eebc08f3de097cbfeef Signed-off-by: Mukesh Kumar Savaliya --- drivers/spi/spi-msm-geni.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/spi/spi-msm-geni.c b/drivers/spi/spi-msm-geni.c index ecccac3c5738..7a5a7e31b1d5 100644 --- a/drivers/spi/spi-msm-geni.c +++ b/drivers/spi/spi-msm-geni.c @@ -166,6 +166,7 @@ struct spi_geni_master { bool shared_ee; /* Dual EE use case */ bool shared_se; /* True Multi EE use case */ bool is_le_vm; /* LE VM usecase */ + bool is_la_vm; /* LA VM property */ bool dis_autosuspend; bool cmd_done; bool set_miso_sampling; @@ -1358,6 +1359,10 @@ static int spi_geni_unprepare_transfer_hardware(struct spi_master *spi) if (mas->shared_ee || mas->is_le_vm) return 0; + if (mas->is_la_vm) + /* Client on LA VM to controls resources, hence return */ + return 0; + if (mas->gsi_mode) { struct se_geni_rsc *rsc; int ret = 0; @@ -1929,6 +1934,11 @@ static int spi_geni_probe(struct platform_device *pdev) dev_info(&pdev->dev, "LE-VM usecase\n"); } + if (of_property_read_bool(pdev->dev.of_node, "qcom,la-vm")) { + geni_mas->is_la_vm = true; + dev_info(&pdev->dev, "LA-VM usecase\n"); + } + /* * For LE, clocks, gpio and icb voting will be provided by * by LA. The SPI operates in GSI mode only for LE usecase,