10b11dbf7SMasahiro Yamada# 20b11dbf7SMasahiro Yamada# GPIO infrastructure and drivers 30b11dbf7SMasahiro Yamada# 40b11dbf7SMasahiro Yamada 50b11dbf7SMasahiro Yamadamenu "GPIO Support" 60b11dbf7SMasahiro Yamada 7da333ae7SMasahiro Yamadaconfig DM_GPIO 8da333ae7SMasahiro Yamada bool "Enable Driver Model for GPIO drivers" 9da333ae7SMasahiro Yamada depends on DM 10da333ae7SMasahiro Yamada help 11f94a1bedSSimon Glass Enable driver model for GPIO access. The standard GPIO 12f94a1bedSSimon Glass interface (gpio_get_value(), etc.) is then implemented by 13f94a1bedSSimon Glass the GPIO uclass. Drivers provide methods to query the 14f94a1bedSSimon Glass particular GPIOs that they provide. The uclass interface 15f94a1bedSSimon Glass is defined in include/asm-generic/gpio.h. 16606f7047SAlbert ARIBAUD \(3ADEV\) 17*7e044b9aSHeiko Schocherconfig DM_GPIO_HOG 18*7e044b9aSHeiko Schocher bool "Enable GPIO hog support" 19*7e044b9aSHeiko Schocher depends on DM_GPIO 20*7e044b9aSHeiko Schocher default n 21*7e044b9aSHeiko Schocher help 22*7e044b9aSHeiko Schocher Enable gpio hog support 23*7e044b9aSHeiko Schocher The GPIO chip may contain GPIO hog definitions. GPIO hogging 24*7e044b9aSHeiko Schocher is a mechanism providing automatic GPIO request and config- 25*7e044b9aSHeiko Schocher uration as part of the gpio-controller's driver probe function. 26*7e044b9aSHeiko Schocher 2788d5ecf4SThomas Chouconfig ALTERA_PIO 2888d5ecf4SThomas Chou bool "Altera PIO driver" 2988d5ecf4SThomas Chou depends on DM_GPIO 3088d5ecf4SThomas Chou help 3188d5ecf4SThomas Chou Select this to enable PIO for Altera devices. Please find 3288d5ecf4SThomas Chou details on the "Embedded Peripherals IP User Guide" of Altera. 3388d5ecf4SThomas Chou 34e64bdb2fSÁlvaro Fernández Rojasconfig BCM6345_GPIO 35e64bdb2fSÁlvaro Fernández Rojas bool "BCM6345 GPIO driver" 36e64bdb2fSÁlvaro Fernández Rojas depends on DM_GPIO && ARCH_BMIPS 37e64bdb2fSÁlvaro Fernández Rojas help 38e64bdb2fSÁlvaro Fernández Rojas This driver supports the GPIO banks on BCM6345 SoCs. 39e64bdb2fSÁlvaro Fernández Rojas 40e30a70c2SMarek Vasutconfig DWAPB_GPIO 41e30a70c2SMarek Vasut bool "DWAPB GPIO driver" 42e30a70c2SMarek Vasut depends on DM && DM_GPIO 43e30a70c2SMarek Vasut default n 44e30a70c2SMarek Vasut help 45e30a70c2SMarek Vasut Support for the Designware APB GPIO driver. 46e30a70c2SMarek Vasut 475a07a5f9SWenyou Yangconfig AT91_GPIO 485a07a5f9SWenyou Yang bool "AT91 PIO GPIO driver" 495a07a5f9SWenyou Yang depends on DM_GPIO 505a07a5f9SWenyou Yang default n 515a07a5f9SWenyou Yang help 525a07a5f9SWenyou Yang Say yes here to select AT91 PIO GPIO driver. AT91 PIO 535a07a5f9SWenyou Yang controller manages up to 32 fully programmable input/output 545a07a5f9SWenyou Yang lines. Each I/O line may be dedicated as a general-purpose 555a07a5f9SWenyou Yang I/O or be assigned to a function of an embedded peripheral. 565a07a5f9SWenyou Yang The assignment to a function of an embedded peripheral is 575a07a5f9SWenyou Yang the responsibility of AT91 Pinctrl driver. This driver is 585a07a5f9SWenyou Yang responsible for the general-purpose I/O. 595a07a5f9SWenyou Yang 602c62c56aSWenyou Yangconfig ATMEL_PIO4 612c62c56aSWenyou Yang bool "ATMEL PIO4 driver" 62ee3311dbSWenyou Yang depends on DM_GPIO 632c62c56aSWenyou Yang default n 642c62c56aSWenyou Yang help 652c62c56aSWenyou Yang Say yes here to support the Atmel PIO4 driver. 662c62c56aSWenyou Yang The PIO4 is new version of Atmel PIO controller, which manages 672c62c56aSWenyou Yang up to 128 fully programmable input/output lines. Each I/O line 682c62c56aSWenyou Yang may be dedicated as a general purpose I/O or be assigned to 692c62c56aSWenyou Yang a function of an embedded peripheral. 702c62c56aSWenyou Yang 7164b17977SSimon Glassconfig INTEL_BROADWELL_GPIO 7264b17977SSimon Glass bool "Intel Broadwell GPIO driver" 7364b17977SSimon Glass depends on DM 7464b17977SSimon Glass help 7564b17977SSimon Glass This driver supports Broadwell U devices which have an expanded 7664b17977SSimon Glass GPIO feature set. The difference is large enough to merit a separate 7764b17977SSimon Glass driver from the common Intel ICH6 driver. It supports a total of 7864b17977SSimon Glass 95 GPIOs which can be configured from the device tree. 7964b17977SSimon Glass 8072436892SBin Mengconfig INTEL_ICH6_GPIO 8172436892SBin Meng bool "Intel ICH6 compatible legacy GPIO driver" 8272436892SBin Meng depends on DM_GPIO 8372436892SBin Meng help 8472436892SBin Meng Say yes here to select Intel ICH6 compatible legacy GPIO driver. 8572436892SBin Meng 86d665eb61SPeng Fanconfig IMX_RGPIO2P 87d665eb61SPeng Fan bool "i.MX7ULP RGPIO2P driver" 88d665eb61SPeng Fan depends on DM 89d665eb61SPeng Fan default n 90d665eb61SPeng Fan help 91d665eb61SPeng Fan This driver supports i.MX7ULP Rapid GPIO2P controller. 92d665eb61SPeng Fan 93606f7047SAlbert ARIBAUD \(3ADEV\)config LPC32XX_GPIO 94606f7047SAlbert ARIBAUD \(3ADEV\) bool "LPC32XX GPIO driver" 95606f7047SAlbert ARIBAUD \(3ADEV\) depends on DM 96606f7047SAlbert ARIBAUD \(3ADEV\) default n 97606f7047SAlbert ARIBAUD \(3ADEV\) help 98606f7047SAlbert ARIBAUD \(3ADEV\) Support for the LPC32XX GPIO driver. 99d79c50afSSimon Glass 10081a87e18SMateusz Kulikowskiconfig MSM_GPIO 10181a87e18SMateusz Kulikowski bool "Qualcomm GPIO driver" 10281a87e18SMateusz Kulikowski depends on DM_GPIO 10381a87e18SMateusz Kulikowski default n 10481a87e18SMateusz Kulikowski help 10581a87e18SMateusz Kulikowski Support GPIO controllers on Qualcomm Snapdragon family of SoCs. 10681a87e18SMateusz Kulikowski This controller have single bank (default name "soc"), every 10781a87e18SMateusz Kulikowski gpio has it's own set of registers. 10881a87e18SMateusz Kulikowski Only simple GPIO operations are supported (get/set, change of 10981a87e18SMateusz Kulikowski direction and checking pin function). 11081a87e18SMateusz Kulikowski Supported devices: 11181a87e18SMateusz Kulikowski - APQ8016 11281a87e18SMateusz Kulikowski - MSM8916 11381a87e18SMateusz Kulikowski 11429cb2b3bSTom Riniconfig OMAP_GPIO 11529cb2b3bSTom Rini bool "TI OMAP GPIO driver" 11629cb2b3bSTom Rini depends on ARCH_OMAP2PLUS 11729cb2b3bSTom Rini default y 11829cb2b3bSTom Rini help 11929cb2b3bSTom Rini Support GPIO controllers on the TI OMAP3/4/5 and related (such as 12029cb2b3bSTom Rini AM335x/AM43xx/AM57xx/DRA7xx/etc) families of SoCs. 12129cb2b3bSTom Rini 1220091362cSSimon Glassconfig CMD_PCA953X 1230091362cSSimon Glass bool "Enable the pca953x command" 1240091362cSSimon Glass help 1250091362cSSimon Glass Deprecated: This should be converted to driver model. 1260091362cSSimon Glass 1270091362cSSimon Glass This command provides access to a pca953x GPIO device using the 1280091362cSSimon Glass legacy GPIO interface. Several subcommands are provided which mirror 1290091362cSSimon Glass the standard 'gpio' command. It should use that instead. 1300091362cSSimon Glass 131120800dfSMateusz Kulikowskiconfig PM8916_GPIO 132120800dfSMateusz Kulikowski bool "Qualcomm PM8916 PMIC GPIO/keypad driver" 133120800dfSMateusz Kulikowski depends on DM_GPIO && PMIC_PM8916 134120800dfSMateusz Kulikowski help 135120800dfSMateusz Kulikowski Support for GPIO pins and power/reset buttons found on 136120800dfSMateusz Kulikowski Qualcomm PM8916 PMIC. 137120800dfSMateusz Kulikowski Default name for GPIO bank is "pm8916". 138120800dfSMateusz Kulikowski Power and reset buttons are placed in "pm8916_key" bank and 139120800dfSMateusz Kulikowski have gpio numbers 0 and 1 respectively. 140120800dfSMateusz Kulikowski 1415746b0dfSVignesh Rconfig PCF8575_GPIO 1425746b0dfSVignesh R bool "PCF8575 I2C GPIO Expander driver" 1435746b0dfSVignesh R depends on DM_GPIO && DM_I2C 1445746b0dfSVignesh R help 1455746b0dfSVignesh R Support for PCF8575 I2C 16-bit GPIO expander. Most of these 1465746b0dfSVignesh R chips are from NXP and TI. 1475746b0dfSVignesh R 1481f8f7730SSimon Glassconfig ROCKCHIP_GPIO 1491f8f7730SSimon Glass bool "Rockchip GPIO driver" 1501f8f7730SSimon Glass depends on DM_GPIO 1511f8f7730SSimon Glass help 1521f8f7730SSimon Glass Support GPIO access on Rockchip SoCs. The GPIOs are arranged into 1531f8f7730SSimon Glass a number of banks (different for each SoC type) each with 32 GPIOs. 1541f8f7730SSimon Glass The GPIOs for a device are defined in the device tree with one node 1551f8f7730SSimon Glass for each bank. 1561f8f7730SSimon Glass 157d1aef94bSJianqun Xuconfig ROCKCHIP_GPIO_V2 158d1aef94bSJianqun Xu bool "Rockchip GPIO driver version 2.0" 159d1aef94bSJianqun Xu depends on ROCKCHIP_GPIO 160d1aef94bSJianqun Xu default n 161d1aef94bSJianqun Xu help 162d1aef94bSJianqun Xu Support GPIO access on Rockchip SoCs. The GPIOs are arranged into 163d1aef94bSJianqun Xu a number of banks (different for each SoC type) each with 32 GPIOs. 164d1aef94bSJianqun Xu The GPIOs for a device are defined in the device tree with one node 165d1aef94bSJianqun Xu for each bank. 166d1aef94bSJianqun Xu 167d1aef94bSJianqun Xu Support version 2.0 GPIO controller, which support write enable bits 168d1aef94bSJianqun Xu for some registers, such as dr, ddr. 169d1aef94bSJianqun Xu 170d79c50afSSimon Glassconfig SANDBOX_GPIO 171d79c50afSSimon Glass bool "Enable sandbox GPIO driver" 172d79c50afSSimon Glass depends on SANDBOX && DM && DM_GPIO 173d79c50afSSimon Glass help 174d79c50afSSimon Glass This driver supports some simulated GPIOs which can be adjusted 175d79c50afSSimon Glass using 'back door' functions like sandbox_gpio_set_value(). Then the 176d79c50afSSimon Glass GPIOs can be inspected through the normal get_get_value() 177d79c50afSSimon Glass interface. The purpose of this is to allow GPIOs to be used as 178d79c50afSSimon Glass normal in sandbox, perhaps with test code actually driving the 179d79c50afSSimon Glass behaviour of those GPIOs. 180d79c50afSSimon Glass 181d79c50afSSimon Glassconfig SANDBOX_GPIO_COUNT 182d79c50afSSimon Glass int "Number of sandbox GPIOs" 183d79c50afSSimon Glass depends on SANDBOX_GPIO 184d79c50afSSimon Glass default 128 185d79c50afSSimon Glass help 186d79c50afSSimon Glass The sandbox driver can support any number of GPIOs. Generally these 187d79c50afSSimon Glass are specified using the device tree. But you can also have a number 188d79c50afSSimon Glass of 'anonymous' GPIOs that do not belong to any device or bank. 189d79c50afSSimon Glass Select a suitable value depending on your needs. 190d348a943SBhuvanchandra DV 19190d99e59SSimon Glassconfig CMD_TCA642X 19290d99e59SSimon Glass bool "tca642x - Command to access tca642x state" 19390d99e59SSimon Glass help 19490d99e59SSimon Glass DEPRECATED - This needs conversion to driver model 19590d99e59SSimon Glass 19690d99e59SSimon Glass This provides a way to looking at the pin state of this device. 19790d99e59SSimon Glass This mirrors the 'gpio' command and that should be used in preference 19890d99e59SSimon Glass to custom code. 19990d99e59SSimon Glass 200601800beSStephen Warrenconfig TEGRA_GPIO 201601800beSStephen Warren bool "Tegra20..210 GPIO driver" 202601800beSStephen Warren depends on DM_GPIO 203601800beSStephen Warren help 204601800beSStephen Warren Support for the GPIO controller contained in NVIDIA Tegra20 through 205601800beSStephen Warren Tegra210. 206601800beSStephen Warren 207074a1fddSStephen Warrenconfig TEGRA186_GPIO 208074a1fddSStephen Warren bool "Tegra186 GPIO driver" 209074a1fddSStephen Warren depends on DM_GPIO 210074a1fddSStephen Warren help 211074a1fddSStephen Warren Support for the GPIO controller contained in NVIDIA Tegra186. This 212074a1fddSStephen Warren covers both the "main" and "AON" controller instances, even though 213074a1fddSStephen Warren they have slightly different register layout. 214074a1fddSStephen Warren 215007fc775SWyon Biconfig GPIO_MAX96752F 216007fc775SWyon Bi bool "Maxim MAX96752F GPIO" 217007fc775SWyon Bi depends on DM_GPIO && I2C_MUX_MAX96752F 218007fc775SWyon Bi help 219007fc775SWyon Bi Say yes here to support Maxim MAX96752F GPIOs. 220007fc775SWyon Bi 221b9a66b63SMasahiro Yamadaconfig GPIO_UNIPHIER 222b9a66b63SMasahiro Yamada bool "UniPhier GPIO" 223b9a66b63SMasahiro Yamada depends on ARCH_UNIPHIER 224b9a66b63SMasahiro Yamada help 225b9a66b63SMasahiro Yamada Say yes here to support UniPhier GPIOs. 226b9a66b63SMasahiro Yamada 227d348a943SBhuvanchandra DVconfig VYBRID_GPIO 228d348a943SBhuvanchandra DV bool "Vybrid GPIO driver" 229d348a943SBhuvanchandra DV depends on DM 230d348a943SBhuvanchandra DV default n 231d348a943SBhuvanchandra DV help 232d348a943SBhuvanchandra DV Say yes here to support Vybrid vf610 GPIOs. 2330b11dbf7SMasahiro Yamada 234386d934eSPurna Chandra Mandalconfig PIC32_GPIO 235386d934eSPurna Chandra Mandal bool "Microchip PIC32 GPIO driver" 236386d934eSPurna Chandra Mandal depends on DM_GPIO && MACH_PIC32 237386d934eSPurna Chandra Mandal default y 238386d934eSPurna Chandra Mandal help 239386d934eSPurna Chandra Mandal Say yes here to support Microchip PIC32 GPIOs. 240386d934eSPurna Chandra Mandal 24177417102SVikas Manochaconfig STM32F7_GPIO 24277417102SVikas Manocha bool "ST STM32 GPIO driver" 24377417102SVikas Manocha depends on DM_GPIO && STM32 24477417102SVikas Manocha default y 24577417102SVikas Manocha help 24677417102SVikas Manocha Device model driver support for STM32 GPIO controller. It should be 24777417102SVikas Manocha usable on many stm32 families like stm32f4 & stm32H7. 24877417102SVikas Manocha Tested on STM32F7. 24977417102SVikas Manocha 250704d9a64SStefan Roeseconfig MVEBU_GPIO 251704d9a64SStefan Roese bool "Marvell MVEBU GPIO driver" 252704d9a64SStefan Roese depends on DM_GPIO && ARCH_MVEBU 253704d9a64SStefan Roese default y 254704d9a64SStefan Roese help 255704d9a64SStefan Roese Say yes here to support Marvell MVEBU (Armada XP/38x) GPIOs. 256704d9a64SStefan Roese 2572978ae23SSiva Durga Prasad Paladuguconfig ZYNQ_GPIO 2582978ae23SSiva Durga Prasad Paladugu bool "Zynq GPIO driver" 259251ab06dSSiva Durga Prasad Paladugu depends on DM_GPIO && (ARCH_ZYNQ || ARCH_ZYNQMP) 2602978ae23SSiva Durga Prasad Paladugu default y 2612978ae23SSiva Durga Prasad Paladugu help 2622978ae23SSiva Durga Prasad Paladugu Supports GPIO access on Zynq SoC. 2632978ae23SSiva Durga Prasad Paladugu 2649300f711SPeng Fanconfig DM_74X164 2659300f711SPeng Fan bool "74x164 serial-in/parallel-out 8-bits shift register" 2669300f711SPeng Fan depends on DM_GPIO 2679300f711SPeng Fan help 2689300f711SPeng Fan Driver for 74x164 compatible serial-in/parallel-out 8-outputs 2699300f711SPeng Fan shift registers, such as 74lv165, 74hc595. 2709300f711SPeng Fan This driver can be used to provide access to more gpio outputs. 2719300f711SPeng Fan 27203773439SPeng Fanconfig DM_PCA953X 27303773439SPeng Fan bool "PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports" 27403773439SPeng Fan depends on DM_GPIO 27503773439SPeng Fan help 27603773439SPeng Fan Say yes here to provide access to several register-oriented 27703773439SPeng Fan SMBus I/O expanders, made mostly by NXP or TI. Compatible 27803773439SPeng Fan models include: 27903773439SPeng Fan 28003773439SPeng Fan 4 bits: pca9536, pca9537 28103773439SPeng Fan 28203773439SPeng Fan 8 bits: max7310, max7315, pca6107, pca9534, pca9538, pca9554, 28303773439SPeng Fan pca9556, pca9557, pca9574, tca6408, xra1202 28403773439SPeng Fan 28503773439SPeng Fan 16 bits: max7312, max7313, pca9535, pca9539, pca9555, pca9575, 28603773439SPeng Fan tca6416 28703773439SPeng Fan 28803773439SPeng Fan 24 bits: tca6424 28903773439SPeng Fan 29003773439SPeng Fan 40 bits: pca9505, pca9698 29103773439SPeng Fan 29203773439SPeng Fan Now, max 24 bits chips and PCA953X compatible chips are 29303773439SPeng Fan supported 29407d31f8fSmario.six@gdsys.cc 29507d31f8fSmario.six@gdsys.ccconfig MPC85XX_GPIO 29607d31f8fSmario.six@gdsys.cc bool "Freescale MPC85XX GPIO driver" 29707d31f8fSmario.six@gdsys.cc depends on DM_GPIO 29807d31f8fSmario.six@gdsys.cc help 29907d31f8fSmario.six@gdsys.cc This driver supports the built-in GPIO controller of MPC85XX CPUs. 30007d31f8fSmario.six@gdsys.cc Each GPIO bank is identified by its own entry in the device tree, 30107d31f8fSmario.six@gdsys.cc i.e. 30207d31f8fSmario.six@gdsys.cc 30307d31f8fSmario.six@gdsys.cc gpio-controller@fc00 { 30407d31f8fSmario.six@gdsys.cc #gpio-cells = <2>; 30507d31f8fSmario.six@gdsys.cc compatible = "fsl,pq3-gpio"; 30607d31f8fSmario.six@gdsys.cc reg = <0xfc00 0x100> 30707d31f8fSmario.six@gdsys.cc } 30807d31f8fSmario.six@gdsys.cc 30907d31f8fSmario.six@gdsys.cc By default, each bank is assumed to have 32 GPIOs, but the ngpios 31007d31f8fSmario.six@gdsys.cc setting is honored, so the number of GPIOs for each bank is 31107d31f8fSmario.six@gdsys.cc configurable to match the actual GPIO count of the SoC (e.g. the 31207d31f8fSmario.six@gdsys.cc 32/32/23 banks of the P1022 SoC). 31307d31f8fSmario.six@gdsys.cc 31451781783Smario.six@gdsys.cc Aside from the standard functions of input/output mode, and output 31551781783Smario.six@gdsys.cc value setting, the open-drain feature, which can configure individual 31651781783Smario.six@gdsys.cc GPIOs to work as open-drain outputs, is supported. 31707d31f8fSmario.six@gdsys.cc 31807d31f8fSmario.six@gdsys.cc The driver has been tested on MPC85XX, but it is likely that other 31907d31f8fSmario.six@gdsys.cc PowerQUICC III devices will work as well. 3200b11dbf7SMasahiro Yamadaendmenu 321