Skip to contentSkip to conversation

ishtp: Add support for Intel ishtp eclite driver

PATCH Superseded [email protected] 3 participants 4 messages Sep 1, 2021 – Sep 9, 2021 x86 platform drivers

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ishtp: Add support for Intel ishtp eclite driver

From: "K Naduvalath, Sumesh" <[email protected]>

This driver is for accessing the PSE (Programmable Service Engine), an Embedded Controller like IP, using ISHTP (Integratd Sensor Hub Transport Protocol) to get battery, thermal and UCSI (USB Type-C Connector System Software Interface) related data from the platform.

---
Changes:

v3:
-Moved acpi_dev_put() to the end of ecl_ishtp_cl_remove -Registering ishtp event callback moved after acpi_find_eclite_device() call -cancel_work_sync for event and reset works moved after ishtp cl deinit

v2:
-Decoupled ACPI device search with acpi_find_device() and cache adev -Opregion context is protected with lock for both cmd and data handlers -Opregion length check added in various functions -ishtp_get_device and ishtp_put_device are removed -acpi_walk_dep_device_list() changed to acpi_dev_clear_dependencies() -Kconfig text, cosmetic and minor corrections

v1:
-Initial Version

 MAINTAINERS                               |   6 +
 drivers/platform/x86/Kconfig              |  16 +
 drivers/platform/x86/Makefile             |   1 +
 drivers/platform/x86/intel_ishtp_eclite.c | 701 ++++++++++++++++++++++
 4 files changed, 724 insertions(+)
 create mode 100644 drivers/platform/x86/intel_ishtp_eclite.c
MAINTAINERS +6 -0
index f3267183e993..ea77785e6a1c 100644
@@ -9416,6 +9416,12 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/crypto/ixp4xx_crypto.c
 
+INTEL ISHTP ECLITE DRIVER
+M:	Sumesh K Naduvalath <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	drivers/platform/x86/intel_ishtp_eclite.c
+
 INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT
 M:	Krzysztof Halasa <[email protected]>
 S:	Maintained
drivers/platform/x86/Kconfig +16 -0
index d12db6c316ea..8a0945ed1182 100644
@@ -1176,6 +1176,22 @@ config INTEL_CHTDC_TI_PWRBTN
 	  To compile this driver as a module, choose M here: the module
 	  will be called intel_chtdc_ti_pwrbtn.
 
+config INTEL_ISHTP_ECLITE
+	tristate "Intel ISHTP eclite controller"
+	depends on INTEL_ISH_HID
+	depends on ACPI
+	help
+	  This driver is for accessing the PSE (Programmable Service Engine),
+	  an Embedded Controller like IP, using ISHTP (Integrated Sensor Hub
+	  Transport Protocol) to get battery, thermal and UCSI (USB Type-C
+          Connector System Software Interface) related data from the platform.
+	  Users who don't want to use discrete Embedded Controller on Intel's
+	  Elkhartlake platform, can leverage this integrated solution of
+	  ECLite which is part of PSE subsystem.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called intel_ishtp_eclite
+
 config INTEL_MRFLD_PWRBTN
 	tristate "Intel Merrifield Basin Cove power button driver"
 	depends on INTEL_SOC_PMIC_MRFLD
drivers/platform/x86/Makefile +1 -0
index 7ee369aab10d..568c9c7d4173 100644
@@ -75,6 +75,7 @@ obj-$(CONFIG_INTEL_INT0002_VGPIO)	+= intel_int0002_vgpio.o
 obj-$(CONFIG_INTEL_MENLOW)		+= intel_menlow.o
 obj-$(CONFIG_INTEL_OAKTRAIL)		+= intel_oaktrail.o
 obj-$(CONFIG_INTEL_VBTN)		+= intel-vbtn.o
+obj-$(CONFIG_INTEL_ISHTP_ECLITE)	+= intel_ishtp_eclite.o
 
 # MSI
 obj-$(CONFIG_MSI_LAPTOP)	+= msi-laptop.o
drivers/platform/x86/intel_ishtp_eclite.c new file +701 -0

701 lines not on this page · raw message

