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\) 1725cd3b96SHeiko Schocherconfig GPIO_HOG 187e044b9aSHeiko Schocher bool "Enable GPIO hog support" 197e044b9aSHeiko Schocher depends on DM_GPIO 207e044b9aSHeiko Schocher default n 217e044b9aSHeiko Schocher help 227e044b9aSHeiko Schocher Enable gpio hog support 237e044b9aSHeiko Schocher The GPIO chip may contain GPIO hog definitions. GPIO hogging 247e044b9aSHeiko Schocher is a mechanism providing automatic GPIO request and config- 257e044b9aSHeiko Schocher uration as part of the gpio-controller's driver probe function. 267e044b9aSHeiko Schocher 277e0ce50bSJoseph Chenconfig GPIO_NO_UC_FLAG_SEQ_ALIAS 287e0ce50bSJoseph Chen bool "Disable GPIO uclass sequence themselves with aliases" 297e0ce50bSJoseph Chen depends on USING_KERNEL_DTB 307e0ce50bSJoseph Chen default n 317e0ce50bSJoseph Chen help 327e0ce50bSJoseph Chen Disable GPIO uclass sequence, this is a workaround when kernel 337e0ce50bSJoseph Chen dtb feature is enabled. Avoid gpio device probe failed when 347e0ce50bSJoseph Chen alloc req_seq both for gpio devices from U-Boot and kernel dtb. 357e0ce50bSJoseph Chen 3688d5ecf4SThomas Chouconfig ALTERA_PIO 3788d5ecf4SThomas Chou bool "Altera PIO driver" 3888d5ecf4SThomas Chou depends on DM_GPIO 3988d5ecf4SThomas Chou help 4088d5ecf4SThomas Chou Select this to enable PIO for Altera devices. Please find 4188d5ecf4SThomas Chou details on the "Embedded Peripherals IP User Guide" of Altera. 4288d5ecf4SThomas Chou 43e64bdb2fSÁlvaro Fernández Rojasconfig BCM6345_GPIO 44e64bdb2fSÁlvaro Fernández Rojas bool "BCM6345 GPIO driver" 45e64bdb2fSÁlvaro Fernández Rojas depends on DM_GPIO && ARCH_BMIPS 46e64bdb2fSÁlvaro Fernández Rojas help 47e64bdb2fSÁlvaro Fernández Rojas This driver supports the GPIO banks on BCM6345 SoCs. 48e64bdb2fSÁlvaro Fernández Rojas 49e30a70c2SMarek Vasutconfig DWAPB_GPIO 50e30a70c2SMarek Vasut bool "DWAPB GPIO driver" 51e30a70c2SMarek Vasut depends on DM && DM_GPIO 52e30a70c2SMarek Vasut default n 53e30a70c2SMarek Vasut help 54e30a70c2SMarek Vasut Support for the Designware APB GPIO driver. 55e30a70c2SMarek Vasut 565a07a5f9SWenyou Yangconfig AT91_GPIO 575a07a5f9SWenyou Yang bool "AT91 PIO GPIO driver" 585a07a5f9SWenyou Yang depends on DM_GPIO 595a07a5f9SWenyou Yang default n 605a07a5f9SWenyou Yang help 615a07a5f9SWenyou Yang Say yes here to select AT91 PIO GPIO driver. AT91 PIO 625a07a5f9SWenyou Yang controller manages up to 32 fully programmable input/output 635a07a5f9SWenyou Yang lines. Each I/O line may be dedicated as a general-purpose 645a07a5f9SWenyou Yang I/O or be assigned to a function of an embedded peripheral. 655a07a5f9SWenyou Yang The assignment to a function of an embedded peripheral is 665a07a5f9SWenyou Yang the responsibility of AT91 Pinctrl driver. This driver is 675a07a5f9SWenyou Yang responsible for the general-purpose I/O. 685a07a5f9SWenyou Yang 692c62c56aSWenyou Yangconfig ATMEL_PIO4 702c62c56aSWenyou Yang bool "ATMEL PIO4 driver" 71ee3311dbSWenyou Yang depends on DM_GPIO 722c62c56aSWenyou Yang default n 732c62c56aSWenyou Yang help 742c62c56aSWenyou Yang Say yes here to support the Atmel PIO4 driver. 752c62c56aSWenyou Yang The PIO4 is new version of Atmel PIO controller, which manages 762c62c56aSWenyou Yang up to 128 fully programmable input/output lines. Each I/O line 772c62c56aSWenyou Yang may be dedicated as a general purpose I/O or be assigned to 782c62c56aSWenyou Yang a function of an embedded peripheral. 792c62c56aSWenyou Yang 8064b17977SSimon Glassconfig INTEL_BROADWELL_GPIO 8164b17977SSimon Glass bool "Intel Broadwell GPIO driver" 8264b17977SSimon Glass depends on DM 8364b17977SSimon Glass help 8464b17977SSimon Glass This driver supports Broadwell U devices which have an expanded 8564b17977SSimon Glass GPIO feature set. The difference is large enough to merit a separate 8664b17977SSimon Glass driver from the common Intel ICH6 driver. It supports a total of 8764b17977SSimon Glass 95 GPIOs which can be configured from the device tree. 8864b17977SSimon Glass 8972436892SBin Mengconfig INTEL_ICH6_GPIO 9072436892SBin Meng bool "Intel ICH6 compatible legacy GPIO driver" 9172436892SBin Meng depends on DM_GPIO 9272436892SBin Meng help 9372436892SBin Meng Say yes here to select Intel ICH6 compatible legacy GPIO driver. 9472436892SBin Meng 95d665eb61SPeng Fanconfig IMX_RGPIO2P 96d665eb61SPeng Fan bool "i.MX7ULP RGPIO2P driver" 97d665eb61SPeng Fan depends on DM 98d665eb61SPeng Fan default n 99d665eb61SPeng Fan help 100d665eb61SPeng Fan This driver supports i.MX7ULP Rapid GPIO2P controller. 101d665eb61SPeng Fan 102606f7047SAlbert ARIBAUD \(3ADEV\)config LPC32XX_GPIO 103606f7047SAlbert ARIBAUD \(3ADEV\) bool "LPC32XX GPIO driver" 104606f7047SAlbert ARIBAUD \(3ADEV\) depends on DM 105606f7047SAlbert ARIBAUD \(3ADEV\) default n 106606f7047SAlbert ARIBAUD \(3ADEV\) help 107606f7047SAlbert ARIBAUD \(3ADEV\) Support for the LPC32XX GPIO driver. 108d79c50afSSimon Glass 10981a87e18SMateusz Kulikowskiconfig MSM_GPIO 11081a87e18SMateusz Kulikowski bool "Qualcomm GPIO driver" 11181a87e18SMateusz Kulikowski depends on DM_GPIO 11281a87e18SMateusz Kulikowski default n 11381a87e18SMateusz Kulikowski help 11481a87e18SMateusz Kulikowski Support GPIO controllers on Qualcomm Snapdragon family of SoCs. 11581a87e18SMateusz Kulikowski This controller have single bank (default name "soc"), every 11681a87e18SMateusz Kulikowski gpio has it's own set of registers. 11781a87e18SMateusz Kulikowski Only simple GPIO operations are supported (get/set, change of 11881a87e18SMateusz Kulikowski direction and checking pin function). 11981a87e18SMateusz Kulikowski Supported devices: 12081a87e18SMateusz Kulikowski - APQ8016 12181a87e18SMateusz Kulikowski - MSM8916 12281a87e18SMateusz Kulikowski 12329cb2b3bSTom Riniconfig OMAP_GPIO 12429cb2b3bSTom Rini bool "TI OMAP GPIO driver" 12529cb2b3bSTom Rini depends on ARCH_OMAP2PLUS 12629cb2b3bSTom Rini default y 12729cb2b3bSTom Rini help 12829cb2b3bSTom Rini Support GPIO controllers on the TI OMAP3/4/5 and related (such as 12929cb2b3bSTom Rini AM335x/AM43xx/AM57xx/DRA7xx/etc) families of SoCs. 13029cb2b3bSTom Rini 1310091362cSSimon Glassconfig CMD_PCA953X 1320091362cSSimon Glass bool "Enable the pca953x command" 1330091362cSSimon Glass help 1340091362cSSimon Glass Deprecated: This should be converted to driver model. 1350091362cSSimon Glass 1360091362cSSimon Glass This command provides access to a pca953x GPIO device using the 1370091362cSSimon Glass legacy GPIO interface. Several subcommands are provided which mirror 1380091362cSSimon Glass the standard 'gpio' command. It should use that instead. 1390091362cSSimon Glass 140120800dfSMateusz Kulikowskiconfig PM8916_GPIO 141120800dfSMateusz Kulikowski bool "Qualcomm PM8916 PMIC GPIO/keypad driver" 142120800dfSMateusz Kulikowski depends on DM_GPIO && PMIC_PM8916 143120800dfSMateusz Kulikowski help 144120800dfSMateusz Kulikowski Support for GPIO pins and power/reset buttons found on 145120800dfSMateusz Kulikowski Qualcomm PM8916 PMIC. 146120800dfSMateusz Kulikowski Default name for GPIO bank is "pm8916". 147120800dfSMateusz Kulikowski Power and reset buttons are placed in "pm8916_key" bank and 148120800dfSMateusz Kulikowski have gpio numbers 0 and 1 respectively. 149120800dfSMateusz Kulikowski 1505746b0dfSVignesh Rconfig PCF8575_GPIO 1515746b0dfSVignesh R bool "PCF8575 I2C GPIO Expander driver" 1525746b0dfSVignesh R depends on DM_GPIO && DM_I2C 1535746b0dfSVignesh R help 1545746b0dfSVignesh R Support for PCF8575 I2C 16-bit GPIO expander. Most of these 1555746b0dfSVignesh R chips are from NXP and TI. 1565746b0dfSVignesh R 1571f8f7730SSimon Glassconfig ROCKCHIP_GPIO 1581f8f7730SSimon Glass bool "Rockchip GPIO driver" 1591f8f7730SSimon Glass depends on DM_GPIO 1601f8f7730SSimon Glass help 1611f8f7730SSimon Glass Support GPIO access on Rockchip SoCs. The GPIOs are arranged into 1621f8f7730SSimon Glass a number of banks (different for each SoC type) each with 32 GPIOs. 1631f8f7730SSimon Glass The GPIOs for a device are defined in the device tree with one node 1641f8f7730SSimon Glass for each bank. 1651f8f7730SSimon Glass 166d1aef94bSJianqun Xuconfig ROCKCHIP_GPIO_V2 167d1aef94bSJianqun Xu bool "Rockchip GPIO driver version 2.0" 168d1aef94bSJianqun Xu depends on ROCKCHIP_GPIO 169d1aef94bSJianqun Xu default n 170d1aef94bSJianqun Xu help 171d1aef94bSJianqun Xu Support GPIO access on Rockchip SoCs. The GPIOs are arranged into 172d1aef94bSJianqun Xu a number of banks (different for each SoC type) each with 32 GPIOs. 173d1aef94bSJianqun Xu The GPIOs for a device are defined in the device tree with one node 174d1aef94bSJianqun Xu for each bank. 175d1aef94bSJianqun Xu 176d1aef94bSJianqun Xu Support version 2.0 GPIO controller, which support write enable bits 177d1aef94bSJianqun Xu for some registers, such as dr, ddr. 178d1aef94bSJianqun Xu 179d79c50afSSimon Glassconfig SANDBOX_GPIO 180d79c50afSSimon Glass bool "Enable sandbox GPIO driver" 181d79c50afSSimon Glass depends on SANDBOX && DM && DM_GPIO 182d79c50afSSimon Glass help 183d79c50afSSimon Glass This driver supports some simulated GPIOs which can be adjusted 184d79c50afSSimon Glass using 'back door' functions like sandbox_gpio_set_value(). Then the 185d79c50afSSimon Glass GPIOs can be inspected through the normal get_get_value() 186d79c50afSSimon Glass interface. The purpose of this is to allow GPIOs to be used as 187d79c50afSSimon Glass normal in sandbox, perhaps with test code actually driving the 188d79c50afSSimon Glass behaviour of those GPIOs. 189d79c50afSSimon Glass 190d79c50afSSimon Glassconfig SANDBOX_GPIO_COUNT 191d79c50afSSimon Glass int "Number of sandbox GPIOs" 192d79c50afSSimon Glass depends on SANDBOX_GPIO 193d79c50afSSimon Glass default 128 194d79c50afSSimon Glass help 195d79c50afSSimon Glass The sandbox driver can support any number of GPIOs. Generally these 196d79c50afSSimon Glass are specified using the device tree. But you can also have a number 197d79c50afSSimon Glass of 'anonymous' GPIOs that do not belong to any device or bank. 198d79c50afSSimon Glass Select a suitable value depending on your needs. 199d348a943SBhuvanchandra DV 20090d99e59SSimon Glassconfig CMD_TCA642X 20190d99e59SSimon Glass bool "tca642x - Command to access tca642x state" 20290d99e59SSimon Glass help 20390d99e59SSimon Glass DEPRECATED - This needs conversion to driver model 20490d99e59SSimon Glass 20590d99e59SSimon Glass This provides a way to looking at the pin state of this device. 20690d99e59SSimon Glass This mirrors the 'gpio' command and that should be used in preference 20790d99e59SSimon Glass to custom code. 20890d99e59SSimon Glass 209601800beSStephen Warrenconfig TEGRA_GPIO 210601800beSStephen Warren bool "Tegra20..210 GPIO driver" 211601800beSStephen Warren depends on DM_GPIO 212601800beSStephen Warren help 213601800beSStephen Warren Support for the GPIO controller contained in NVIDIA Tegra20 through 214601800beSStephen Warren Tegra210. 215601800beSStephen Warren 216074a1fddSStephen Warrenconfig TEGRA186_GPIO 217074a1fddSStephen Warren bool "Tegra186 GPIO driver" 218074a1fddSStephen Warren depends on DM_GPIO 219074a1fddSStephen Warren help 220074a1fddSStephen Warren Support for the GPIO controller contained in NVIDIA Tegra186. This 221074a1fddSStephen Warren covers both the "main" and "AON" controller instances, even though 222074a1fddSStephen Warren they have slightly different register layout. 223074a1fddSStephen Warren 224b9a66b63SMasahiro Yamadaconfig GPIO_UNIPHIER 225b9a66b63SMasahiro Yamada bool "UniPhier GPIO" 226b9a66b63SMasahiro Yamada depends on ARCH_UNIPHIER 227b9a66b63SMasahiro Yamada help 228b9a66b63SMasahiro Yamada Say yes here to support UniPhier GPIOs. 229b9a66b63SMasahiro Yamada 230d348a943SBhuvanchandra DVconfig VYBRID_GPIO 231d348a943SBhuvanchandra DV bool "Vybrid GPIO driver" 232d348a943SBhuvanchandra DV depends on DM 233d348a943SBhuvanchandra DV default n 234d348a943SBhuvanchandra DV help 235d348a943SBhuvanchandra DV Say yes here to support Vybrid vf610 GPIOs. 2360b11dbf7SMasahiro Yamada 237386d934eSPurna Chandra Mandalconfig PIC32_GPIO 238386d934eSPurna Chandra Mandal bool "Microchip PIC32 GPIO driver" 239386d934eSPurna Chandra Mandal depends on DM_GPIO && MACH_PIC32 240386d934eSPurna Chandra Mandal default y 241386d934eSPurna Chandra Mandal help 242386d934eSPurna Chandra Mandal Say yes here to support Microchip PIC32 GPIOs. 243386d934eSPurna Chandra Mandal 24477417102SVikas Manochaconfig STM32F7_GPIO 24577417102SVikas Manocha bool "ST STM32 GPIO driver" 24677417102SVikas Manocha depends on DM_GPIO && STM32 24777417102SVikas Manocha default y 24877417102SVikas Manocha help 24977417102SVikas Manocha Device model driver support for STM32 GPIO controller. It should be 25077417102SVikas Manocha usable on many stm32 families like stm32f4 & stm32H7. 25177417102SVikas Manocha Tested on STM32F7. 25277417102SVikas Manocha 253704d9a64SStefan Roeseconfig MVEBU_GPIO 254704d9a64SStefan Roese bool "Marvell MVEBU GPIO driver" 255704d9a64SStefan Roese depends on DM_GPIO && ARCH_MVEBU 256704d9a64SStefan Roese default y 257704d9a64SStefan Roese help 258704d9a64SStefan Roese Say yes here to support Marvell MVEBU (Armada XP/38x) GPIOs. 259704d9a64SStefan Roese 2602978ae23SSiva Durga Prasad Paladuguconfig ZYNQ_GPIO 2612978ae23SSiva Durga Prasad Paladugu bool "Zynq GPIO driver" 262251ab06dSSiva Durga Prasad Paladugu depends on DM_GPIO && (ARCH_ZYNQ || ARCH_ZYNQMP) 2632978ae23SSiva Durga Prasad Paladugu default y 2642978ae23SSiva Durga Prasad Paladugu help 2652978ae23SSiva Durga Prasad Paladugu Supports GPIO access on Zynq SoC. 2662978ae23SSiva Durga Prasad Paladugu 2679300f711SPeng Fanconfig DM_74X164 2689300f711SPeng Fan bool "74x164 serial-in/parallel-out 8-bits shift register" 2699300f711SPeng Fan depends on DM_GPIO 2709300f711SPeng Fan help 2719300f711SPeng Fan Driver for 74x164 compatible serial-in/parallel-out 8-outputs 2729300f711SPeng Fan shift registers, such as 74lv165, 74hc595. 2739300f711SPeng Fan This driver can be used to provide access to more gpio outputs. 2749300f711SPeng Fan 27503773439SPeng Fanconfig DM_PCA953X 27603773439SPeng Fan bool "PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports" 27703773439SPeng Fan depends on DM_GPIO 27803773439SPeng Fan help 27903773439SPeng Fan Say yes here to provide access to several register-oriented 28003773439SPeng Fan SMBus I/O expanders, made mostly by NXP or TI. Compatible 28103773439SPeng Fan models include: 28203773439SPeng Fan 28303773439SPeng Fan 4 bits: pca9536, pca9537 28403773439SPeng Fan 28503773439SPeng Fan 8 bits: max7310, max7315, pca6107, pca9534, pca9538, pca9554, 28603773439SPeng Fan pca9556, pca9557, pca9574, tca6408, xra1202 28703773439SPeng Fan 28803773439SPeng Fan 16 bits: max7312, max7313, pca9535, pca9539, pca9555, pca9575, 28903773439SPeng Fan tca6416 29003773439SPeng Fan 29103773439SPeng Fan 24 bits: tca6424 29203773439SPeng Fan 29303773439SPeng Fan 40 bits: pca9505, pca9698 29403773439SPeng Fan 29503773439SPeng Fan Now, max 24 bits chips and PCA953X compatible chips are 29603773439SPeng Fan supported 29707d31f8fSmario.six@gdsys.cc 29807d31f8fSmario.six@gdsys.ccconfig MPC85XX_GPIO 29907d31f8fSmario.six@gdsys.cc bool "Freescale MPC85XX GPIO driver" 30007d31f8fSmario.six@gdsys.cc depends on DM_GPIO 30107d31f8fSmario.six@gdsys.cc help 30207d31f8fSmario.six@gdsys.cc This driver supports the built-in GPIO controller of MPC85XX CPUs. 30307d31f8fSmario.six@gdsys.cc Each GPIO bank is identified by its own entry in the device tree, 30407d31f8fSmario.six@gdsys.cc i.e. 30507d31f8fSmario.six@gdsys.cc 30607d31f8fSmario.six@gdsys.cc gpio-controller@fc00 { 30707d31f8fSmario.six@gdsys.cc #gpio-cells = <2>; 30807d31f8fSmario.six@gdsys.cc compatible = "fsl,pq3-gpio"; 30907d31f8fSmario.six@gdsys.cc reg = <0xfc00 0x100> 31007d31f8fSmario.six@gdsys.cc } 31107d31f8fSmario.six@gdsys.cc 31207d31f8fSmario.six@gdsys.cc By default, each bank is assumed to have 32 GPIOs, but the ngpios 31307d31f8fSmario.six@gdsys.cc setting is honored, so the number of GPIOs for each bank is 31407d31f8fSmario.six@gdsys.cc configurable to match the actual GPIO count of the SoC (e.g. the 31507d31f8fSmario.six@gdsys.cc 32/32/23 banks of the P1022 SoC). 31607d31f8fSmario.six@gdsys.cc 31751781783Smario.six@gdsys.cc Aside from the standard functions of input/output mode, and output 31851781783Smario.six@gdsys.cc value setting, the open-drain feature, which can configure individual 31951781783Smario.six@gdsys.cc GPIOs to work as open-drain outputs, is supported. 32007d31f8fSmario.six@gdsys.cc 32107d31f8fSmario.six@gdsys.cc The driver has been tested on MPC85XX, but it is likely that other 32207d31f8fSmario.six@gdsys.cc PowerQUICC III devices will work as well. 323*05c43c85SCody Xie 324*05c43c85SCody Xieconfig NCA9539_GPIO 325*05c43c85SCody Xie bool "NCA9539 GPIO port expander driver" 326*05c43c85SCody Xie depends on DM_GPIO 327*05c43c85SCody Xie default n 328*05c43c85SCody Xie help 329*05c43c85SCody Xie Device model driver support for NCA9539 GPIO expander. It should be 330*05c43c85SCody Xie usable on many NCA9539 families like NCA9539 & NCA9535. 331*05c43c85SCody Xie Tested on NCA9539. 3320b11dbf7SMasahiro Yamadaendmenu 333