1a9c5fff5SDavid Brownell# 2a9c5fff5SDavid Brownell# GPIO infrastructure and expanders 3a9c5fff5SDavid Brownell# 4a9c5fff5SDavid Brownell 5a9c5fff5SDavid Brownellconfig HAVE_GPIO_LIB 6a9c5fff5SDavid Brownell bool 7a9c5fff5SDavid Brownell help 8a9c5fff5SDavid Brownell Platforms select gpiolib if they use this infrastructure 9a9c5fff5SDavid Brownell for all their GPIOs, usually starting with ones integrated 10a9c5fff5SDavid Brownell into SOC processors. 11a9c5fff5SDavid Brownell 12a9c5fff5SDavid Brownellmenu "GPIO Support" 13a9c5fff5SDavid Brownell depends on HAVE_GPIO_LIB 14a9c5fff5SDavid Brownell 15a9c5fff5SDavid Brownellconfig DEBUG_GPIO 16a9c5fff5SDavid Brownell bool "Debug GPIO calls" 17a9c5fff5SDavid Brownell depends on DEBUG_KERNEL 18a9c5fff5SDavid Brownell help 19a9c5fff5SDavid Brownell Say Y here to add some extra checks and diagnostics to GPIO calls. 20a9c5fff5SDavid Brownell The checks help ensure that GPIOs have been properly initialized 21a9c5fff5SDavid Brownell before they are used and that sleeping calls aren not made from 22a9c5fff5SDavid Brownell nonsleeping contexts. They can make bitbanged serial protocols 23a9c5fff5SDavid Brownell slower. The diagnostics help catch the type of setup errors 24a9c5fff5SDavid Brownell that are most common when setting up new platforms or boards. 25a9c5fff5SDavid Brownell 26a9c5fff5SDavid Brownell# put expanders in the right section, in alphabetical order 27a9c5fff5SDavid Brownell 28a9c5fff5SDavid Brownellcomment "I2C GPIO expanders:" 29a9c5fff5SDavid Brownell 30f3dc3630SGuennadi Liakhovetskiconfig GPIO_PCA953X 31*7059d4b0SDavid Brownell tristate "PCA953x, PCA955x, and MAX7310 I/O ports" 329e60fdcfSeric miao depends on I2C 339e60fdcfSeric miao help 34*7059d4b0SDavid Brownell Say yes here to provide access to several register-oriented 35*7059d4b0SDavid Brownell SMBus I/O expanders, made mostly by NXP or TI. Compatible 36*7059d4b0SDavid Brownell models include: 37*7059d4b0SDavid Brownell 38*7059d4b0SDavid Brownell 4 bits: pca9536, pca9537 39*7059d4b0SDavid Brownell 40*7059d4b0SDavid Brownell 8 bits: max7310, pca9534, pca9538, pca9554, pca9557 41*7059d4b0SDavid Brownell 42*7059d4b0SDavid Brownell 16 bits: pca9535, pca9539, pca9555 439e60fdcfSeric miao 449e60fdcfSeric miao This driver can also be built as a module. If so, the module 45f3dc3630SGuennadi Liakhovetski will be called pca953x. 469e60fdcfSeric miao 4715fae37dSDavid Brownellconfig GPIO_PCF857X 4815fae37dSDavid Brownell tristate "PCF857x, PCA857x, and PCA967x I2C GPIO expanders" 4915fae37dSDavid Brownell depends on I2C 5015fae37dSDavid Brownell help 5115fae37dSDavid Brownell Say yes here to provide access to most "quasi-bidirectional" I2C 5215fae37dSDavid Brownell GPIO expanders used for additional digital outputs or inputs. 5315fae37dSDavid Brownell Most of these parts are from NXP, though TI is a second source for 5415fae37dSDavid Brownell some of them. Compatible models include: 5515fae37dSDavid Brownell 5615fae37dSDavid Brownell 8 bits: pcf8574, pcf8574a, pca8574, pca8574a, 5715fae37dSDavid Brownell pca9670, pca9672, pca9674, pca9674a 5815fae37dSDavid Brownell 5915fae37dSDavid Brownell 16 bits: pcf8575, pcf8575c, pca8575, 6015fae37dSDavid Brownell pca9671, pca9673, pca9675 6115fae37dSDavid Brownell 6215fae37dSDavid Brownell Your board setup code will need to declare the expanders in 6315fae37dSDavid Brownell use, and assign numbers to the GPIOs they expose. Those GPIOs 6415fae37dSDavid Brownell can then be used from drivers and other kernel code, just like 6515fae37dSDavid Brownell other GPIOs, but only accessible from task contexts. 6615fae37dSDavid Brownell 6715fae37dSDavid Brownell This driver provides an in-kernel interface to those GPIOs using 6815fae37dSDavid Brownell platform-neutral GPIO calls. 6915fae37dSDavid Brownell 70a9c5fff5SDavid Brownellcomment "SPI GPIO expanders:" 71a9c5fff5SDavid Brownell 72e58b9e27SDavid Brownellconfig GPIO_MCP23S08 73e58b9e27SDavid Brownell tristate "Microchip MCP23S08 I/O expander" 74e58b9e27SDavid Brownell depends on SPI_MASTER 75e58b9e27SDavid Brownell help 76e58b9e27SDavid Brownell SPI driver for Microchip MCP23S08 I/O expander. This provides 77e58b9e27SDavid Brownell a GPIO interface supporting inputs and outputs. 78e58b9e27SDavid Brownell 79a9c5fff5SDavid Brownellendmenu 80