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 24e30a70c2SMarek Vasutconfig DWAPB_GPIO 25e30a70c2SMarek Vasut bool "DWAPB GPIO driver" 26e30a70c2SMarek Vasut depends on DM && DM_GPIO 27e30a70c2SMarek Vasut default n 28e30a70c2SMarek Vasut help 29e30a70c2SMarek Vasut Support for the Designware APB GPIO driver. 30e30a70c2SMarek Vasut 312c62c56aSWenyou Yangconfig ATMEL_PIO4 322c62c56aSWenyou Yang bool "ATMEL PIO4 driver" 33*ee3311dbSWenyou Yang depends on DM_GPIO 342c62c56aSWenyou Yang default n 352c62c56aSWenyou Yang help 362c62c56aSWenyou Yang Say yes here to support the Atmel PIO4 driver. 372c62c56aSWenyou Yang The PIO4 is new version of Atmel PIO controller, which manages 382c62c56aSWenyou Yang up to 128 fully programmable input/output lines. Each I/O line 392c62c56aSWenyou Yang may be dedicated as a general purpose I/O or be assigned to 402c62c56aSWenyou Yang a function of an embedded peripheral. 412c62c56aSWenyou Yang 4264b17977SSimon Glassconfig INTEL_BROADWELL_GPIO 4364b17977SSimon Glass bool "Intel Broadwell GPIO driver" 4464b17977SSimon Glass depends on DM 4564b17977SSimon Glass help 4664b17977SSimon Glass This driver supports Broadwell U devices which have an expanded 4764b17977SSimon Glass GPIO feature set. The difference is large enough to merit a separate 4864b17977SSimon Glass driver from the common Intel ICH6 driver. It supports a total of 4964b17977SSimon Glass 95 GPIOs which can be configured from the device tree. 5064b17977SSimon Glass 51606f7047SAlbert ARIBAUD \(3ADEV\)config LPC32XX_GPIO 52606f7047SAlbert ARIBAUD \(3ADEV\) bool "LPC32XX GPIO driver" 53606f7047SAlbert ARIBAUD \(3ADEV\) depends on DM 54606f7047SAlbert ARIBAUD \(3ADEV\) default n 55606f7047SAlbert ARIBAUD \(3ADEV\) help 56606f7047SAlbert ARIBAUD \(3ADEV\) Support for the LPC32XX GPIO driver. 57d79c50afSSimon Glass 5881a87e18SMateusz Kulikowskiconfig MSM_GPIO 5981a87e18SMateusz Kulikowski bool "Qualcomm GPIO driver" 6081a87e18SMateusz Kulikowski depends on DM_GPIO 6181a87e18SMateusz Kulikowski default n 6281a87e18SMateusz Kulikowski help 6381a87e18SMateusz Kulikowski Support GPIO controllers on Qualcomm Snapdragon family of SoCs. 6481a87e18SMateusz Kulikowski This controller have single bank (default name "soc"), every 6581a87e18SMateusz Kulikowski gpio has it's own set of registers. 6681a87e18SMateusz Kulikowski Only simple GPIO operations are supported (get/set, change of 6781a87e18SMateusz Kulikowski direction and checking pin function). 6881a87e18SMateusz Kulikowski Supported devices: 6981a87e18SMateusz Kulikowski - APQ8016 7081a87e18SMateusz Kulikowski - MSM8916 7181a87e18SMateusz Kulikowski 72120800dfSMateusz Kulikowskiconfig PM8916_GPIO 73120800dfSMateusz Kulikowski bool "Qualcomm PM8916 PMIC GPIO/keypad driver" 74120800dfSMateusz Kulikowski depends on DM_GPIO && PMIC_PM8916 75120800dfSMateusz Kulikowski help 76120800dfSMateusz Kulikowski Support for GPIO pins and power/reset buttons found on 77120800dfSMateusz Kulikowski Qualcomm PM8916 PMIC. 78120800dfSMateusz Kulikowski Default name for GPIO bank is "pm8916". 79120800dfSMateusz Kulikowski Power and reset buttons are placed in "pm8916_key" bank and 80120800dfSMateusz Kulikowski have gpio numbers 0 and 1 respectively. 81120800dfSMateusz Kulikowski 825746b0dfSVignesh Rconfig PCF8575_GPIO 835746b0dfSVignesh R bool "PCF8575 I2C GPIO Expander driver" 845746b0dfSVignesh R depends on DM_GPIO && DM_I2C 855746b0dfSVignesh R help 865746b0dfSVignesh R Support for PCF8575 I2C 16-bit GPIO expander. Most of these 875746b0dfSVignesh R chips are from NXP and TI. 885746b0dfSVignesh R 891f8f7730SSimon Glassconfig ROCKCHIP_GPIO 901f8f7730SSimon Glass bool "Rockchip GPIO driver" 911f8f7730SSimon Glass depends on DM_GPIO 921f8f7730SSimon Glass help 931f8f7730SSimon Glass Support GPIO access on Rockchip SoCs. The GPIOs are arranged into 941f8f7730SSimon Glass a number of banks (different for each SoC type) each with 32 GPIOs. 951f8f7730SSimon Glass The GPIOs for a device are defined in the device tree with one node 961f8f7730SSimon Glass for each bank. 971f8f7730SSimon Glass 98d79c50afSSimon Glassconfig SANDBOX_GPIO 99d79c50afSSimon Glass bool "Enable sandbox GPIO driver" 100d79c50afSSimon Glass depends on SANDBOX && DM && DM_GPIO 101d79c50afSSimon Glass help 102d79c50afSSimon Glass This driver supports some simulated GPIOs which can be adjusted 103d79c50afSSimon Glass using 'back door' functions like sandbox_gpio_set_value(). Then the 104d79c50afSSimon Glass GPIOs can be inspected through the normal get_get_value() 105d79c50afSSimon Glass interface. The purpose of this is to allow GPIOs to be used as 106d79c50afSSimon Glass normal in sandbox, perhaps with test code actually driving the 107d79c50afSSimon Glass behaviour of those GPIOs. 108d79c50afSSimon Glass 109d79c50afSSimon Glassconfig SANDBOX_GPIO_COUNT 110d79c50afSSimon Glass int "Number of sandbox GPIOs" 111d79c50afSSimon Glass depends on SANDBOX_GPIO 112d79c50afSSimon Glass default 128 113d79c50afSSimon Glass help 114d79c50afSSimon Glass The sandbox driver can support any number of GPIOs. Generally these 115d79c50afSSimon Glass are specified using the device tree. But you can also have a number 116d79c50afSSimon Glass of 'anonymous' GPIOs that do not belong to any device or bank. 117d79c50afSSimon Glass Select a suitable value depending on your needs. 118d348a943SBhuvanchandra DV 119601800beSStephen Warrenconfig TEGRA_GPIO 120601800beSStephen Warren bool "Tegra20..210 GPIO driver" 121601800beSStephen Warren depends on DM_GPIO 122601800beSStephen Warren help 123601800beSStephen Warren Support for the GPIO controller contained in NVIDIA Tegra20 through 124601800beSStephen Warren Tegra210. 125601800beSStephen Warren 126074a1fddSStephen Warrenconfig TEGRA186_GPIO 127074a1fddSStephen Warren bool "Tegra186 GPIO driver" 128074a1fddSStephen Warren depends on DM_GPIO 129074a1fddSStephen Warren help 130074a1fddSStephen Warren Support for the GPIO controller contained in NVIDIA Tegra186. This 131074a1fddSStephen Warren covers both the "main" and "AON" controller instances, even though 132074a1fddSStephen Warren they have slightly different register layout. 133074a1fddSStephen Warren 134b9a66b63SMasahiro Yamadaconfig GPIO_UNIPHIER 135b9a66b63SMasahiro Yamada bool "UniPhier GPIO" 136b9a66b63SMasahiro Yamada depends on ARCH_UNIPHIER 137b9a66b63SMasahiro Yamada help 138b9a66b63SMasahiro Yamada Say yes here to support UniPhier GPIOs. 139b9a66b63SMasahiro Yamada 140d348a943SBhuvanchandra DVconfig VYBRID_GPIO 141d348a943SBhuvanchandra DV bool "Vybrid GPIO driver" 142d348a943SBhuvanchandra DV depends on DM 143d348a943SBhuvanchandra DV default n 144d348a943SBhuvanchandra DV help 145d348a943SBhuvanchandra DV Say yes here to support Vybrid vf610 GPIOs. 1460b11dbf7SMasahiro Yamada 147386d934eSPurna Chandra Mandalconfig PIC32_GPIO 148386d934eSPurna Chandra Mandal bool "Microchip PIC32 GPIO driver" 149386d934eSPurna Chandra Mandal depends on DM_GPIO && MACH_PIC32 150386d934eSPurna Chandra Mandal default y 151386d934eSPurna Chandra Mandal help 152386d934eSPurna Chandra Mandal Say yes here to support Microchip PIC32 GPIOs. 153386d934eSPurna Chandra Mandal 154704d9a64SStefan Roeseconfig MVEBU_GPIO 155704d9a64SStefan Roese bool "Marvell MVEBU GPIO driver" 156704d9a64SStefan Roese depends on DM_GPIO && ARCH_MVEBU 157704d9a64SStefan Roese default y 158704d9a64SStefan Roese help 159704d9a64SStefan Roese Say yes here to support Marvell MVEBU (Armada XP/38x) GPIOs. 160704d9a64SStefan Roese 1612978ae23SSiva Durga Prasad Paladuguconfig ZYNQ_GPIO 1622978ae23SSiva Durga Prasad Paladugu bool "Zynq GPIO driver" 163251ab06dSSiva Durga Prasad Paladugu depends on DM_GPIO && (ARCH_ZYNQ || ARCH_ZYNQMP) 1642978ae23SSiva Durga Prasad Paladugu default y 1652978ae23SSiva Durga Prasad Paladugu help 1662978ae23SSiva Durga Prasad Paladugu Supports GPIO access on Zynq SoC. 1672978ae23SSiva Durga Prasad Paladugu 1689300f711SPeng Fanconfig DM_74X164 1699300f711SPeng Fan bool "74x164 serial-in/parallel-out 8-bits shift register" 1709300f711SPeng Fan depends on DM_GPIO 1719300f711SPeng Fan help 1729300f711SPeng Fan Driver for 74x164 compatible serial-in/parallel-out 8-outputs 1739300f711SPeng Fan shift registers, such as 74lv165, 74hc595. 1749300f711SPeng Fan This driver can be used to provide access to more gpio outputs. 1759300f711SPeng Fan 17603773439SPeng Fanconfig DM_PCA953X 17703773439SPeng Fan bool "PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports" 17803773439SPeng Fan depends on DM_GPIO 17903773439SPeng Fan help 18003773439SPeng Fan Say yes here to provide access to several register-oriented 18103773439SPeng Fan SMBus I/O expanders, made mostly by NXP or TI. Compatible 18203773439SPeng Fan models include: 18303773439SPeng Fan 18403773439SPeng Fan 4 bits: pca9536, pca9537 18503773439SPeng Fan 18603773439SPeng Fan 8 bits: max7310, max7315, pca6107, pca9534, pca9538, pca9554, 18703773439SPeng Fan pca9556, pca9557, pca9574, tca6408, xra1202 18803773439SPeng Fan 18903773439SPeng Fan 16 bits: max7312, max7313, pca9535, pca9539, pca9555, pca9575, 19003773439SPeng Fan tca6416 19103773439SPeng Fan 19203773439SPeng Fan 24 bits: tca6424 19303773439SPeng Fan 19403773439SPeng Fan 40 bits: pca9505, pca9698 19503773439SPeng Fan 19603773439SPeng Fan Now, max 24 bits chips and PCA953X compatible chips are 19703773439SPeng Fan supported 19807d31f8fSmario.six@gdsys.cc 19907d31f8fSmario.six@gdsys.ccconfig MPC85XX_GPIO 20007d31f8fSmario.six@gdsys.cc bool "Freescale MPC85XX GPIO driver" 20107d31f8fSmario.six@gdsys.cc depends on DM_GPIO 20207d31f8fSmario.six@gdsys.cc help 20307d31f8fSmario.six@gdsys.cc This driver supports the built-in GPIO controller of MPC85XX CPUs. 20407d31f8fSmario.six@gdsys.cc Each GPIO bank is identified by its own entry in the device tree, 20507d31f8fSmario.six@gdsys.cc i.e. 20607d31f8fSmario.six@gdsys.cc 20707d31f8fSmario.six@gdsys.cc gpio-controller@fc00 { 20807d31f8fSmario.six@gdsys.cc #gpio-cells = <2>; 20907d31f8fSmario.six@gdsys.cc compatible = "fsl,pq3-gpio"; 21007d31f8fSmario.six@gdsys.cc reg = <0xfc00 0x100> 21107d31f8fSmario.six@gdsys.cc } 21207d31f8fSmario.six@gdsys.cc 21307d31f8fSmario.six@gdsys.cc By default, each bank is assumed to have 32 GPIOs, but the ngpios 21407d31f8fSmario.six@gdsys.cc setting is honored, so the number of GPIOs for each bank is 21507d31f8fSmario.six@gdsys.cc configurable to match the actual GPIO count of the SoC (e.g. the 21607d31f8fSmario.six@gdsys.cc 32/32/23 banks of the P1022 SoC). 21707d31f8fSmario.six@gdsys.cc 21851781783Smario.six@gdsys.cc Aside from the standard functions of input/output mode, and output 21951781783Smario.six@gdsys.cc value setting, the open-drain feature, which can configure individual 22051781783Smario.six@gdsys.cc GPIOs to work as open-drain outputs, is supported. 22107d31f8fSmario.six@gdsys.cc 22207d31f8fSmario.six@gdsys.cc The driver has been tested on MPC85XX, but it is likely that other 22307d31f8fSmario.six@gdsys.cc PowerQUICC III devices will work as well. 2240b11dbf7SMasahiro Yamadaendmenu 225