[PATCH 04/10] spi: espi_amd: Add eSPI inband-reset IOCTL command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds support for a channel-independent IOCTL command to
dynamically reset the configuration settings of the eSPI controller.

Co-developed-by: Krishnamoorthi M <krishnamoorthi.m@xxxxxxx>
Signed-off-by: Krishnamoorthi M <krishnamoorthi.m@xxxxxxx>
Co-developed-by: Akshata MukundShetty <akshata.mukundshetty@xxxxxxx>
Signed-off-by: Akshata MukundShetty <akshata.mukundshetty@xxxxxxx>
Signed-off-by: Raju Rangoju <Raju.Rangoju@xxxxxxx>
---
 drivers/spi/espi-amd-dev.c | 5 +++++
 drivers/spi/espi-amd.h     | 1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/spi/espi-amd-dev.c b/drivers/spi/espi-amd-dev.c
index 79224f4f86fa..ba2becdec8e6 100644
--- a/drivers/spi/espi-amd-dev.c
+++ b/drivers/spi/espi-amd-dev.c
@@ -182,6 +182,11 @@ static long amd_espi_ioctl(struct file *filp, unsigned int cmd, unsigned long ar
 	case ESPI_GET_CONFIG:
 		ret = amd_espi_ioctl_get_conf(amd_espi, arg);
 		break;
+	case ESPI_INBAND_RESET:
+		ret = amd_espi_inband_reset(amd_espi);
+		if (ret != CB_SUCCESS)
+			dev_err(amd_espi->dev, "In-band reset failed!\n");
+		break;
 	default:
 		dev_err(amd_espi->dev, "ESPI command not found, returning error\n");
 		ret = -EINVAL;
diff --git a/drivers/spi/espi-amd.h b/drivers/spi/espi-amd.h
index bc15f7417c37..3c6e9b92c08d 100644
--- a/drivers/spi/espi-amd.h
+++ b/drivers/spi/espi-amd.h
@@ -142,6 +142,7 @@
 #define ESPI_MAGIC_NUMBER            'i'
 #define ESPI_SET_CONFIG              _IOW(ESPI_MAGIC_NUMBER, 0x1, struct config)
 #define ESPI_GET_CONFIG              _IOR(ESPI_MAGIC_NUMBER, 0x2, struct config)
+#define ESPI_INBAND_RESET            _IO(ESPI_MAGIC_NUMBER, 0x3)
 
 /*
  * enum amd_espi_versions - eSPI controller versions
-- 
2.34.1





[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux