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\) 1788d5ecf4SThomas Chouconfig ALTERA_PIO 1888d5ecf4SThomas Chou bool "Altera PIO driver" 1988d5ecf4SThomas Chou depends on DM_GPIO 2088d5ecf4SThomas Chou help 2188d5ecf4SThomas Chou Select this to enable PIO for Altera devices. Please find 2288d5ecf4SThomas Chou details on the "Embedded Peripherals IP User Guide" of Altera. 2388d5ecf4SThomas Chou 24e64bdb2fSÁlvaro Fernández Rojasconfig BCM6345_GPIO 25e64bdb2fSÁlvaro Fernández Rojas bool "BCM6345 GPIO driver" 26e64bdb2fSÁlvaro Fernández Rojas depends on DM_GPIO && ARCH_BMIPS 27e64bdb2fSÁlvaro Fernández Rojas help 28e64bdb2fSÁlvaro Fernández Rojas This driver supports the GPIO banks on BCM6345 SoCs. 29e64bdb2fSÁlvaro Fernández Rojas 30e30a70c2SMarek Vasutconfig DWAPB_GPIO 31e30a70c2SMarek Vasut bool "DWAPB GPIO driver" 32e30a70c2SMarek Vasut depends on DM && DM_GPIO 33e30a70c2SMarek Vasut default n 34e30a70c2SMarek Vasut help 35e30a70c2SMarek Vasut Support for the Designware APB GPIO driver. 36e30a70c2SMarek Vasut 375a07a5f9SWenyou Yangconfig AT91_GPIO 385a07a5f9SWenyou Yang bool "AT91 PIO GPIO driver" 395a07a5f9SWenyou Yang depends on DM_GPIO 405a07a5f9SWenyou Yang default n 415a07a5f9SWenyou Yang help 425a07a5f9SWenyou Yang Say yes here to select AT91 PIO GPIO driver. AT91 PIO 435a07a5f9SWenyou Yang controller manages up to 32 fully programmable input/output 445a07a5f9SWenyou Yang lines. Each I/O line may be dedicated as a general-purpose 455a07a5f9SWenyou Yang I/O or be assigned to a function of an embedded peripheral. 465a07a5f9SWenyou Yang The assignment to a function of an embedded peripheral is 475a07a5f9SWenyou Yang the responsibility of AT91 Pinctrl driver. This driver is 485a07a5f9SWenyou Yang responsible for the general-purpose I/O. 495a07a5f9SWenyou Yang 502c62c56aSWenyou Yangconfig ATMEL_PIO4 512c62c56aSWenyou Yang bool "ATMEL PIO4 driver" 52ee3311dbSWenyou Yang depends on DM_GPIO 532c62c56aSWenyou Yang default n 542c62c56aSWenyou Yang help 552c62c56aSWenyou Yang Say yes here to support the Atmel PIO4 driver. 562c62c56aSWenyou Yang The PIO4 is new version of Atmel PIO controller, which manages 572c62c56aSWenyou Yang up to 128 fully programmable input/output lines. Each I/O line 582c62c56aSWenyou Yang may be dedicated as a general purpose I/O or be assigned to 592c62c56aSWenyou Yang a function of an embedded peripheral. 602c62c56aSWenyou Yang 6164b17977SSimon Glassconfig INTEL_BROADWELL_GPIO 6264b17977SSimon Glass bool "Intel Broadwell GPIO driver" 6364b17977SSimon Glass depends on DM 6464b17977SSimon Glass help 6564b17977SSimon Glass This driver supports Broadwell U devices which have an expanded 6664b17977SSimon Glass GPIO feature set. The difference is large enough to merit a separate 6764b17977SSimon Glass driver from the common Intel ICH6 driver. It supports a total of 6864b17977SSimon Glass 95 GPIOs which can be configured from the device tree. 6964b17977SSimon Glass 7072436892SBin Mengconfig INTEL_ICH6_GPIO 7172436892SBin Meng bool "Intel ICH6 compatible legacy GPIO driver" 7272436892SBin Meng depends on DM_GPIO 7372436892SBin Meng help 7472436892SBin Meng Say yes here to select Intel ICH6 compatible legacy GPIO driver. 7572436892SBin Meng 76d665eb61SPeng Fanconfig IMX_RGPIO2P 77d665eb61SPeng Fan bool "i.MX7ULP RGPIO2P driver" 78d665eb61SPeng Fan depends on DM 79d665eb61SPeng Fan default n 80d665eb61SPeng Fan help 81d665eb61SPeng Fan This driver supports i.MX7ULP Rapid GPIO2P controller. 82d665eb61SPeng Fan 833194c3cdSEugeniy Paltsevconfig HSDK_CREG_GPIO 843194c3cdSEugeniy Paltsev bool "HSDK CREG GPIO griver" 85*d5fbcd57SAlexey Brodkin depends on DM_GPIO 863194c3cdSEugeniy Paltsev default n 873194c3cdSEugeniy Paltsev help 883194c3cdSEugeniy Paltsev This driver supports CREG GPIOs on Synopsys HSDK SOC. 893194c3cdSEugeniy Paltsev 90606f7047SAlbert ARIBAUD \(3ADEV\)config LPC32XX_GPIO 91606f7047SAlbert ARIBAUD \(3ADEV\) bool "LPC32XX GPIO driver" 92606f7047SAlbert ARIBAUD \(3ADEV\) depends on DM 93606f7047SAlbert ARIBAUD \(3ADEV\) default n 94606f7047SAlbert ARIBAUD \(3ADEV\) help 95606f7047SAlbert ARIBAUD \(3ADEV\) Support for the LPC32XX GPIO driver. 96d79c50afSSimon Glass 9781a87e18SMateusz Kulikowskiconfig MSM_GPIO 9881a87e18SMateusz Kulikowski bool "Qualcomm GPIO driver" 9981a87e18SMateusz Kulikowski depends on DM_GPIO 10081a87e18SMateusz Kulikowski default n 10181a87e18SMateusz Kulikowski help 10281a87e18SMateusz Kulikowski Support GPIO controllers on Qualcomm Snapdragon family of SoCs. 10381a87e18SMateusz Kulikowski This controller have single bank (default name "soc"), every 10481a87e18SMateusz Kulikowski gpio has it's own set of registers. 10581a87e18SMateusz Kulikowski Only simple GPIO operations are supported (get/set, change of 10681a87e18SMateusz Kulikowski direction and checking pin function). 10781a87e18SMateusz Kulikowski Supported devices: 10881a87e18SMateusz Kulikowski - APQ8016 10981a87e18SMateusz Kulikowski - MSM8916 11081a87e18SMateusz Kulikowski 11129cb2b3bSTom Riniconfig OMAP_GPIO 11229cb2b3bSTom Rini bool "TI OMAP GPIO driver" 11329cb2b3bSTom Rini depends on ARCH_OMAP2PLUS 11429cb2b3bSTom Rini default y 11529cb2b3bSTom Rini help 11629cb2b3bSTom Rini Support GPIO controllers on the TI OMAP3/4/5 and related (such as 11729cb2b3bSTom Rini AM335x/AM43xx/AM57xx/DRA7xx/etc) families of SoCs. 11829cb2b3bSTom Rini 1190091362cSSimon Glassconfig CMD_PCA953X 1200091362cSSimon Glass bool "Enable the pca953x command" 1210091362cSSimon Glass help 1220091362cSSimon Glass Deprecated: This should be converted to driver model. 1230091362cSSimon Glass 1240091362cSSimon Glass This command provides access to a pca953x GPIO device using the 1250091362cSSimon Glass legacy GPIO interface. Several subcommands are provided which mirror 1260091362cSSimon Glass the standard 'gpio' command. It should use that instead. 1270091362cSSimon Glass 128120800dfSMateusz Kulikowskiconfig PM8916_GPIO 129120800dfSMateusz Kulikowski bool "Qualcomm PM8916 PMIC GPIO/keypad driver" 130120800dfSMateusz Kulikowski depends on DM_GPIO && PMIC_PM8916 131120800dfSMateusz Kulikowski help 132120800dfSMateusz Kulikowski Support for GPIO pins and power/reset buttons found on 133120800dfSMateusz Kulikowski Qualcomm PM8916 PMIC. 134120800dfSMateusz Kulikowski Default name for GPIO bank is "pm8916". 135120800dfSMateusz Kulikowski Power and reset buttons are placed in "pm8916_key" bank and 136120800dfSMateusz Kulikowski have gpio numbers 0 and 1 respectively. 137120800dfSMateusz Kulikowski 1385746b0dfSVignesh Rconfig PCF8575_GPIO 1395746b0dfSVignesh R bool "PCF8575 I2C GPIO Expander driver" 1405746b0dfSVignesh R depends on DM_GPIO && DM_I2C 1415746b0dfSVignesh R help 1425746b0dfSVignesh R Support for PCF8575 I2C 16-bit GPIO expander. Most of these 1435746b0dfSVignesh R chips are from NXP and TI. 1445746b0dfSVignesh R 145f5f69594SMarek Vasutconfig RCAR_GPIO 146f5f69594SMarek Vasut bool "Renesas RCar GPIO driver" 147f5f69594SMarek Vasut depends on DM_GPIO && ARCH_RMOBILE 148f5f69594SMarek Vasut help 149f5f69594SMarek Vasut This driver supports the GPIO banks on Renesas RCar SoCs. 150f5f69594SMarek Vasut 1511f8f7730SSimon Glassconfig ROCKCHIP_GPIO 1521f8f7730SSimon Glass bool "Rockchip GPIO driver" 1531f8f7730SSimon Glass depends on DM_GPIO 1541f8f7730SSimon Glass help 1551f8f7730SSimon Glass Support GPIO access on Rockchip SoCs. The GPIOs are arranged into 1561f8f7730SSimon Glass a number of banks (different for each SoC type) each with 32 GPIOs. 1571f8f7730SSimon Glass The GPIOs for a device are defined in the device tree with one node 1581f8f7730SSimon Glass for each bank. 1591f8f7730SSimon Glass 160d79c50afSSimon Glassconfig SANDBOX_GPIO 161d79c50afSSimon Glass bool "Enable sandbox GPIO driver" 162d79c50afSSimon Glass depends on SANDBOX && DM && DM_GPIO 163d79c50afSSimon Glass help 164d79c50afSSimon Glass This driver supports some simulated GPIOs which can be adjusted 165d79c50afSSimon Glass using 'back door' functions like sandbox_gpio_set_value(). Then the 166d79c50afSSimon Glass GPIOs can be inspected through the normal get_get_value() 167d79c50afSSimon Glass interface. The purpose of this is to allow GPIOs to be used as 168d79c50afSSimon Glass normal in sandbox, perhaps with test code actually driving the 169d79c50afSSimon Glass behaviour of those GPIOs. 170d79c50afSSimon Glass 171d79c50afSSimon Glassconfig SANDBOX_GPIO_COUNT 172d79c50afSSimon Glass int "Number of sandbox GPIOs" 173d79c50afSSimon Glass depends on SANDBOX_GPIO 174d79c50afSSimon Glass default 128 175d79c50afSSimon Glass help 176d79c50afSSimon Glass The sandbox driver can support any number of GPIOs. Generally these 177d79c50afSSimon Glass are specified using the device tree. But you can also have a number 178d79c50afSSimon Glass of 'anonymous' GPIOs that do not belong to any device or bank. 179d79c50afSSimon Glass Select a suitable value depending on your needs. 180d348a943SBhuvanchandra DV 18190d99e59SSimon Glassconfig CMD_TCA642X 18290d99e59SSimon Glass bool "tca642x - Command to access tca642x state" 18390d99e59SSimon Glass help 18490d99e59SSimon Glass DEPRECATED - This needs conversion to driver model 18590d99e59SSimon Glass 18690d99e59SSimon Glass This provides a way to looking at the pin state of this device. 18790d99e59SSimon Glass This mirrors the 'gpio' command and that should be used in preference 18890d99e59SSimon Glass to custom code. 18990d99e59SSimon Glass 190601800beSStephen Warrenconfig TEGRA_GPIO 191601800beSStephen Warren bool "Tegra20..210 GPIO driver" 192601800beSStephen Warren depends on DM_GPIO 193601800beSStephen Warren help 194601800beSStephen Warren Support for the GPIO controller contained in NVIDIA Tegra20 through 195601800beSStephen Warren Tegra210. 196601800beSStephen Warren 197074a1fddSStephen Warrenconfig TEGRA186_GPIO 198074a1fddSStephen Warren bool "Tegra186 GPIO driver" 199074a1fddSStephen Warren depends on DM_GPIO 200074a1fddSStephen Warren help 201074a1fddSStephen Warren Support for the GPIO controller contained in NVIDIA Tegra186. This 202074a1fddSStephen Warren covers both the "main" and "AON" controller instances, even though 203074a1fddSStephen Warren they have slightly different register layout. 204074a1fddSStephen Warren 205b9a66b63SMasahiro Yamadaconfig GPIO_UNIPHIER 206b9a66b63SMasahiro Yamada bool "UniPhier GPIO" 207b9a66b63SMasahiro Yamada depends on ARCH_UNIPHIER 208b9a66b63SMasahiro Yamada help 209b9a66b63SMasahiro Yamada Say yes here to support UniPhier GPIOs. 210b9a66b63SMasahiro Yamada 211d348a943SBhuvanchandra DVconfig VYBRID_GPIO 212d348a943SBhuvanchandra DV bool "Vybrid GPIO driver" 213d348a943SBhuvanchandra DV depends on DM 214d348a943SBhuvanchandra DV default n 215d348a943SBhuvanchandra DV help 216d348a943SBhuvanchandra DV Say yes here to support Vybrid vf610 GPIOs. 2170b11dbf7SMasahiro Yamada 218386d934eSPurna Chandra Mandalconfig PIC32_GPIO 219386d934eSPurna Chandra Mandal bool "Microchip PIC32 GPIO driver" 220386d934eSPurna Chandra Mandal depends on DM_GPIO && MACH_PIC32 221386d934eSPurna Chandra Mandal default y 222386d934eSPurna Chandra Mandal help 223386d934eSPurna Chandra Mandal Say yes here to support Microchip PIC32 GPIOs. 224386d934eSPurna Chandra Mandal 22577417102SVikas Manochaconfig STM32F7_GPIO 22677417102SVikas Manocha bool "ST STM32 GPIO driver" 22777417102SVikas Manocha depends on DM_GPIO && STM32 22877417102SVikas Manocha default y 22977417102SVikas Manocha help 23077417102SVikas Manocha Device model driver support for STM32 GPIO controller. It should be 23177417102SVikas Manocha usable on many stm32 families like stm32f4 & stm32H7. 23277417102SVikas Manocha Tested on STM32F7. 23377417102SVikas Manocha 234704d9a64SStefan Roeseconfig MVEBU_GPIO 235704d9a64SStefan Roese bool "Marvell MVEBU GPIO driver" 236704d9a64SStefan Roese depends on DM_GPIO && ARCH_MVEBU 237704d9a64SStefan Roese default y 238704d9a64SStefan Roese help 239704d9a64SStefan Roese Say yes here to support Marvell MVEBU (Armada XP/38x) GPIOs. 240704d9a64SStefan Roese 2412978ae23SSiva Durga Prasad Paladuguconfig ZYNQ_GPIO 2422978ae23SSiva Durga Prasad Paladugu bool "Zynq GPIO driver" 243251ab06dSSiva Durga Prasad Paladugu depends on DM_GPIO && (ARCH_ZYNQ || ARCH_ZYNQMP) 2442978ae23SSiva Durga Prasad Paladugu default y 2452978ae23SSiva Durga Prasad Paladugu help 2462978ae23SSiva Durga Prasad Paladugu Supports GPIO access on Zynq SoC. 2472978ae23SSiva Durga Prasad Paladugu 2489300f711SPeng Fanconfig DM_74X164 2499300f711SPeng Fan bool "74x164 serial-in/parallel-out 8-bits shift register" 2509300f711SPeng Fan depends on DM_GPIO 2519300f711SPeng Fan help 2529300f711SPeng Fan Driver for 74x164 compatible serial-in/parallel-out 8-outputs 2539300f711SPeng Fan shift registers, such as 74lv165, 74hc595. 2549300f711SPeng Fan This driver can be used to provide access to more gpio outputs. 2559300f711SPeng Fan 25603773439SPeng Fanconfig DM_PCA953X 25703773439SPeng Fan bool "PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports" 25803773439SPeng Fan depends on DM_GPIO 25903773439SPeng Fan help 26003773439SPeng Fan Say yes here to provide access to several register-oriented 26103773439SPeng Fan SMBus I/O expanders, made mostly by NXP or TI. Compatible 26203773439SPeng Fan models include: 26303773439SPeng Fan 26403773439SPeng Fan 4 bits: pca9536, pca9537 26503773439SPeng Fan 26603773439SPeng Fan 8 bits: max7310, max7315, pca6107, pca9534, pca9538, pca9554, 26703773439SPeng Fan pca9556, pca9557, pca9574, tca6408, xra1202 26803773439SPeng Fan 26903773439SPeng Fan 16 bits: max7312, max7313, pca9535, pca9539, pca9555, pca9575, 27003773439SPeng Fan tca6416 27103773439SPeng Fan 27203773439SPeng Fan 24 bits: tca6424 27303773439SPeng Fan 27403773439SPeng Fan 40 bits: pca9505, pca9698 27503773439SPeng Fan 27603773439SPeng Fan Now, max 24 bits chips and PCA953X compatible chips are 27703773439SPeng Fan supported 27807d31f8fSmario.six@gdsys.cc 27907d31f8fSmario.six@gdsys.ccconfig MPC85XX_GPIO 28007d31f8fSmario.six@gdsys.cc bool "Freescale MPC85XX GPIO driver" 28107d31f8fSmario.six@gdsys.cc depends on DM_GPIO 28207d31f8fSmario.six@gdsys.cc help 28307d31f8fSmario.six@gdsys.cc This driver supports the built-in GPIO controller of MPC85XX CPUs. 28407d31f8fSmario.six@gdsys.cc Each GPIO bank is identified by its own entry in the device tree, 28507d31f8fSmario.six@gdsys.cc i.e. 28607d31f8fSmario.six@gdsys.cc 28707d31f8fSmario.six@gdsys.cc gpio-controller@fc00 { 28807d31f8fSmario.six@gdsys.cc #gpio-cells = <2>; 28907d31f8fSmario.six@gdsys.cc compatible = "fsl,pq3-gpio"; 29007d31f8fSmario.six@gdsys.cc reg = <0xfc00 0x100> 29107d31f8fSmario.six@gdsys.cc } 29207d31f8fSmario.six@gdsys.cc 29307d31f8fSmario.six@gdsys.cc By default, each bank is assumed to have 32 GPIOs, but the ngpios 29407d31f8fSmario.six@gdsys.cc setting is honored, so the number of GPIOs for each bank is 29507d31f8fSmario.six@gdsys.cc configurable to match the actual GPIO count of the SoC (e.g. the 29607d31f8fSmario.six@gdsys.cc 32/32/23 banks of the P1022 SoC). 29707d31f8fSmario.six@gdsys.cc 29851781783Smario.six@gdsys.cc Aside from the standard functions of input/output mode, and output 29951781783Smario.six@gdsys.cc value setting, the open-drain feature, which can configure individual 30051781783Smario.six@gdsys.cc GPIOs to work as open-drain outputs, is supported. 30107d31f8fSmario.six@gdsys.cc 30207d31f8fSmario.six@gdsys.cc The driver has been tested on MPC85XX, but it is likely that other 30307d31f8fSmario.six@gdsys.cc PowerQUICC III devices will work as well. 3040b11dbf7SMasahiro Yamadaendmenu 305