Skip to contentSkip to conversation

gpio: add GPIO support for SMSC SCH311x

PATCH Superseded Bruno Randolf 3 participants 6 messages Dec 5, 2013 – Dec 13, 2013 GPIO

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 gpio: add GPIO support for SMSC SCH311x

This patch adds support for the GPIOs found on the SMSC "Super I/O" chips SCH3112, SCH3114 and SCH3116.

The chip detection and I/O functions are copied from sch311x_wdt.

---
Notes (v4):
- All GPIOs are now supported, driver data is runtime allocated and I tried to address all comments as far as possible.
- Still a platform device is registered, similar to gpio-f7188x.c
- found variable removed
- fixed devm_zalloc
- fixed commit message

---
 drivers/gpio/Kconfig        |   9 +
 drivers/gpio/Makefile       |   1 +
 drivers/gpio/gpio-sch311x.c | 431 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 441 insertions(+)
 create mode 100644 drivers/gpio/gpio-sch311x.c
drivers/gpio/Kconfig +9 -0
index 0f04444..a083314 100644
@@ -237,6 +237,15 @@ config GPIO_SAMSUNG
 	  Legacy GPIO support. Use only for platforms without support for
 	  pinctrl.
 
+config GPIO_SCH311X
+	tristate "SMSC SCH311x SuperI/O GPIO"
+	help
+	  Driver to enable the GPIOs found on SMSC SMSC SCH3112, SCH3114 and
+	  SCH3116 "Super I/O" chipsets.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called gpio-sch311x.
+
 config GPIO_SPEAR_SPICS
 	bool "ST SPEAr13xx SPI Chip Select as GPIO support"
 	depends on PLAT_SPEAR
drivers/gpio/Makefile +1 -0
index 7971e36..6c53998 100644
@@ -67,6 +67,7 @@ obj-$(CONFIG_GPIO_RCAR)		+= gpio-rcar.o
 obj-$(CONFIG_GPIO_SAMSUNG)	+= gpio-samsung.o
 obj-$(CONFIG_ARCH_SA1100)	+= gpio-sa1100.o
 obj-$(CONFIG_GPIO_SCH)		+= gpio-sch.o
+obj-$(CONFIG_GPIO_SCH311X)	+= gpio-sch311x.o
 obj-$(CONFIG_GPIO_SODAVILLE)	+= gpio-sodaville.o
 obj-$(CONFIG_GPIO_SPEAR_SPICS)	+= gpio-spear-spics.o
 obj-$(CONFIG_GPIO_STA2X11)	+= gpio-sta2x11.o
drivers/gpio/gpio-sch311x.c new file +431 -0

431 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 7 lines · Bruno Randolf

This patch adds support for the GPIOs found on the SMSC "Super I/O" chips SCH3112, SCH3114 and SCH3116.

The chip detection and I/O functions are copied from sch311x_wdt.

Quoted 8 lines

---
Notes (v4):
- All GPIOs are now supported, driver data is runtime allocated and I tried to address all comments as far as possible.
- Still a platform device is registered, similar to gpio-f7188x.c
- found variable removed
- fixed devm_zalloc
- fixed commit message

I'm basically happy with this version, but I want to hash out a strategy for handling this type of devices with the x86 platform device maintainer, Matthew, so allow me a few more days to think about this.

Yours,
Linus Walleij

#2 lore raw
Quoted 4 lines · Linus Walleij

I'm basically happy with this version, but I want to hash out a strategy for handling this type of devices with the x86 platform device maintainer, Matthew, so allow me a few more days to think about this.

Bruno, do you have an acpidump for a machine with one of these chips?

Signature · 1 line
Matthew Garrett | [email protected]
#3 lore raw
Quoted 1 line · Matthew Garrett

Bruno, do you have an acpidump for a machine with one of these chips?

I'll try to get one in the next couple of days, but unfortunately I don't have direct access to the machine anymore.

What exatly do you need? Will "cat /sys/firmware/acpi/tables/DSDT > dsdt.dat" suffice? Anything else?

bruno

#4 lore raw
Quoted 8 lines · Bruno Randolf
Quoted 1 line · Matthew Garrett

Bruno, do you have an acpidump for a machine with one of these chips?

I'll try to get one in the next couple of days, but unfortunately I don't have direct access to the machine anymore.

What exatly do you need? Will "cat /sys/firmware/acpi/tables/DSDT > dsdt.dat" suffice? Anything else?

That plus any SSDT files in /sys/firmware/acpi/tables or tables/dynamic.

Signature · 1 line
Matthew Garrett | [email protected]
#5 lore raw
Quoted 11 lines · Matthew Garrett
Quoted 8 lines · Bruno Randolf
Quoted 1 line · Matthew Garrett

Bruno, do you have an acpidump for a machine with one of these chips?

I'll try to get one in the next couple of days, but unfortunately I don't have direct access to the machine anymore.

What exatly do you need? Will "cat /sys/firmware/acpi/tables/DSDT > dsdt.dat" suffice? Anything else?

That plus any SSDT files in /sys/firmware/acpi/tables or tables/dynamic.

Attached you find a .zip file which contains the DSDT and the SSDT tables.

Thanks,
bruno