1a9c5fff5SDavid Brownell# 2a9c5fff5SDavid Brownell# GPIO infrastructure and expanders 3a9c5fff5SDavid Brownell# 4a9c5fff5SDavid Brownell 57444a72eSMichael Bueschconfig ARCH_WANT_OPTIONAL_GPIOLIB 6a9c5fff5SDavid Brownell bool 7a9c5fff5SDavid Brownell help 87444a72eSMichael Buesch Select this config option from the architecture Kconfig, if 97444a72eSMichael Buesch it is possible to use gpiolib on the architecture, but let the 107444a72eSMichael Buesch user decide whether to actually build it or not. 117444a72eSMichael Buesch Select this instead of ARCH_REQUIRE_GPIOLIB, if your architecture does 127444a72eSMichael Buesch not depend on GPIOs being available, but rather let the user 137444a72eSMichael Buesch decide whether he needs it or not. 147444a72eSMichael Buesch 157444a72eSMichael Bueschconfig ARCH_REQUIRE_GPIOLIB 167444a72eSMichael Buesch bool 177444a72eSMichael Buesch select GPIOLIB 187444a72eSMichael Buesch help 19a9c5fff5SDavid Brownell Platforms select gpiolib if they use this infrastructure 20a9c5fff5SDavid Brownell for all their GPIOs, usually starting with ones integrated 21a9c5fff5SDavid Brownell into SOC processors. 227444a72eSMichael Buesch Selecting this from the architecture code will cause the gpiolib 237444a72eSMichael Buesch code to always get built in. 24a9c5fff5SDavid Brownell 257444a72eSMichael Buesch 267444a72eSMichael Buesch 277444a72eSMichael Bueschmenuconfig GPIOLIB 287444a72eSMichael Buesch bool "GPIO Support" 297444a72eSMichael Buesch depends on ARCH_WANT_OPTIONAL_GPIOLIB || ARCH_REQUIRE_GPIOLIB 307444a72eSMichael Buesch select GENERIC_GPIO 317444a72eSMichael Buesch help 327444a72eSMichael Buesch This enables GPIO support through the generic GPIO library. 337444a72eSMichael Buesch You only need to enable this, if you also want to enable 347444a72eSMichael Buesch one or more of the GPIO expansion card drivers below. 357444a72eSMichael Buesch 367444a72eSMichael Buesch If unsure, say N. 377444a72eSMichael Buesch 387444a72eSMichael Bueschif GPIOLIB 39a9c5fff5SDavid Brownell 40a9c5fff5SDavid Brownellconfig DEBUG_GPIO 41a9c5fff5SDavid Brownell bool "Debug GPIO calls" 42a9c5fff5SDavid Brownell depends on DEBUG_KERNEL 43a9c5fff5SDavid Brownell help 44a9c5fff5SDavid Brownell Say Y here to add some extra checks and diagnostics to GPIO calls. 45a9c5fff5SDavid Brownell The checks help ensure that GPIOs have been properly initialized 46a9c5fff5SDavid Brownell before they are used and that sleeping calls aren not made from 47a9c5fff5SDavid Brownell nonsleeping contexts. They can make bitbanged serial protocols 48a9c5fff5SDavid Brownell slower. The diagnostics help catch the type of setup errors 49a9c5fff5SDavid Brownell that are most common when setting up new platforms or boards. 50a9c5fff5SDavid Brownell 51d8f388d8SDavid Brownellconfig GPIO_SYSFS 52d8f388d8SDavid Brownell bool "/sys/class/gpio/... (sysfs interface)" 53d8f388d8SDavid Brownell depends on SYSFS && EXPERIMENTAL 54d8f388d8SDavid Brownell help 55d8f388d8SDavid Brownell Say Y here to add a sysfs interface for GPIOs. 56d8f388d8SDavid Brownell 57d8f388d8SDavid Brownell This is mostly useful to work around omissions in a system's 58d8f388d8SDavid Brownell kernel support. Those are common in custom and semicustom 59d8f388d8SDavid Brownell hardware assembled using standard kernels with a minimum of 60d8f388d8SDavid Brownell custom patches. In those cases, userspace code may import 61d8f388d8SDavid Brownell a given GPIO from the kernel, if no kernel driver requested it. 62d8f388d8SDavid Brownell 63d8f388d8SDavid Brownell Kernel drivers may also request that a particular GPIO be 64d8f388d8SDavid Brownell exported to userspace; this can be useful when debugging. 65d8f388d8SDavid Brownell 66a9c5fff5SDavid Brownell# put expanders in the right section, in alphabetical order 67a9c5fff5SDavid Brownell 68a9c5fff5SDavid Brownellcomment "I2C GPIO expanders:" 69a9c5fff5SDavid Brownell 70*bbcd6d54SEric Miaoconfig GPIO_MAX732X 71*bbcd6d54SEric Miao tristate "MAX7319, MAX7320-7327 I2C Port Expanders" 72*bbcd6d54SEric Miao depends on I2C 73*bbcd6d54SEric Miao help 74*bbcd6d54SEric Miao Say yes here to support the MAX7319, MAX7320-7327 series of I2C 75*bbcd6d54SEric Miao Port Expanders. Each IO port on these chips has a fixed role of 76*bbcd6d54SEric Miao Input (designated by 'I'), Push-Pull Output ('O'), or Open-Drain 77*bbcd6d54SEric Miao Input and Output (designed by 'P'). The combinations are listed 78*bbcd6d54SEric Miao below: 79*bbcd6d54SEric Miao 80*bbcd6d54SEric Miao 8 bits: max7319 (8I), max7320 (8O), max7321 (8P), 81*bbcd6d54SEric Miao max7322 (4I4O), max7323 (4P4O) 82*bbcd6d54SEric Miao 83*bbcd6d54SEric Miao 16 bits: max7324 (8I8O), max7325 (8P8O), 84*bbcd6d54SEric Miao max7326 (4I12O), max7327 (4P12O) 85*bbcd6d54SEric Miao 86*bbcd6d54SEric Miao Board setup code must specify the model to use, and the start 87*bbcd6d54SEric Miao number for these GPIOs. 88*bbcd6d54SEric Miao 89f3dc3630SGuennadi Liakhovetskiconfig GPIO_PCA953X 907059d4b0SDavid Brownell tristate "PCA953x, PCA955x, and MAX7310 I/O ports" 919e60fdcfSeric miao depends on I2C 929e60fdcfSeric miao help 937059d4b0SDavid Brownell Say yes here to provide access to several register-oriented 947059d4b0SDavid Brownell SMBus I/O expanders, made mostly by NXP or TI. Compatible 957059d4b0SDavid Brownell models include: 967059d4b0SDavid Brownell 977059d4b0SDavid Brownell 4 bits: pca9536, pca9537 987059d4b0SDavid Brownell 997059d4b0SDavid Brownell 8 bits: max7310, pca9534, pca9538, pca9554, pca9557 1007059d4b0SDavid Brownell 1017059d4b0SDavid Brownell 16 bits: pca9535, pca9539, pca9555 1029e60fdcfSeric miao 1039e60fdcfSeric miao This driver can also be built as a module. If so, the module 104f3dc3630SGuennadi Liakhovetski will be called pca953x. 1059e60fdcfSeric miao 10615fae37dSDavid Brownellconfig GPIO_PCF857X 1071673ad52SDavid Brownell tristate "PCF857x, PCA{85,96}7x, and MAX732[89] I2C GPIO expanders" 10815fae37dSDavid Brownell depends on I2C 10915fae37dSDavid Brownell help 11015fae37dSDavid Brownell Say yes here to provide access to most "quasi-bidirectional" I2C 11115fae37dSDavid Brownell GPIO expanders used for additional digital outputs or inputs. 11215fae37dSDavid Brownell Most of these parts are from NXP, though TI is a second source for 11315fae37dSDavid Brownell some of them. Compatible models include: 11415fae37dSDavid Brownell 11515fae37dSDavid Brownell 8 bits: pcf8574, pcf8574a, pca8574, pca8574a, 1161673ad52SDavid Brownell pca9670, pca9672, pca9674, pca9674a, 1171673ad52SDavid Brownell max7328, max7329 11815fae37dSDavid Brownell 11915fae37dSDavid Brownell 16 bits: pcf8575, pcf8575c, pca8575, 12015fae37dSDavid Brownell pca9671, pca9673, pca9675 12115fae37dSDavid Brownell 12215fae37dSDavid Brownell Your board setup code will need to declare the expanders in 12315fae37dSDavid Brownell use, and assign numbers to the GPIOs they expose. Those GPIOs 12415fae37dSDavid Brownell can then be used from drivers and other kernel code, just like 12515fae37dSDavid Brownell other GPIOs, but only accessible from task contexts. 12615fae37dSDavid Brownell 12715fae37dSDavid Brownell This driver provides an in-kernel interface to those GPIOs using 12815fae37dSDavid Brownell platform-neutral GPIO calls. 12915fae37dSDavid Brownell 130ff1d5c2fSMichael Bueschcomment "PCI GPIO expanders:" 131ff1d5c2fSMichael Buesch 132ff1d5c2fSMichael Bueschconfig GPIO_BT8XX 133ff1d5c2fSMichael Buesch tristate "BT8XX GPIO abuser" 134ff1d5c2fSMichael Buesch depends on PCI && VIDEO_BT848=n 135ff1d5c2fSMichael Buesch help 136ff1d5c2fSMichael Buesch The BT8xx frame grabber chip has 24 GPIO pins than can be abused 137ff1d5c2fSMichael Buesch as a cheap PCI GPIO card. 138ff1d5c2fSMichael Buesch 139ff1d5c2fSMichael Buesch This chip can be found on Miro, Hauppauge and STB TV-cards. 140ff1d5c2fSMichael Buesch 141ff1d5c2fSMichael Buesch The card needs to be physically altered for using it as a 142ff1d5c2fSMichael Buesch GPIO card. For more information on how to build a GPIO card 143ff1d5c2fSMichael Buesch from a BT8xx TV card, see the documentation file at 144ff1d5c2fSMichael Buesch Documentation/bt8xxgpio.txt 145ff1d5c2fSMichael Buesch 146ff1d5c2fSMichael Buesch If unsure, say N. 147ff1d5c2fSMichael Buesch 148a9c5fff5SDavid Brownellcomment "SPI GPIO expanders:" 149a9c5fff5SDavid Brownell 1500c36ec31SJuergen Beisertconfig GPIO_MAX7301 1510c36ec31SJuergen Beisert tristate "Maxim MAX7301 GPIO expander" 1520c36ec31SJuergen Beisert depends on SPI_MASTER 1530c36ec31SJuergen Beisert help 1540c36ec31SJuergen Beisert gpio driver for Maxim MAX7301 SPI GPIO expander. 1550c36ec31SJuergen Beisert 156e58b9e27SDavid Brownellconfig GPIO_MCP23S08 157e58b9e27SDavid Brownell tristate "Microchip MCP23S08 I/O expander" 158e58b9e27SDavid Brownell depends on SPI_MASTER 159e58b9e27SDavid Brownell help 160e58b9e27SDavid Brownell SPI driver for Microchip MCP23S08 I/O expander. This provides 161e58b9e27SDavid Brownell a GPIO interface supporting inputs and outputs. 162e58b9e27SDavid Brownell 1637444a72eSMichael Bueschendif 164