Skip to contentSkip to conversation

mfd: eiois200: Add core driver for Advantech EIO-IS200.

PATCH New wenkai 1 participant 2 messages Sep 5, 2023 Multifunction devices (MFD)

lore
Share & tools
lore

wenkai

author
#0 lore raw

PATCH 1/1 mfd: eiois200: Add core driver for Advantech EIO-IS200.

The EIO-IS200 is an embedded controller (EC) developed by Advantech, designed to communicate over the LPC (Low Pin Count) bus. All of its functionality is achieved through its own PMC (Power Management Channel) for communication with its firmware.

This driver introduces functions, a regmap, and a mutex for accessing this EC firmware, which will be utilized by its child drivers:
- eiois200_wdt
- gpio_eiois200
- eiois200_hwmon
- eiois200_i2c
- eiois200_thermal

Please note that, when configuring using menuconfig, this driver can only be selected as a module or none (not built-in). All of its child drivers can be inserted and removed separately.

Additionally, the driver provides various sysfs attributes to expose information about the EC chip, firmware, and motherboard.

We've included a timeout parameter to allow modification of th default PMC command timeout value, particularly useful when dealing with extremely slow-responding devices.

---
 drivers/mfd/Kconfig         |  17 ++
 drivers/mfd/Makefile        |   1 +
 drivers/mfd/eiois200.h      | 137 +++++++++
 drivers/mfd/eiois200_core.c | 589 ++++++++++++++++++++++++++++++++++++
 4 files changed, 744 insertions(+)
 create mode 100644 drivers/mfd/eiois200.h
 create mode 100644 drivers/mfd/eiois200_core.c
drivers/mfd/Kconfig +17 -0
index 85be64579fc9..fb702b426f2a 100644
@@ -52,6 +52,23 @@ config MFD_ACT8945A
 	  linear regulators, along with a complete ActivePath battery
 	  charger.
 
+ config MFD_EIOIS200
+	tristate "Advantech EIO-IS200 Embedded Controller core driver"
+	depends on X86
+	depends on m
+	default m
+	select MFD_CORE
+	select REGMAP_MMIO
+	help
+	  This driver provides support for the Advantech EIO-IS200 EC and
+	  activate its sub-drivers, including GPIO, watchdog, hardware
+	  monitor, I2C, and thermal.
+
+	  This driver option only has two states: M and N. It cannot be
+	  built-in. To compile this driver as a module, choose M here; the
+	  module will be called eiois200_core. The system will force it to
+	  M if any one of its sub-drivers is chosen.
+
 config MFD_SUN4I_GPADC
 	tristate "Allwinner sunxi platforms' GPADC MFD driver"
 	select MFD_CORE
drivers/mfd/Makefile +1 -0
index c66f07edcd0e..46dc303ddae4 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_MFD_CROS_EC_DEV)	+= cros_ec_dev.o
 obj-$(CONFIG_MFD_CS42L43)	+= cs42l43.o
 obj-$(CONFIG_MFD_CS42L43_I2C)	+= cs42l43-i2c.o
 obj-$(CONFIG_MFD_CS42L43_SDW)	+= cs42l43-sdw.o
+obj-$(CONFIG_MFD_EIOIS200)	+= eiois200_core.o
 obj-$(CONFIG_MFD_ENE_KB3930)	+= ene-kb3930.o
 obj-$(CONFIG_MFD_EXYNOS_LPASS)	+= exynos-lpass.o
 obj-$(CONFIG_MFD_GATEWORKS_GSC)	+= gateworks-gsc.o
drivers/mfd/eiois200.h new file +137 -0

137 lines not on this page · raw message

drivers/mfd/eiois200_core.c new file +589 -0

589 lines not on this page · raw message

Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/1 mfd: eiois200: Add core driver for Advantech EIOIS200.

EIO-IS200 is Advantech's embedded controller (EC) that communicates over the LPC (low pin count) bus. All functionality is achieved through its own PMC (Power Management Channel) for communication with its firmware.

Note that during menuconfig, the driver can only be selected as a module or none (not built-in). All its child drivers can be inserted and removed separately.

This driver exposes functions, regmap and mutex for its child drivers:
- eiois200_wdt
- gpio_eiois200
- eiois200_hwmon
- eiois200_i2c
- eiois200_thermal

Additionally, the driver provides several sysfs attributes to expose information about the EC chip, firmware, and motherboard.

We provide the timeout parameter to modify the default PMC command timeout value, only when dealing with issues with slow responding devices.

---
 drivers/mfd/Kconfig         |  17 ++
 drivers/mfd/Makefile        |   1 +
 drivers/mfd/eiois200.h      | 137 +++++++++
 drivers/mfd/eiois200_core.c | 589 ++++++++++++++++++++++++++++++++++++
 4 files changed, 744 insertions(+)
 create mode 100644 drivers/mfd/eiois200.h
 create mode 100644 drivers/mfd/eiois200_core.c
drivers/mfd/Kconfig +17 -0
index 85be64579fc9..fb702b426f2a 100644
@@ -52,6 +52,23 @@ config MFD_ACT8945A
 	  linear regulators, along with a complete ActivePath battery
 	  charger.
 
+ config MFD_EIOIS200
+	tristate "Advantech EIO-IS200 Embedded Controller core driver"
+	depends on X86
+	depends on m
+	default m
+	select MFD_CORE
+	select REGMAP_MMIO
+	help
+	  This driver provides support for the Advantech EIO-IS200 EC and
+	  activate its sub-drivers, including GPIO, watchdog, hardware
+	  monitor, I2C, and thermal.
+
+	  This driver option only has two states: M and N. It cannot be
+	  built-in. To compile this driver as a module, choose M here; the
+	  module will be called eiois200_core. The system will force it to
+	  M if any one of its sub-drivers is chosen.
+
 config MFD_SUN4I_GPADC
 	tristate "Allwinner sunxi platforms' GPADC MFD driver"
 	select MFD_CORE
drivers/mfd/Makefile +1 -0
index c66f07edcd0e..9f0f2fd7a702 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_MFD_CROS_EC_DEV)	+= cros_ec_dev.o
 obj-$(CONFIG_MFD_CS42L43)	+= cs42l43.o
 obj-$(CONFIG_MFD_CS42L43_I2C)	+= cs42l43-i2c.o
 obj-$(CONFIG_MFD_CS42L43_SDW)	+= cs42l43-sdw.o
+obj-$(CONFIG_MFD_EIOIS200)	    += eiois200_core.o
 obj-$(CONFIG_MFD_ENE_KB3930)	+= ene-kb3930.o
 obj-$(CONFIG_MFD_EXYNOS_LPASS)	+= exynos-lpass.o
 obj-$(CONFIG_MFD_GATEWORKS_GSC)	+= gateworks-gsc.o
drivers/mfd/eiois200.h new file +137 -0

137 lines not on this page · raw message

drivers/mfd/eiois200_core.c new file +589 -0

589 lines not on this page · raw message

Signature · 1 line
2.34.1