Re-factor and overhaul the "mcp23s17gpio" driver as "mcpgpio", and

add support for 8-bit and I2C variants of the chip:
- MCP23008 / MCP23S08: 8-bit (I2C / SPI)
- MCP23017 / MCP23S17: 16-bit (I2C / SPI)
- MCP23018 / MCP23S18: 16-bit (I2C / SPI), open-drain outputs

The MCP23x17 and MCP23x18 are essentially identical, software-wise; we
merely report different GPIO pin capabilities (no push-pull output for
MCP23x18).  Also, remove the tri-state capability that was previously
advertised by the old version of this driver; these chips have no way
to put the pin into a HI-Z mode.

All 3 I2C versions are supported, but the SPI front-end still only
supports the MCP23S17 for now (SPI autoconfiguration needs an overhaul).

mcp23s17gpio(4) remains present as a link to the new mcpgpio(4) man page.

XXX Still to-do: FDT integration, interrupt suppoort.

(File missed in prior commit.)
This commit is contained in:
thorpej 2022-01-17 16:33:00 +00:00
parent 5eb438ad7a
commit 45009b64f1
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files,v 1.1293 2022/01/03 17:19:41 jmcneill Exp $
# $NetBSD: files,v 1.1294 2022/01/17 16:33:00 thorpej Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20171118
@ -420,6 +420,10 @@ file dev/ic/nslm7x.c lm needs-flag
device spdmem
file dev/ic/spdmem.c spdmem
# Microchip MCP23x08 / MCP23x17 general purpose input/output
device mcpgpio: gpiobus
file dev/ic/mcp23xxxgpio.c mcpgpio
# SSD1306 or SH1106 OLED/PLED display (attaches via I2C or SPI)
device ssdfb: wsemuldisplaydev
file dev/ic/ssdfb.c ssdfb