gpio: add GPIO support for F71882FG and F71889F
PATCH v2 1/1 gpio: add GPIO support for F71882FG and F71889F
This patch adds support for the GPIOs found on the Fintek super-I/O chips F71882FG and F71889F.
A super-I/O is a legacy I/O controller embedded on x86 motherboards. It is used to connect the low-bandwidth devices. Among others functions the F71882FG/F71889F provides: a parallel port, two serial ports, a keyboard controller, an hardware monitoring controller and some GPIO pins.
Note that this super-I/Os are embedded on some Atom-based LaCie NASes. The GPIOs are used to control the LEDs and the hard drive power.
---
Linus, I am waiting for your feedback about the Super-I/O device detection. Then this part is unchanged since the previous version. Else I think I have addressed your other concerns.
Changes since v1:
- Enhance the commit message by describing what is a Super-I/O.
- Use self-explanatory names for the GPIO register macros.
- Add a comment to explain the platform device and driver registration.
- Fix gpio_get when GPIO is configured in input mode. I only had the hardware to check this mode recently...
drivers/gpio/Kconfig | 10 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-f7188x.c | 447 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 458 insertions(+) create mode 100644 drivers/gpio/gpio-f7188x.c
drivers/gpio/Kconfig +10 -0
@@ -143,6 +143,16 @@ config GPIO_MM_LANTIQ (EBU) found on Lantiq SoCs. The gpios are output only as they are created by attaching a 16bit latch to the bus. +config GPIO_F7188X + tristate "F71882FG and F71889F GPIO support" + depends on X86 + help + This option enables support for GPIOs found on Fintek Super-I/O + chips F71882FG and F71889F. + + To compile this driver as a module, choose M here: the module will + be called f7188x-gpio. + config GPIO_MPC5200 def_bool y depends on PPC_MPC52xx
drivers/gpio/Makefile +1 -0
@@ -24,6 +24,7 @@ obj-$(CONFIG_GPIO_DA9055) += gpio-da9055.o obj-$(CONFIG_ARCH_DAVINCI) += gpio-davinci.o obj-$(CONFIG_GPIO_EM) += gpio-em.o obj-$(CONFIG_GPIO_EP93XX) += gpio-ep93xx.o +obj-$(CONFIG_GPIO_F7188X) += gpio-f7188x.o obj-$(CONFIG_GPIO_GE_FPGA) += gpio-ge.o obj-$(CONFIG_GPIO_GRGPIO) += gpio-grgpio.o obj-$(CONFIG_GPIO_ICH) += gpio-ich.o
drivers/gpio/gpio-f7188x.c new file +447 -0
447 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Quoted 17 lines · Simon Guinot
This patch adds support for the GPIOs found on the Fintek super-I/O chips F71882FG and F71889F.
A super-I/O is a legacy I/O controller embedded on x86 motherboards. It is used to connect the low-bandwidth devices. Among others functions the F71882FG/F71889F provides: a parallel port, two serial ports, a keyboard controller, an hardware monitoring controller and some GPIO pins.
Note that this super-I/Os are embedded on some Atom-based LaCie NASes. The GPIOs are used to control the LEDs and the hard drive power.
Signed-off-by Simon Guinot <[email protected]>---
Linus, I am waiting for your feedback about the Super-I/O device detection. Then this part is unchanged since the previous version. Else I think I have addressed your other concerns.
Quoted 6 lines
Changes since v1:
- Enhance the commit message by describing what is a Super-I/O.
- Use self-explanatory names for the GPIO register macros.
- Add a comment to explain the platform device and driver registration.
- Fixgpio_getwhen GPIO is configured in input mode. I only had the hardware to check this mode recently...
This is mostly fine.
Quoted 2 lines
(quoted diff) +2
-0+static int f7188x_gpio_probe(struct platform_device *pdev) +{
(...)
Quoted 1 line
+
platform_set_drvdata(pdev, data);
(...)
Quoted 1 line
+
platform_set_drvdata(pdev, NULL);
(...)
Quoted 1 line
+static int
f7188x_gpio_remove(struct platform_device *pdev)
(...)
Quoted 1 line
+
platform_set_drvdata(pdev, NULL);
We don't need to set drvdata to NULL I think, there were lots of patches addressing this last merge window by Jingoo Han, see e.g. commit 1cdd8d52ecbedbce1cbac063aa5715810a228ab3 so please get rid of the NULL setters.
Yours,
Linus Walleij