Page MenuHomeFreeBSD

ftgpio: Add support for Fintek F81865 Super I/O's GPIO
ClosedPublic

Authored by stephane.rochoy_stormshield.eu on Dec 28 2022, 1:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 12:51 PM
Unknown Object (File)
Wed, Nov 6, 12:51 PM
Unknown Object (File)
Sat, Oct 26, 3:19 AM
Unknown Object (File)
Fri, Oct 25, 5:57 AM
Unknown Object (File)
Oct 17 2024, 12:46 AM
Unknown Object (File)
Oct 13 2024, 12:13 PM
Unknown Object (File)
Oct 13 2024, 3:50 AM
Unknown Object (File)
Oct 13 2024, 3:50 AM
Subscribers
Restricted Owners Package

Details

Summary

Add support for Fintek F81865 Super I/O's GPIO via a new ftgpio driver.

Device is properly probed and attached (dmesg | grep -e superio -e gpio while bootverbose):

pcib0: allocated type 4 (0x2e-0x2f) for rid 0 of superio0
pcib0: allocated type 4 (0x4e-0x4f) for rid 0 of superio1
pcib0: allocated type 4 (0x2e-0x2f) for rid 0 of superio0
superio0: <Fintek F81865> at port 0x2e-0x2f on isa0
gpio0: <GPIO Controller on Fintek Super I/O> at GPIO ldn 0x06 on superio0
gpio0: group GPIO0 io is 0x0 (ioreg=0xf0)
gpio0: pin 0<GPIO00> io is input
gpio0: group GPIO0 drive is 0x0 (ioreg=0xf3)
gpio0: pin 0<GPIO00> drive is opendrain
…
gpio0: group GPIO5 io is 0xc0 (ioreg=0xa0)
gpio0: pin 47<GPIO57> io is output
gpio0: group GPIO5 drive is 0x0 (ioreg=0xa3)
gpio0: pin 47<GPIO57> drive is opendrain
…
gpio0: group GPIO6 io is 0x0 (ioreg=0x90)
gpio0: pin 52<GPIO64> io is input
gpio0: group GPIO6 drive is 0x0 (ioreg=0x93)
gpio0: pin 52<GPIO64> drive is opendrain
gpio0: groups GPIO1..GPIO6 enabled
gpiobus0: <GPIO bus> on gpio0
gpioled0: empty pin mask
gpioled1: empty pin mask
gpioc0: <GPIO controller> on gpio0

And gpioctl let me set and clear a pin controling a LED successfully:

# gpioctl -l
pin 00:	1	GPIO00<IN,OD>
…
pin 47:	0	GPIO57<OUT,OD>
…
pin 52:	1	GPIO64<IN,OD>
# gpioctl 47 1
# gpioctl 47 0

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/superio/superio.c
441

BTW, I wonder if it wouldn't be more consistent with the mask to set .devid to 0x1200. Or, maybe, just remove the mask as this entry seems to be only about one specific device.

Commented on the pull request. I'm inclined to commit this, but would prefer a manual. This review seems to have one, but I didn't see one in the pull request. Maybe it's a separate commit that didn't transfer?

sys/dev/superio/superio.c
441

Mask here makes little sense, I think. The whole point of the mask is to make it easier to support a range of parts since superio parts tended to have a crazy number of variations on a theme, all with different IDs

This revision was not accepted when it landed; it landed in state Needs Review.Feb 28 2023, 6:07 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Feb 28 2023, 6:07 PM