summaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)Author
3 daysgpio: Tighten some gpio driver dependenciesTom Rini
A large number of gpio drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <trini@konsulko.com>
4 daysgpio: Remove tca642x supportTom Rini
This driver has no users after we removed the last supported platform in 2023. Fixes: 7a3ee61f5551 ("arm: Remove omap5_uevm board") Signed-off-by: Tom Rini <trini@konsulko.com>
2025-06-24gpio: msm_gpio: return correct value for gpio readAswin Murugan
In the current implementation, the GPIO read operation considers both the input and outbut bits (bits 0 and 1). It should only consider the state of input bit, i.e bit 0. To address this, mask input bit alone and read it. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250508113646.1462518-1-aswin.murugan@oss.qualcomm.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-05-29Merge patch series "Start removing <env.h> from headers when not required"Tom Rini
Tom Rini <trini@konsulko.com> says: Given Simon's series at [1] I started looking in to what brings in <env.h> when not strictly required and in turn has some unintended implicit includes. This series takes care of the places where, commonly, <linux/string.h> or <env.h> itself were required along with a few other less common cases. This sets aside for the moment what to do about net-common.h and env_get_ip() as I'm not entirely sure what's best there. [1]: https://patchwork.ozlabs.org/project/uboot/list/?series=454939&state=* Link: https://lore.kernel.org/r/20250514225002.15361-1-trini@konsulko.com
2025-05-29gpio: pca953x: Add missing <asm/byteorder.h>Tom Rini
This driver takes a long implicit include path to get this header which it directly uses. Add it. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-05-08gpio: tegra_gpio: implement rfree operationSvyatoslav Ryhel
Releasing a GPIO on Tegra necessitates changing its configuration to SFIO to activate its special function. Without this reconfiguration, the special function will be unavailable. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-04-28gpio: axp: Remove virtual VBUS enable GPIOSamuel Holland
Now that this functionality is modeled using the device tree and regulator uclass, the named GPIO is not referenced anywhere. Remove it, along with the rest of the support for AXP virtual GPIOs. Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2025-04-11Merge patch series "Switch to using $(PHASE_) in Makefiles"Tom Rini
Tom Rini <trini@konsulko.com> says: This series switches to always using $(PHASE_) in Makefiles when building rather than $(PHASE_) or $(XPL_). It also starts on documenting this part of the build, but as a follow-up we need to rename doc/develop/spl.rst and expand on explaining things a bit. Link: https://lore.kernel.org/r/20250401225851.1125678-1-trini@konsulko.com
2025-04-11Kbuild: Always use $(PHASE_)Tom Rini
It is confusing to have both "$(PHASE_)" and "$(XPL_)" be used in our Makefiles as part of the macros to determine when to do something in our Makefiles based on what phase of the build we are in. For consistency, bring this down to a single macro and use "$(PHASE_)" only. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-04-11pinctrl: qcom: handle reserved rangesCaleb Connolly
Some Qualcomm boards feature reserved ranges of pins which are protected by firmware. Attempting to read or write any registers associated with these pins results the board resetting. Add support for parsing these ranges from devicetree and ensure that the pinctrl and GPIO drivers don't try to interact with these pins. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250410-topic-sm8x50-pinctrl-reserved-ranges-v2-1-654488392b9a@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-11gpio: msm: return correct value return for special output pinsNeil Armstrong
When a special pin is output only, the current code would return 0, but if the pin is output only we can get the output value. Try to return the output value and in all the other cases return an error instead of 0. Fixes: f9bb539460d ("gpio: msm: add support for special pins") Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250401-topic-sm8x50-msm-gpio-special-fixes-v1-2-a1148a02bb16@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-04-11gpio: msm: fix get_function return for special pinsNeil Armstrong
The get_function callback wrongly returns 0 for special pins, return the appropriate pin function by probing into the special pins data fields to find if the pin is gpio capable. Fixes: f9bb539460d ("gpio: msm: add support for special pins") Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250401-topic-sm8x50-msm-gpio-special-fixes-v1-1-a1148a02bb16@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-03-12Merge patch series "drivers: Driver support for ADI SC5xx SoCs"Tom Rini
Greg Malysa <malysagreg@gmail.com> says: This series adds all of the supported peripheral drivers for the sc5xx series of SoCs from Analog Devices and other drivers that are used by the evaluation kits, such as a GPIO expander used by the EZLITE carrier boards. This series passes gitlab CI tests. Link: https://lore.kernel.org/r/20250226173150.13198-1-malysagreg@gmail.com
2025-03-12gpio: Add support for ADI ADP5588 GPIO expander chipsNathan Barrett-Morrison
This adds support for the ADP588 GPIO expander from Analog Devices. It is accessed over I2C and provides up to 18 pins. It is largely a port of the Linux driver developed by Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Ian Roberts <ian.roberts@timesys.com> Signed-off-by: Greg Malysa <malysagreg@gmail.com> Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com> Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com> Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com> Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com> Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
2025-03-12gpio: Add support for SC5XX-family processor GPIO driverGreg Malysa
This adds support for using the GPIO pins on the SC5XX family of SoCs from Analog Devices. Co-developed-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> Co-developed-by: Ian Roberts <ian.roberts@timesys.com> Signed-off-by: Ian Roberts <ian.roberts@timesys.com> Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com> Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com> Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com> Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com> Signed-off-by: Greg Malysa <malysagreg@gmail.com>
2025-03-10Merge tag 'v2025.04-rc4' into nextTom Rini
This uses Heinrich's merge of lib/efi_loader/efi_net.c which results in no changes.
2025-03-04gpio: 74x146: depend on DM_SPIJ. Neuschäfer
Currently, Kconfig allows building CONFIG_DM_74X164 without CONFIG_DM_SPI, which results in linker errors because this driver actually uses dm_spi_* functions: drivers/gpio/74x164_gpio.o: in function `gen_74x164_write_conf': undefined reference to `dm_spi_claim_bus' undefined reference to `dm_spi_xfer' undefined reference to `dm_spi_release_bus' Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2025-02-24Merge tag 'v2025.04-rc3' into nextTom Rini
Prepare v2025.04-rc3
2025-02-18gpio: pca953x: support pcal6408 and pcal6416Emanuele Ghidoli
Add support to NXP GPIO expanders pcal6408, documented at [1], and pcal6416, documented at [2]. [1] https://www.nxp.com/docs/en/data-sheet/PCAL6408A.pdf [2] https://www.nxp.com/docs/en/data-sheet/PCAL6416A.pdf Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2025-02-12Revert "drivers: gpio-uclass: support PMIC GPIO children"Svyatoslav Ryhel
Requesting of PMIC's GPIO child should be done by binding GPIO driver to PMIC's node is GPIO driver does not have its own node. This reverts commit c03cd98d1a163666b4addcdd9a34fc0c77dfd0a5. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2025-01-16gpio: adp5585: Update compatible stringPeng Fan
i.MX93-11x11-EVK has switched to use upstream device tree, and use "adi,adp5585". Since i.MX93-11x11-EVK is the only user of this driver, so it is safe to drop "adp5585". Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-12-30Merge patch series "Misc. PowerPC MPC83xx fixes/cleanups"Tom Rini
J. Neuschäfer <j.ne@posteo.net> says: This patchset contains a few small fixes/cleanups for the MPC83xx platform. Link: https://lore.kernel.org/r/20241220-mpc83xx-misc-v2-0-ff4c17ee5fa4@posteo.net
2024-12-30gpio: mpc8xxx: Preserve pre-init state of outputsJ. Neuschäfer
The mpc8xxx_gpio driver contains a workaround for certain chips where the previously written state of outputs cannot be read back from the GPIO data (GPDAT) register (MPC8572/MPC8536). This workaround consists of tracking the state of GPDAT in a "shadow register" (i.e. a software variable). The shadow register is initialized to zero. This results in a problem w.r.t. outputs that are configured to a high (1) state before U-Boot runs, but not touched by U-Boot itself: Due to the zero-initialization, these GPIOs end up being set to zero, the first time that any other output is set. To avoid such issues initialize the GPDAT shadow register to the value previously held by any outputs, if possible. On MPC8572/MPC8536 this should make no difference, i.e. the shadow register should be initialized to zero on these chips. This patch has been tested on a MPC8314E-based board. Reviewed-by: Sinan Akman <sinan@writeme.com> Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2024-12-30gpio: npcm: Add persist feature to sgpio moduleJim Liu
Base on GPIO hog to support sgpio persist enable feature. Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2024-12-25Merge tag 'v2025.01-rc5' into nextTom Rini
Prepare v2025.01-rc5
2024-12-11gpio: renesas: Fix R-Car spellingMarek Vasut
The correct spelling is R-Car, including the dash, update the usage. Kconfig strings and comment changes only, no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-12-07gpio: imx_rgpio2p: Move 8ulp_data to data sectionPeng Fan
have_dual_base is set to false, so the 8ulp_data will be put in BSS section which conflicts with the area of u-boot.dtb which padded just after u-boot-nodtb.bin. So move 8ulp_data to data section to avoid its content being corrupted by dtb. Fixes: 51cfa66f2c4 ("gpio: imx_rgpio2p: support one address") Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-12-04dm: gpio: Return error when pull up/down is requested but set_flags ops is ↵Zixun LI
not implmentated Currently in _dm_gpio_set_flags() when set_flags ops is not implemented direction_output()/_input() is used, but pull up/down is not supported by these ops. Signed-off-by: Zixun LI <admin@hifiphile.com>
2024-11-29gpio: at91: Implement ops get_flagsZixun LI
Add ops get_dir_flags() to read status from GPIO registers. Signed-off-by: Zixun LI <admin@hifiphile.com>
2024-11-29gpio: at91: Implement ops set_flagsZixun LI
Support GPIO configuration with following flags: - in, out, out_active - open_drain, pull_up Signed-off-by: Zixun LI <admin@hifiphile.com>
2024-11-29gpio: at91: Implement GPIOF_FUNC in get_function()Zixun LI
This patch adds support for determining whether a gpio pin is mapped as peripheral function. Signed-off-by: Zixun LI <admin@hifiphile.com>
2024-11-20gpio: qcom_pmic: add again the quirk to skip GPIO configuration on PM8550Neil Armstrong
The qcom_pmic code is broken for new PMICs and should be fixed, without the QUIRK the code is broken and the GPIOs don't work anymore on SM8550 and SM8650 platforms. Partially revert the revert and only add the quirk on the PM8550 PMIC, making the buttons and MMC detect gpio work again. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-10-29Merge patch series "Support Aspeed SGPIO controller"Tom Rini
Billy Tsai <billy_tsai@aspeedtech.com> says: AST2600 SoC has 2 SGPIO master interfaces one with 128 pins another one with 80 pins, AST2500/AST2400 SoC has 1 SGPIO master interface that supports up to 80 pins. Link: https://lore.kernel.org/r/20241016085955.314236-1-billy_tsai@aspeedtech.com
2024-10-29gpio: Add Aspeed SGPIO driverBilly Tsai
The Aspeed SGPIO driver supports the SGPIO controllers found in the AST2400, AST2500 and AST2600 BMC SoCs. The implementation is a cut-down copy of the upstream Linux kernel driver, adapted for u-boot. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
2024-10-28gpio: dw: Add ngpios DT-property supportMaksim Kiselev
Starting with Linux commit 7569486d79ae ("gpio: dwapb: Add ngpios DT-property support") the "snps,nr-gpios" property was marked as deprecated. And since all newly added dw-apb-gpio nodes are described using generic "ngpios" property, it's time to add support for it. Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-10-24mcp230xx_gpio.c: Add a missing include file.Philip Balister
* Fixes a warning about implicit declaration of udelay. Signed-off-by: Philip Balister <philip@balister.org>
2024-10-13Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegraTom Rini
Assorted Tegra enhancements. Merged with the recent XPL_BUILD changes, resolve some whitespace issues and fix the name of the new apalis-tk1 env file by Tom. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-10-13drivers: tegra_gpio: add early SPL functionsSvyatoslav Ryhel
In some cases access to GPIOs is needed so early that DM is not ready even nearly. These functions are exactly for this case. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2024-10-11Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"Tom Rini
Simon Glass <sjg@chromium.org> says: When the SPL build-phase was first created it was designed to solve a particular problem (the need to init SDRAM so that U-Boot proper could be loaded). It has since expanded to become an important part of U-Boot, with three phases now present: TPL, VPL and SPL Due to this history, the term 'SPL' is used to mean both a particular phase (the one before U-Boot proper) and all the non-proper phases. This has become confusing. For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL' phases, not just SPL. So code which can only be compiled for actual SPL, for example, must use something like this: #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) In Makefiles we have similar issues. SPL_ has been used as a variable which expands to either SPL_ or nothing, to chose between options like CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was updated to support 'VPL_' as well. This series starts a change in terminology and usage to resolve the above issues: - The word 'xPL' is used instead of 'SPL' to mean a non-proper build - A new CONFIG_XPL_BUILD define indicates that the current build is an 'xPL' build - The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now defined for TPL and VPL phases - The existing SPL_ Makefile variable is renamed to SPL_ - The existing SPL_TPL Makefile variable is renamed to PHASE_ It should be noted that xpl_phase() can generally be used instead of the above CONFIGs without a code-space or run-time penalty. This series does not attempt to convert all of U-Boot to use this new terminology but it makes a start. In particular, renaming spl.h and common/spl seems like a bridge too far at this point. The series is fully bisectable. It has also been checked to ensure there are no code-size changes on any commit.
2024-10-11global: Rename SPL_TPL_ to PHASE_Simon Glass
Use PHASE_ as the symbol to select a particular XPL build. This means that SPL_TPL_ is no-longer set. Update the comment in bootstage to refer to this symbol, instead of SPL_ Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11global: Rename SPL_ to XPL_Simon Glass
Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is no-longer set. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILDSimon Glass
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-05Merge tag 'u-boot-imx-next-20241005' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/22526 - Add DA9063 watchdog support for the imx6q-lxr2 board. - Add support for DH electronics i.MX8M Plus DHCOM PicoITX - Add DH i.MX8MP DHCOM SoM on DRC02 carrier board - Several fsl_esdhc_imx improvements. - Pas no-mmc-hs400 to mmc2 on imx8mm-cl-iot-gate.
2024-10-04Revert "gpio: qcom_pmic: add a quirk to skip GPIO configuration"Caleb Connolly
This reverts commit 19f000b72b2fa7e4540f7cdb91287aff594239bd. The bug in writing was caused by a long-standing error in the SPMI driver which has since been fixed - c2de620d64d4 ("spmi: msm: fix version 5 support"). We can safely enable writing GPIO configuration now. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-10-04gpio: msm: add support for special pinsNeil Armstrong
Leverage the data introduced in the struct msm_special_pin_data to allow setting the gpio direction and value if supported by the pin data. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-10-04gpio: adp5585: Add SPL config for ADP5585 driverYe Li
So we can disable to build ADP5585 in SPL to save size Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2024-08-30gpio: mxc_gpio: fix reading state of GPIO pins in output modeTomas Paukrt
The PSR register works correctly for GPIO pins in input mode, but always returns 0 for GPIO pins in output mode unless the SION bit is set. The DR register should be used for GPIO pins in output mode to allow correct getting of previously set output value. Please note that the Linux gpio-mxc driver and the NXP U-Boot mxc_gpio driver already use the DR register for all GPIO pins in output mode: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=442b2494b17d1a4f0a14721580271eb23ebffd42 https://github.com/nxp-imx/uboot-imx/commit/4afc3f90943c6b117f79b66d2cd04e64f437b0c2 Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Fabio Estevam <festevam@gmail.com> Tested-by: Fabio Estevam <festevam@gmail.com>
2024-08-27gpio: Add G7 Aspeed gpio controller driverBilly Tsai
In the 7th generation of the SoC from Aspeed, the control logic of the GPIO controller has been updated to support per-pin control. Each pin now has its own 32-bit register, allowing for individual control of the pin’s value, direction, interrupt type, and other settings. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
2024-08-27gpio: npcm: Add SGPIO support for Nuvoton NPCM SoCsJim Liu
Add Nuvoton BMC NPCM7xx/NPCM8xx sgpio driver. BMC can use this driver to increase 64 GPI pins and 64 GPO pins to use. Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2024-07-22drivers: gpio: Remove duplicate newlinesMarek Vasut
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>