xref: /linux/drivers/gpio/Kconfig (revision ff1d5c2f0268f4e32103536e2e65480b5b7b6530)
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
26d8f388d8SDavid Brownellconfig GPIO_SYSFS
27d8f388d8SDavid Brownell	bool "/sys/class/gpio/... (sysfs interface)"
28d8f388d8SDavid Brownell	depends on SYSFS && EXPERIMENTAL
29d8f388d8SDavid Brownell	help
30d8f388d8SDavid Brownell	  Say Y here to add a sysfs interface for GPIOs.
31d8f388d8SDavid Brownell
32d8f388d8SDavid Brownell	  This is mostly useful to work around omissions in a system's
33d8f388d8SDavid Brownell	  kernel support.  Those are common in custom and semicustom
34d8f388d8SDavid Brownell	  hardware assembled using standard kernels with a minimum of
35d8f388d8SDavid Brownell	  custom patches.  In those cases, userspace code may import
36d8f388d8SDavid Brownell	  a given GPIO from the kernel, if no kernel driver requested it.
37d8f388d8SDavid Brownell
38d8f388d8SDavid Brownell	  Kernel drivers may also request that a particular GPIO be
39d8f388d8SDavid Brownell	  exported to userspace; this can be useful when debugging.
40d8f388d8SDavid Brownell
41a9c5fff5SDavid Brownell# put expanders in the right section, in alphabetical order
42a9c5fff5SDavid Brownell
43a9c5fff5SDavid Brownellcomment "I2C GPIO expanders:"
44a9c5fff5SDavid Brownell
45f3dc3630SGuennadi Liakhovetskiconfig GPIO_PCA953X
467059d4b0SDavid Brownell	tristate "PCA953x, PCA955x, and MAX7310 I/O ports"
479e60fdcfSeric miao	depends on I2C
489e60fdcfSeric miao	help
497059d4b0SDavid Brownell	  Say yes here to provide access to several register-oriented
507059d4b0SDavid Brownell	  SMBus I/O expanders, made mostly by NXP or TI.  Compatible
517059d4b0SDavid Brownell	  models include:
527059d4b0SDavid Brownell
537059d4b0SDavid Brownell	  4 bits:	pca9536, pca9537
547059d4b0SDavid Brownell
557059d4b0SDavid Brownell	  8 bits:	max7310, pca9534, pca9538, pca9554, pca9557
567059d4b0SDavid Brownell
577059d4b0SDavid Brownell	  16 bits:	pca9535, pca9539, pca9555
589e60fdcfSeric miao
599e60fdcfSeric miao	  This driver can also be built as a module.  If so, the module
60f3dc3630SGuennadi Liakhovetski	  will be called pca953x.
619e60fdcfSeric miao
6215fae37dSDavid Brownellconfig GPIO_PCF857X
631673ad52SDavid Brownell	tristate "PCF857x, PCA{85,96}7x, and MAX732[89] I2C GPIO expanders"
6415fae37dSDavid Brownell	depends on I2C
6515fae37dSDavid Brownell	help
6615fae37dSDavid Brownell	  Say yes here to provide access to most "quasi-bidirectional" I2C
6715fae37dSDavid Brownell	  GPIO expanders used for additional digital outputs or inputs.
6815fae37dSDavid Brownell	  Most of these parts are from NXP, though TI is a second source for
6915fae37dSDavid Brownell	  some of them.  Compatible models include:
7015fae37dSDavid Brownell
7115fae37dSDavid Brownell	  8 bits:   pcf8574, pcf8574a, pca8574, pca8574a,
721673ad52SDavid Brownell	            pca9670, pca9672, pca9674, pca9674a,
731673ad52SDavid Brownell	  	    max7328, max7329
7415fae37dSDavid Brownell
7515fae37dSDavid Brownell	  16 bits:  pcf8575, pcf8575c, pca8575,
7615fae37dSDavid Brownell	            pca9671, pca9673, pca9675
7715fae37dSDavid Brownell
7815fae37dSDavid Brownell	  Your board setup code will need to declare the expanders in
7915fae37dSDavid Brownell	  use, and assign numbers to the GPIOs they expose.  Those GPIOs
8015fae37dSDavid Brownell	  can then be used from drivers and other kernel code, just like
8115fae37dSDavid Brownell	  other GPIOs, but only accessible from task contexts.
8215fae37dSDavid Brownell
8315fae37dSDavid Brownell	  This driver provides an in-kernel interface to those GPIOs using
8415fae37dSDavid Brownell	  platform-neutral GPIO calls.
8515fae37dSDavid Brownell
86*ff1d5c2fSMichael Bueschcomment "PCI GPIO expanders:"
87*ff1d5c2fSMichael Buesch
88*ff1d5c2fSMichael Bueschconfig GPIO_BT8XX
89*ff1d5c2fSMichael Buesch	tristate "BT8XX GPIO abuser"
90*ff1d5c2fSMichael Buesch	depends on PCI && VIDEO_BT848=n
91*ff1d5c2fSMichael Buesch	help
92*ff1d5c2fSMichael Buesch	  The BT8xx frame grabber chip has 24 GPIO pins than can be abused
93*ff1d5c2fSMichael Buesch	  as a cheap PCI GPIO card.
94*ff1d5c2fSMichael Buesch
95*ff1d5c2fSMichael Buesch	  This chip can be found on Miro, Hauppauge and STB TV-cards.
96*ff1d5c2fSMichael Buesch
97*ff1d5c2fSMichael Buesch	  The card needs to be physically altered for using it as a
98*ff1d5c2fSMichael Buesch	  GPIO card. For more information on how to build a GPIO card
99*ff1d5c2fSMichael Buesch	  from a BT8xx TV card, see the documentation file at
100*ff1d5c2fSMichael Buesch	  Documentation/bt8xxgpio.txt
101*ff1d5c2fSMichael Buesch
102*ff1d5c2fSMichael Buesch	  If unsure, say N.
103*ff1d5c2fSMichael Buesch
104a9c5fff5SDavid Brownellcomment "SPI GPIO expanders:"
105a9c5fff5SDavid Brownell
1060c36ec31SJuergen Beisertconfig GPIO_MAX7301
1070c36ec31SJuergen Beisert	tristate "Maxim MAX7301 GPIO expander"
1080c36ec31SJuergen Beisert	depends on SPI_MASTER
1090c36ec31SJuergen Beisert	help
1100c36ec31SJuergen Beisert	  gpio driver for Maxim MAX7301 SPI GPIO expander.
1110c36ec31SJuergen Beisert
112e58b9e27SDavid Brownellconfig GPIO_MCP23S08
113e58b9e27SDavid Brownell	tristate "Microchip MCP23S08 I/O expander"
114e58b9e27SDavid Brownell	depends on SPI_MASTER
115e58b9e27SDavid Brownell	help
116e58b9e27SDavid Brownell	  SPI driver for Microchip MCP23S08 I/O expander.  This provides
117e58b9e27SDavid Brownell	  a GPIO interface supporting inputs and outputs.
118e58b9e27SDavid Brownell
119a9c5fff5SDavid Brownellendmenu
120