Signature · 1 line
2.31.1
#1 lore raw
Quoted 5 lines · On 9/1/21 5:43 AM, [email protected] wrote:
drivers/platform/x86/Kconfig +0 -0
index d12db6c316ea..8a0945ed1182 100644

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1185

Quoted 10 lines
drivers/platform/x86/Kconfig +7 -0
@@ -1176,6 +1176,22 @@ config INTEL_CHTDC_TI_PWRBTN
  	  To compile this driver as a module, choose M here: the module
  	  will be called intel_chtdc_ti_pwrbtn.
 
+config INTEL_ISHTP_ECLITE
+	tristate "Intel ISHTP eclite controller"
+	depends on INTEL_ISH_HID
+	depends on ACPI
+	help
+	  This driver is for accessing the PSE (Programmable Service Engine),
+	  an Embedded Controller like IP, using ISHTP (Integrated Sensor Hub

Which "IP" is that? "an Embedded Controller like IP" doesn't make sense IMO.

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1187

Quoted 2 lines
drivers/platform/x86/Kconfig +2 -0
+	  Transport Protocol) to get battery, thermal and UCSI (USB Type-C
+          Connector System Software Interface) related data from the platform.

Indent above line with tab + 2 spaces instead of many spaces.

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1189

Quoted 2 lines
drivers/platform/x86/Kconfig +2 -0
+	  Users who don't want to use discrete Embedded Controller on Intel's
+	  Elkhartlake platform, can leverage this integrated solution of

Drop this comma ^

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1193

Quoted 4 lines
drivers/platform/x86/Kconfig +4 -0
+	  ECLite which is part of PSE subsystem.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called intel_ishtp_eclite

End the last sentence with a period ('.').

thanks.

Signature · 1 line
~Randy
#2 lore raw

Thank you Randy for the review. Please find my comments inline -

Quoted 22 lines

-----Original Message-----
From: Randy Dunlap <[email protected]>
Sent: Thursday, September 2, 2021 1:02 AM
To: K Naduvalath, Sumesh <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: Pandruvada, Srinivas <[email protected]>; platform-driver- [email protected]; [email protected]; Chinnu, Ganapathi <[email protected]>; Kumar, Nachiketa <[email protected]>
Subject: Re: [PATCH v3 1/1] ishtp: Add support for Intel ishtp eclite driver

Quoted 2 lines · On 9/1/21 5:43 AM, [email protected] wrote:
(quoted diff) +0 -0

b/drivers/platform/x86/Kconfig index d12db6c316ea..8a0945ed1182

100644

Quoted 6 lines
drivers/platform/x86/Kconfig +0 -0
@@ -1176,6 +1176,22 @@ config INTEL_CHTDC_TI_PWRBTN
  	  To compile this driver as a module, choose M here: the module
  	  will be called intel_chtdc_ti_pwrbtn.
 
Quoted 10 lines

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1185

Quoted 7 lines
drivers/platform/x86/Kconfig +7 -0
+config INTEL_ISHTP_ECLITE
+	tristate "Intel ISHTP eclite controller"
+	depends on INTEL_ISH_HID
+	depends on ACPI
+	help
+	  This driver is for accessing the PSE (Programmable Service Engine),
+	  an Embedded Controller like IP, using ISHTP (Integrated Sensor Hub

Which "IP" is that? "an Embedded Controller like IP" doesn't make sense IMO.

This is Intel Elkhartlake's PSE IP. This IP is a dedicated low power real-time ARM based microcontroller within the SoC. More information here:
https://www.intel.in/content/www/in/en/products/platforms/details/elkhart-lake.html

Do you suggest to reword like below?

This driver is for accessing the PSE (Programmable Service Engine) - an Embedded Controller like IP - using ISHTP...

Or reword it with more details?

Quoted 8 lines

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1187

Quoted 4 lines
drivers/platform/x86/Kconfig +2 -0
+	  Transport Protocol) to get battery, thermal and UCSI (USB Type-C
+          Connector System Software Interface) related data from the

platform.

Indent above line with tab + 2 spaces instead of many spaces.

