Skip to contentSkip to conversation

mfd: ahc1ec0: Add support for Advantech embedded controller

PATCH New Shihlun Lin 1 participant 3 messages Oct 16, 2020 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 mfd: ahc1ec0: Add support for Advantech embedded controller

AHC1EC0 is the embedded controller driver for Advantech industrial products. This provides sub-devices such as hwmon and watchdog, and also expose functions for sud-devices to read/write the value to embedded controller.

---
 drivers/mfd/Kconfig         |    9 +
 drivers/mfd/Makefile        |    2 +
 drivers/mfd/ahc1ec0.c       | 1419 +++++++++++++++++++++++++++++++++++
 include/linux/mfd/ahc1ec0.h |  338 +++++++++
 4 files changed, 1768 insertions(+)
 create mode 100644 drivers/mfd/ahc1ec0.c
 create mode 100644 include/linux/mfd/ahc1ec0.h
drivers/mfd/Kconfig +9 -0
index 33df0837ab41..d0fc0c380b93 100644
@@ -2118,5 +2118,14 @@ config SGI_MFD_IOC3
 	  If you have an SGI Origin, Octane, or a PCI IOC3 card,
 	  then say Y. Otherwise say N.
 
+config MFD_AHC1EC0
+	tristate "Advantech Embedded Controller Module"
+	select MFD_CORE
+	help
+          This is the core function that for Advantech EC drivers. It
+          includes the sub-devices such as hwmon, watchdog, etc. And also
+          provides expose functions for sub-devices to read/write the value
+          to embedded controller.
+
 endmenu
 endif
drivers/mfd/Makefile +2 -0
index a60e5f835283..643e6cdd3300 100644
@@ -264,3 +264,5 @@ obj-$(CONFIG_MFD_STMFX) 	+= stmfx.o
 obj-$(CONFIG_MFD_KHADAS_MCU) 	+= khadas-mcu.o
 
 obj-$(CONFIG_SGI_MFD_IOC3)	+= ioc3.o
+
+obj-$(CONFIG_MFD_AHC1EC0) 	+= ahc1ec0.o
drivers/mfd/ahc1ec0.c new file +1419 -0

1,419 lines not on this page · raw message

include/linux/mfd/ahc1ec0.h new file +338 -0

338 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 2/3 mfd: ahc1ec0-hwmon: Add sub-device hwmon for Advantech embedded controller

This is one of sub-device driver for Advantech embedded controller AHC1EC0. This driver provides sysfs ABI for Advantech related applications to monitor the system status.

---
 drivers/mfd/Kconfig         |    8 +
 drivers/mfd/Makefile        |    1 +
 drivers/mfd/ahc1ec0-hwmon.c | 1514 +++++++++++++++++++++++++++++++++++
 3 files changed, 1523 insertions(+)
 create mode 100644 drivers/mfd/ahc1ec0-hwmon.c
drivers/mfd/Kconfig +8 -0
index d0fc0c380b93..4945638ca6cb 100644
@@ -2127,5 +2127,13 @@ config MFD_AHC1EC0
           provides expose functions for sub-devices to read/write the value
           to embedded controller.
 
+config MFD_AHC1EC0_HWMON
+	tristate "Advantech EC Hareware Monitor Function"
+	depends on MFD_AHC1EC0
+	help
+	  This is sub-device for Advantech embedded controller AHC1EC0. This
+	  driver provides the sysfs attribues for applications to monitor
+	  the system status.
+
 endmenu
 endif
drivers/mfd/Makefile +1 -0
index 643e6cdd3300..46168ac64903 100644
@@ -266,3 +266,4 @@ obj-$(CONFIG_MFD_KHADAS_MCU) 	+= khadas-mcu.o
 obj-$(CONFIG_SGI_MFD_IOC3)	+= ioc3.o
 
 obj-$(CONFIG_MFD_AHC1EC0) 	+= ahc1ec0.o
+obj-$(CONFIG_MFD_AHC1EC0_HWMON)	+= ahc1ec0-hwmon.o
drivers/mfd/ahc1ec0-hwmon.c new file +1514 -0

1,514 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 3/3 mfd: ahc1ec0-wdt: Add sub-device watchdog for Advantech embedded controller

In reply to Shihlun Lin

This is one of sub-device driver for Advantech embedded controller AHC1EC0. This driver provide watchdog functionality for Advantech related applications to restart the system.

---
 drivers/mfd/Kconfig       |   4 +
 drivers/mfd/Makefile      |   3 +-
 drivers/mfd/ahc1ec0-wdt.c | 502 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 508 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mfd/ahc1ec0-wdt.c
drivers/mfd/Kconfig +4 -0
index 4945638ca6cb..662285afb42f 100644
@@ -2135,5 +2135,9 @@ config MFD_AHC1EC0_HWMON
 	  driver provides the sysfs attribues for applications to monitor
 	  the system status.
 
+config MFD_AHC1EC0_WDT
+	tristate "Advantech EC Watchdog Function"
+	depends on MFD_AHC1EC0
+
 endmenu
 endif
drivers/mfd/Makefile +2 -1
index 46168ac64903..d5ce7e7eaf21 100644
@@ -265,5 +265,6 @@ obj-$(CONFIG_MFD_KHADAS_MCU) 	+= khadas-mcu.o
 
 obj-$(CONFIG_SGI_MFD_IOC3)	+= ioc3.o
 
-obj-$(CONFIG_MFD_AHC1EC0) 	+= ahc1ec0.o
+obj-$(CONFIG_MFD_AHC1EC0)	+= ahc1ec0.o
 obj-$(CONFIG_MFD_AHC1EC0_HWMON)	+= ahc1ec0-hwmon.o
+obj-$(CONFIG_MFD_AHC1EC0_WDT)	+= ahc1ec0-wdt.o
drivers/mfd/ahc1ec0-wdt.c new file +502 -0

502 lines not on this page · raw message

Signature · 1 line
2.17.1