xref: /linux/drivers/gpio/Kconfig (revision 7444a72effa632fcd8edc566f880d96fe213c73b)
1a9c5fff5SDavid Brownell#
2a9c5fff5SDavid Brownell# GPIO infrastructure and expanders
3a9c5fff5SDavid Brownell#
4a9c5fff5SDavid Brownell
5*7444a72eSMichael Bueschconfig ARCH_WANT_OPTIONAL_GPIOLIB
6a9c5fff5SDavid Brownell	bool
7a9c5fff5SDavid Brownell	help
8*7444a72eSMichael Buesch	  Select this config option from the architecture Kconfig, if
9*7444a72eSMichael Buesch	  it is possible to use gpiolib on the architecture, but let the
10*7444a72eSMichael Buesch	  user decide whether to actually build it or not.
11*7444a72eSMichael Buesch	  Select this instead of ARCH_REQUIRE_GPIOLIB, if your architecture does
12*7444a72eSMichael Buesch	  not depend on GPIOs being available, but rather let the user
13*7444a72eSMichael Buesch	  decide whether he needs it or not.
14*7444a72eSMichael Buesch
15*7444a72eSMichael Bueschconfig ARCH_REQUIRE_GPIOLIB
16*7444a72eSMichael Buesch	bool
17*7444a72eSMichael Buesch	select GPIOLIB
18*7444a72eSMichael 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.
22*7444a72eSMichael Buesch	  Selecting this from the architecture code will cause the gpiolib
23*7444a72eSMichael Buesch	  code to always get built in.
24a9c5fff5SDavid Brownell
25*7444a72eSMichael Buesch
26*7444a72eSMichael Buesch
27*7444a72eSMichael Bueschmenuconfig GPIOLIB
28*7444a72eSMichael Buesch	bool "GPIO Support"
29*7444a72eSMichael Buesch	depends on ARCH_WANT_OPTIONAL_GPIOLIB || ARCH_REQUIRE_GPIOLIB
30*7444a72eSMichael Buesch	select GENERIC_GPIO
31*7444a72eSMichael Buesch	help
32*7444a72eSMichael Buesch	  This enables GPIO support through the generic GPIO library.
33*7444a72eSMichael Buesch	  You only need to enable this, if you also want to enable
34*7444a72eSMichael Buesch	  one or more of the GPIO expansion card drivers below.
35*7444a72eSMichael Buesch
36*7444a72eSMichael Buesch	  If unsure, say N.
37*7444a72eSMichael Buesch
38*7444a72eSMichael 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
70f3dc3630SGuennadi Liakhovetskiconfig GPIO_PCA953X
717059d4b0SDavid Brownell	tristate "PCA953x, PCA955x, and MAX7310 I/O ports"
729e60fdcfSeric miao	depends on I2C
739e60fdcfSeric miao	help
747059d4b0SDavid Brownell	  Say yes here to provide access to several register-oriented
757059d4b0SDavid Brownell	  SMBus I/O expanders, made mostly by NXP or TI.  Compatible
767059d4b0SDavid Brownell	  models include:
777059d4b0SDavid Brownell
787059d4b0SDavid Brownell	  4 bits:	pca9536, pca9537
797059d4b0SDavid Brownell
807059d4b0SDavid Brownell	  8 bits:	max7310, pca9534, pca9538, pca9554, pca9557
817059d4b0SDavid Brownell
827059d4b0SDavid Brownell	  16 bits:	pca9535, pca9539, pca9555
839e60fdcfSeric miao
849e60fdcfSeric miao	  This driver can also be built as a module.  If so, the module
85f3dc3630SGuennadi Liakhovetski	  will be called pca953x.
869e60fdcfSeric miao
8715fae37dSDavid Brownellconfig GPIO_PCF857X
881673ad52SDavid Brownell	tristate "PCF857x, PCA{85,96}7x, and MAX732[89] I2C GPIO expanders"
8915fae37dSDavid Brownell	depends on I2C
9015fae37dSDavid Brownell	help
9115fae37dSDavid Brownell	  Say yes here to provide access to most "quasi-bidirectional" I2C
9215fae37dSDavid Brownell	  GPIO expanders used for additional digital outputs or inputs.
9315fae37dSDavid Brownell	  Most of these parts are from NXP, though TI is a second source for
9415fae37dSDavid Brownell	  some of them.  Compatible models include:
9515fae37dSDavid Brownell
9615fae37dSDavid Brownell	  8 bits:   pcf8574, pcf8574a, pca8574, pca8574a,
971673ad52SDavid Brownell	            pca9670, pca9672, pca9674, pca9674a,
981673ad52SDavid Brownell	  	    max7328, max7329
9915fae37dSDavid Brownell
10015fae37dSDavid Brownell	  16 bits:  pcf8575, pcf8575c, pca8575,
10115fae37dSDavid Brownell	            pca9671, pca9673, pca9675
10215fae37dSDavid Brownell
10315fae37dSDavid Brownell	  Your board setup code will need to declare the expanders in
10415fae37dSDavid Brownell	  use, and assign numbers to the GPIOs they expose.  Those GPIOs
10515fae37dSDavid Brownell	  can then be used from drivers and other kernel code, just like
10615fae37dSDavid Brownell	  other GPIOs, but only accessible from task contexts.
10715fae37dSDavid Brownell
10815fae37dSDavid Brownell	  This driver provides an in-kernel interface to those GPIOs using
10915fae37dSDavid Brownell	  platform-neutral GPIO calls.
11015fae37dSDavid Brownell
111ff1d5c2fSMichael Bueschcomment "PCI GPIO expanders:"
112ff1d5c2fSMichael Buesch
113ff1d5c2fSMichael Bueschconfig GPIO_BT8XX
114ff1d5c2fSMichael Buesch	tristate "BT8XX GPIO abuser"
115ff1d5c2fSMichael Buesch	depends on PCI && VIDEO_BT848=n
116ff1d5c2fSMichael Buesch	help
117ff1d5c2fSMichael Buesch	  The BT8xx frame grabber chip has 24 GPIO pins than can be abused
118ff1d5c2fSMichael Buesch	  as a cheap PCI GPIO card.
119ff1d5c2fSMichael Buesch
120ff1d5c2fSMichael Buesch	  This chip can be found on Miro, Hauppauge and STB TV-cards.
121ff1d5c2fSMichael Buesch
122ff1d5c2fSMichael Buesch	  The card needs to be physically altered for using it as a
123ff1d5c2fSMichael Buesch	  GPIO card. For more information on how to build a GPIO card
124ff1d5c2fSMichael Buesch	  from a BT8xx TV card, see the documentation file at
125ff1d5c2fSMichael Buesch	  Documentation/bt8xxgpio.txt
126ff1d5c2fSMichael Buesch
127ff1d5c2fSMichael Buesch	  If unsure, say N.
128ff1d5c2fSMichael Buesch
129a9c5fff5SDavid Brownellcomment "SPI GPIO expanders:"
130a9c5fff5SDavid Brownell
1310c36ec31SJuergen Beisertconfig GPIO_MAX7301
1320c36ec31SJuergen Beisert	tristate "Maxim MAX7301 GPIO expander"
1330c36ec31SJuergen Beisert	depends on SPI_MASTER
1340c36ec31SJuergen Beisert	help
1350c36ec31SJuergen Beisert	  gpio driver for Maxim MAX7301 SPI GPIO expander.
1360c36ec31SJuergen Beisert
137e58b9e27SDavid Brownellconfig GPIO_MCP23S08
138e58b9e27SDavid Brownell	tristate "Microchip MCP23S08 I/O expander"
139e58b9e27SDavid Brownell	depends on SPI_MASTER
140e58b9e27SDavid Brownell	help
141e58b9e27SDavid Brownell	  SPI driver for Microchip MCP23S08 I/O expander.  This provides
142e58b9e27SDavid Brownell	  a GPIO interface supporting inputs and outputs.
143e58b9e27SDavid Brownell
144*7444a72eSMichael Bueschendif
145