Sure. Will fix in V4.

Quoted 6 lines

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1188

Quoted 1 line
drivers/platform/x86/Kconfig +1 -0
+	  Users who don't want to use discrete Embedded Controller on

Intel's

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1189

Quoted 1 line
drivers/platform/x86/Kconfig +1 -0
+	  Elkhartlake platform, can leverage this integrated solution of

Drop this comma ^

Sure. I'll fix it.

Quoted 8 lines

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1193

Quoted 4 lines
drivers/platform/x86/Kconfig +4 -0
+	  ECLite which is part of PSE subsystem.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called intel_ishtp_eclite

End the last sentence with a period ('.').

Sure. I'll fix it, thanks.

Quoted 3 lines

thanks.
--
~Randy

#3 lore raw

Hi,

Quoted 35 lines · Sumesh

Thank you Randy for the review. Please find my comments inline -

Quoted 22 lines

-----Original Message-----
From: Randy Dunlap <[email protected]>
Sent: Thursday, September 2, 2021 1:02 AM
To: K Naduvalath, Sumesh <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: Pandruvada, Srinivas <[email protected]>; platform-driver- [email protected]; [email protected]; Chinnu, Ganapathi <[email protected]>; Kumar, Nachiketa <[email protected]>
Subject: Re: [PATCH v3 1/1] ishtp: Add support for Intel ishtp eclite driver

Quoted 2 lines · On 9/1/21 5:43 AM, [email protected] wrote:
(quoted diff) +0 -0

b/drivers/platform/x86/Kconfig index d12db6c316ea..8a0945ed1182

100644

Quoted 6 lines
drivers/platform/x86/Kconfig +0 -0
@@ -1176,6 +1176,22 @@ config INTEL_CHTDC_TI_PWRBTN
  	  To compile this driver as a module, choose M here: the module
  	  will be called intel_chtdc_ti_pwrbtn.
 
Quoted 10 lines

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1185

Quoted 7 lines
drivers/platform/x86/Kconfig +7 -0
+config INTEL_ISHTP_ECLITE
+	tristate "Intel ISHTP eclite controller"
+	depends on INTEL_ISH_HID
+	depends on ACPI
+	help
+	  This driver is for accessing the PSE (Programmable Service Engine),
+	  an Embedded Controller like IP, using ISHTP (Integrated Sensor Hub

Which "IP" is that? "an Embedded Controller like IP" doesn't make sense IMO.

Quoted 8 lines

This is Intel Elkhartlake's PSE IP. This IP is a dedicated low power real-time ARM based microcontroller within the SoC. More information here:
https://www.intel.in/content/www/in/en/products/platforms/details/elkhart-lake.html

Do you suggest to reword like below?

This driver is for accessing the PSE (Programmable Service Engine) - an Embedded Controller like IP - using ISHTP...

That seems fine to me, can send a v4 with this and the other thing Randy pointed out fixed please ?

Regards,

Hans

Quoted 35 lines

Or reword it with more details?

Quoted 8 lines

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1187

Quoted 4 lines
drivers/platform/x86/Kconfig +2 -0
+	  Transport Protocol) to get battery, thermal and UCSI (USB Type-C
+          Connector System Software Interface) related data from the

platform.

Indent above line with tab + 2 spaces instead of many spaces.

Sure. Will fix in V4.

Quoted 6 lines

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1188

Quoted 1 line
drivers/platform/x86/Kconfig +1 -0
+	  Users who don't want to use discrete Embedded Controller on

Intel's

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1189

Quoted 1 line
drivers/platform/x86/Kconfig +1 -0
+	  Elkhartlake platform, can leverage this integrated solution of

Drop this comma ^

Sure. I'll fix it.

Quoted 8 lines

drivers/platform/x86/Kconfig config INTEL_CHTDC_TI_PWRBTN · line 1193

Quoted 4 lines
drivers/platform/x86/Kconfig +4 -0
+	  ECLite which is part of PSE subsystem.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called intel_ishtp_eclite

End the last sentence with a period ('.').

Sure. I'll fix it, thanks.

Quoted 3 lines

thanks.
--
~Randy