David Brownell | a9c5fff | 2008-02-04 22:28:17 -0800 | [diff] [blame] | 1 | # |
| 2 | # GPIO infrastructure and expanders |
| 3 | # |
| 4 | |
Michael Buesch | 7444a72 | 2008-07-25 01:46:11 -0700 | [diff] [blame] | 5 | config ARCH_WANT_OPTIONAL_GPIOLIB |
David Brownell | a9c5fff | 2008-02-04 22:28:17 -0800 | [diff] [blame] | 6 | bool |
| 7 | help |
Michael Buesch | 7444a72 | 2008-07-25 01:46:11 -0700 | [diff] [blame] | 8 | Select this config option from the architecture Kconfig, if |
| 9 | it is possible to use gpiolib on the architecture, but let the |
| 10 | user decide whether to actually build it or not. |
| 11 | Select this instead of ARCH_REQUIRE_GPIOLIB, if your architecture does |
| 12 | not depend on GPIOs being available, but rather let the user |
| 13 | decide whether he needs it or not. |
| 14 | |
| 15 | config ARCH_REQUIRE_GPIOLIB |
| 16 | bool |
| 17 | select GPIOLIB |
| 18 | help |
David Brownell | a9c5fff | 2008-02-04 22:28:17 -0800 | [diff] [blame] | 19 | Platforms select gpiolib if they use this infrastructure |
| 20 | for all their GPIOs, usually starting with ones integrated |
| 21 | into SOC processors. |
Michael Buesch | 7444a72 | 2008-07-25 01:46:11 -0700 | [diff] [blame] | 22 | Selecting this from the architecture code will cause the gpiolib |
| 23 | code to always get built in. |
David Brownell | a9c5fff | 2008-02-04 22:28:17 -0800 | [diff] [blame] | 24 | |
Michael Buesch | 7444a72 | 2008-07-25 01:46:11 -0700 | [diff] [blame] | 25 | |
| 26 | |
| 27 | menuconfig GPIOLIB |
| 28 | bool "GPIO Support" |
| 29 | depends on ARCH_WANT_OPTIONAL_GPIOLIB || ARCH_REQUIRE_GPIOLIB |
| 30 | select GENERIC_GPIO |
| 31 | help |
| 32 | This enables GPIO support through the generic GPIO library. |
| 33 | You only need to enable this, if you also want to enable |
| 34 | one or more of the GPIO expansion card drivers below. |
| 35 | |
| 36 | If unsure, say N. |
| 37 | |
| 38 | if GPIOLIB |
David Brownell | a9c5fff | 2008-02-04 22:28:17 -0800 | [diff] [blame] | 39 | |
| 40 | config DEBUG_GPIO |
| 41 | bool "Debug GPIO calls" |
| 42 | depends on DEBUG_KERNEL |
| 43 | help |
| 44 | Say Y here to add some extra checks and diagnostics to GPIO calls. |
| 45 | The checks help ensure that GPIOs have been properly initialized |
| 46 | before they are used and that sleeping calls aren not made from |
| 47 | nonsleeping contexts. They can make bitbanged serial protocols |
| 48 | slower. The diagnostics help catch the type of setup errors |
| 49 | that are most common when setting up new platforms or boards. |
| 50 | |
David Brownell | d8f388d | 2008-07-25 01:46:07 -0700 | [diff] [blame] | 51 | config GPIO_SYSFS |
| 52 | bool "/sys/class/gpio/... (sysfs interface)" |
| 53 | depends on SYSFS && EXPERIMENTAL |
| 54 | help |
| 55 | Say Y here to add a sysfs interface for GPIOs. |
| 56 | |
| 57 | This is mostly useful to work around omissions in a system's |
| 58 | kernel support. Those are common in custom and semicustom |
| 59 | hardware assembled using standard kernels with a minimum of |
| 60 | custom patches. In those cases, userspace code may import |
| 61 | a given GPIO from the kernel, if no kernel driver requested it. |
| 62 | |
| 63 | Kernel drivers may also request that a particular GPIO be |
| 64 | exported to userspace; this can be useful when debugging. |
| 65 | |
David Brownell | a9c5fff | 2008-02-04 22:28:17 -0800 | [diff] [blame] | 66 | # put expanders in the right section, in alphabetical order |
| 67 | |
John Linn | 0bcb606 | 2008-11-12 13:25:38 -0800 | [diff] [blame] | 68 | comment "Memory mapped GPIO expanders:" |
| 69 | |
| 70 | config GPIO_XILINX |
| 71 | bool "Xilinx GPIO support" |
| 72 | depends on PPC_OF |
| 73 | help |
| 74 | Say yes here to support the Xilinx FPGA GPIO device |
| 75 | |
David Brownell | a9c5fff | 2008-02-04 22:28:17 -0800 | [diff] [blame] | 76 | comment "I2C GPIO expanders:" |
| 77 | |
Eric Miao | bbcd6d5 | 2008-07-25 01:46:14 -0700 | [diff] [blame] | 78 | config GPIO_MAX732X |
| 79 | tristate "MAX7319, MAX7320-7327 I2C Port Expanders" |
| 80 | depends on I2C |
| 81 | help |
| 82 | Say yes here to support the MAX7319, MAX7320-7327 series of I2C |
| 83 | Port Expanders. Each IO port on these chips has a fixed role of |
| 84 | Input (designated by 'I'), Push-Pull Output ('O'), or Open-Drain |
| 85 | Input and Output (designed by 'P'). The combinations are listed |
| 86 | below: |
| 87 | |
| 88 | 8 bits: max7319 (8I), max7320 (8O), max7321 (8P), |
| 89 | max7322 (4I4O), max7323 (4P4O) |
| 90 | |
| 91 | 16 bits: max7324 (8I8O), max7325 (8P8O), |
| 92 | max7326 (4I12O), max7327 (4P12O) |
| 93 | |
| 94 | Board setup code must specify the model to use, and the start |
| 95 | number for these GPIOs. |
| 96 | |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 97 | config GPIO_PCA953X |
David Brownell | ab5dc37 | 2009-01-06 14:42:27 -0800 | [diff] [blame] | 98 | tristate "PCA953x, PCA955x, TCA64xx, and MAX7310 I/O ports" |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 99 | depends on I2C |
| 100 | help |
David Brownell | 7059d4b | 2008-07-04 09:59:37 -0700 | [diff] [blame] | 101 | Say yes here to provide access to several register-oriented |
| 102 | SMBus I/O expanders, made mostly by NXP or TI. Compatible |
| 103 | models include: |
| 104 | |
| 105 | 4 bits: pca9536, pca9537 |
| 106 | |
David Brownell | ab5dc37 | 2009-01-06 14:42:27 -0800 | [diff] [blame] | 107 | 8 bits: max7310, pca9534, pca9538, pca9554, pca9557, |
| 108 | tca6408 |
David Brownell | 7059d4b | 2008-07-04 09:59:37 -0700 | [diff] [blame] | 109 | |
David Brownell | ab5dc37 | 2009-01-06 14:42:27 -0800 | [diff] [blame] | 110 | 16 bits: pca9535, pca9539, pca9555, tca6416 |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 111 | |
| 112 | This driver can also be built as a module. If so, the module |
Guennadi Liakhovetski | f3dc363 | 2008-02-06 01:39:03 -0800 | [diff] [blame] | 113 | will be called pca953x. |
eric miao | 9e60fdc | 2008-02-04 22:28:26 -0800 | [diff] [blame] | 114 | |
David Brownell | 15fae37 | 2008-02-04 22:28:24 -0800 | [diff] [blame] | 115 | config GPIO_PCF857X |
David Brownell | 1673ad5 | 2008-07-21 14:21:34 -0700 | [diff] [blame] | 116 | tristate "PCF857x, PCA{85,96}7x, and MAX732[89] I2C GPIO expanders" |
David Brownell | 15fae37 | 2008-02-04 22:28:24 -0800 | [diff] [blame] | 117 | depends on I2C |
| 118 | help |
| 119 | Say yes here to provide access to most "quasi-bidirectional" I2C |
| 120 | GPIO expanders used for additional digital outputs or inputs. |
| 121 | Most of these parts are from NXP, though TI is a second source for |
| 122 | some of them. Compatible models include: |
| 123 | |
| 124 | 8 bits: pcf8574, pcf8574a, pca8574, pca8574a, |
David Brownell | 1673ad5 | 2008-07-21 14:21:34 -0700 | [diff] [blame] | 125 | pca9670, pca9672, pca9674, pca9674a, |
| 126 | max7328, max7329 |
David Brownell | 15fae37 | 2008-02-04 22:28:24 -0800 | [diff] [blame] | 127 | |
| 128 | 16 bits: pcf8575, pcf8575c, pca8575, |
| 129 | pca9671, pca9673, pca9675 |
| 130 | |
| 131 | Your board setup code will need to declare the expanders in |
| 132 | use, and assign numbers to the GPIOs they expose. Those GPIOs |
| 133 | can then be used from drivers and other kernel code, just like |
| 134 | other GPIOs, but only accessible from task contexts. |
| 135 | |
| 136 | This driver provides an in-kernel interface to those GPIOs using |
| 137 | platform-neutral GPIO calls. |
| 138 | |
David Brownell | e9d35947 | 2008-10-20 23:51:46 +0200 | [diff] [blame] | 139 | config GPIO_TWL4030 |
| 140 | tristate "TWL4030, TWL5030, and TPS659x0 GPIOs" |
| 141 | depends on TWL4030_CORE |
| 142 | help |
| 143 | Say yes here to access the GPIO signals of various multi-function |
| 144 | power management chips from Texas Instruments. |
| 145 | |
Michael Buesch | ff1d5c2 | 2008-07-25 01:46:10 -0700 | [diff] [blame] | 146 | comment "PCI GPIO expanders:" |
| 147 | |
| 148 | config GPIO_BT8XX |
| 149 | tristate "BT8XX GPIO abuser" |
| 150 | depends on PCI && VIDEO_BT848=n |
| 151 | help |
| 152 | The BT8xx frame grabber chip has 24 GPIO pins than can be abused |
| 153 | as a cheap PCI GPIO card. |
| 154 | |
| 155 | This chip can be found on Miro, Hauppauge and STB TV-cards. |
| 156 | |
| 157 | The card needs to be physically altered for using it as a |
| 158 | GPIO card. For more information on how to build a GPIO card |
| 159 | from a BT8xx TV card, see the documentation file at |
| 160 | Documentation/bt8xxgpio.txt |
| 161 | |
| 162 | If unsure, say N. |
| 163 | |
David Brownell | a9c5fff | 2008-02-04 22:28:17 -0800 | [diff] [blame] | 164 | comment "SPI GPIO expanders:" |
| 165 | |
Juergen Beisert | 0c36ec3 | 2008-07-21 14:21:34 -0700 | [diff] [blame] | 166 | config GPIO_MAX7301 |
| 167 | tristate "Maxim MAX7301 GPIO expander" |
| 168 | depends on SPI_MASTER |
| 169 | help |
| 170 | gpio driver for Maxim MAX7301 SPI GPIO expander. |
| 171 | |
David Brownell | e58b9e2 | 2008-02-04 22:28:25 -0800 | [diff] [blame] | 172 | config GPIO_MCP23S08 |
| 173 | tristate "Microchip MCP23S08 I/O expander" |
| 174 | depends on SPI_MASTER |
| 175 | help |
| 176 | SPI driver for Microchip MCP23S08 I/O expander. This provides |
| 177 | a GPIO interface supporting inputs and outputs. |
| 178 | |
Michael Buesch | 7444a72 | 2008-07-25 01:46:11 -0700 | [diff] [blame] | 179 | endif |