summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
AgeCommit message (Collapse)Author
2025-09-30pinctrl: meson: support gpio toggle commandYang Xiwen
meson_gpio_get() always assumes gpio is configured to input mode. This is incorrect and breaks `gpio toggle` command: gpio: pin aobus-banks2 (gpio 2) value is 0 Warning: value of pin is still 1 Fix it by adding the logic to handle both input and output mode. Fixes: 2009a8d03fe5 ("pinctrl: meson: add GPIO support") Signed-off-by: Yang Xiwen <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Neil Armstrong <[email protected]>
2025-09-26pinctrl: nxp: Add i.MX94 daisy register offsetAlice Guo
Define the daisy register offset for i.MX94 at 0x608 within the iomuxc register space. This enables correct pad selection for daisy chain configuration on i.MX94 platforms. Signed-off-by: Jacky Bai <[email protected]> Signed-off-by: Alice Guo <[email protected]> Acked-by: Peng Fan <[email protected]>
2025-09-19pinctrl: th1520: Mark driver as DM_FLAG_PRE_RELOCYao Zi
It's common that UARTs are bound and probed before U-Boot relocation, in which case the UART's pincontroller and pinconfig must be probed first. Let's apply DM_FLAG_PRE_RELOC to the driver, allow it to bind before relocation. Signed-off-by: Yao Zi <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2025-09-08Merge tag 'v2025.10-rc4' into nextTom Rini
Prepare v2025.10-rc4
2025-09-03pinctrl: rzg2l: Variable may not have been assigned toAndrew Goodbody
In rzg2l_pinconf_set and rzg2l_get_pin_muxing if the call to rzg2l_selector_decode fails then the variable pin may not have been assigned to. Remove the use of pin from the error message. Also update the error message to show the invalid selector used instead of port which will be the error code returned. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Paul Barker <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2025-08-25Merge tag 'v2025.10-rc3' into nextTom Rini
Prepare v2025.10-rc3
2025-08-25pinctrl: zynqmp: Avoid using uninitialised variableAndrew Goodbody
In zynqmp_pinconf_set if param is PIN_CFG_IOSTANDARD or PIN_CONFIG_POWER_SOURCE and zynqmp_pm_pinctrl_get_config returns an error then value will not be assigned to when its value is tested to be not equal to arg. Add code to only test value not equal to arg if ret is false. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2025-08-25pinctrl: zynqmp: Ensure ret is initialisedAndrew Goodbody
In zynqmp_pinctrl_prepare_func_groups if called with func->ngroups == 0 then ret will not be assigned to before its value is returned on exit. Initialise ret to ensure it is always valid. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2025-08-19pinctrl: nexell: Cannot test unsigned to be negativeAndrew Goodbody
In s5pxx18_pinctrl_set_state testing count to be negative will always fail as count is unsigned despite receiving the return value of a function that returns an int. Change count and idx to be of type int to allow the test to work as expected and remove the need for any implicit casts. Also change pin to be u32 which is what all called functions expect. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-18pinctrl: npcm8xx: add support for setting VCD input sourceStanley Chu
Add pinmux for the VCD input to use the HSYNC signal. Signed-off-by: Stanley Chu <[email protected]> Signed-off-by: Jim Liu <[email protected]>
2025-08-15pinctrl: stmfx: Remove duplicated codeAndrew Goodbody
In stmfx_read_reg there is duplicated code to detect ret < 0 and return ret if so. Remove one version of it. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-15pinctrl: single: Remove unreachable codeAndrew Goodbody
In single_read there is a switch block with a default label. All cases in the switch block, including the default, return directly. So any code following the switch block is unreachable. Remove the unreachable code. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-08-14pinctrl: Tighten some pinctrl driver dependenciesTom Rini
A few pinctrl drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-08-13Merge tag 'qcom-fixes-13Aug2025' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-snapdragon CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/27364 Quite a few Smatch issues reported by Andrew, and the LMB allocation fix.
2025-08-13pinctrl: qcom: sdm845: Limit check off by 1Andrew Goodbody
The driver specifies 154 pins so should have a maximum selector of 153 to ensure that the index into the array special_pins_names does not overflow. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-08-13pinctrl: qcom: sa8775: Limit check for array index not correctAndrew Goodbody
In sa8775p_get_pin_name the limit check for the index into msm_special_pins_data allows for more elements than exist. Add code to ensure the array index remains in bounds. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-08-12pinctrl: sunxi: a523: change Ethernet pin function nameAndre Przywara
The name of the pin function was changed last minute in the DT, from emac0 to gmac0. Adjust the name we use in the pinctrl driver accordingly. Signed-off-by: Andre Przywara <[email protected]> Reviewed-by: Jernej Skrabec <[email protected]>
2025-08-11pinctrl: sx150x: reformat and fixup Copyright headerNeil Armstrong
The Linux pinctrl-sx150 was originally written as a GPIO driver and fully rewritten by me as a Pinctrl driver and extended by other contributors. Fixup the Copyright header style and correctly report the Copyright headers from the Linux driver. Signed-off-by: Neil Armstrong <[email protected]>
2025-08-11pinctrl: gpio: sx150x: fix compilation warnings.Chali Anis
Fixes: 5451504256d3 ("pinctrl: gpio: sx150x: add Semtech SX150x I2C GPIO expander and pinctrl driver") Signed-off-by: Chali Anis <[email protected]>
2025-07-27pinctrl: sunxi: add Allwinner A523 pinctrl descriptionAndre Przywara
The new DT pinctrl binding would allow us to read the pinmux values from the DT, but it is actually easier to just continue with hardcoding the mux values in the driver, and matching them against the "function" name. Add the values for the primary and secondary pin controller on the A523. Signed-off-by: Andre Przywara <[email protected]>
2025-07-14pinctrl-uclass: update comment to reflect codePhilip Molloy
The logic was updated without modifying the comment above it Fixes: 72b8c6d1ebf ("pinctrl: don't fall back to pinctrl_select_state_simple()") Signed-off-by: Philip Molloy <[email protected]>
2025-07-03pinctrl: Port pin controller driver for T-Head TH1520 SoCYao Zi
The SoC pads of TH1520 are separated into three groups (AP 1, AP 2 and AON) controlled by independent pin controllers. This patch ports their driver from Linux kernel with most code for setting pinconf and pinmux kept as is. The dt-binding of TH1520 pin controller uses a schema where pins to configure are specfied as strings and looked up at runtime, which the generic pinctrl helpers of U-Boot cannot parse, thus a customized set_state() callback is implemented to parse pinconfig nodes and setup the configuration. Signed-off-by: Yao Zi <[email protected]> Acked-by: Leo Yu-Chi Liang <[email protected]>
2025-06-29arm: pinctrl: Define .mux_mask field for NXP's SoCLukasz Majewski
The commit e8a9521e649f ("vf500/vf610: synchronise device trees with linux") has synchronized U-Boot's DTS with v5.19 Linux kernel. It turned out that in Linux's upstream iomuxc node description the 'fsl,mux_mask' was missing, so the U-Boot's pinctrl driver for NXP's Vybrid SoC was not working properly. As by default the mux mask was set to 0, for example the vf610 based boards (like BK4) were bricked, due to misconfiguration of gpio at early boot stage. The fix for all NXP eligible boards is to define .mux_mask field for soc specific *pinctrl_soc_info structure and use it directly in pinctrl MMIO driver, without the need to read the "fsl,mux_mask" property from device tree. This change brings the NXP's pinctrl driver in U-Boot closer to Linux upstream one. Signed-off-by: Lukasz Majewski <[email protected]> Reviewed-by: Peng Fan <[email protected]> #for i.MX8ULP
2025-06-23pinctrl: qcom: Add ipq5424 pinctrl driverVaradarajan Narayanan
Add pinctrl driver for the TLMM block found in the ipq5424 SoC. Signed-off-by: Varadarajan Narayanan <[email protected]> Reviewed-by: Casey Connolly <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-06-03pinctrl: gpio: sx150x: add Semtech SX150x I2C GPIO expander and pinctrl driverAnis Chali
implement a driver to use semtech pinctrl and gpio expander, this driver is adapted from a existent linux driver that is written by Gregory Bean <[email protected]>. Signed-off-by: Anis Chali <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RV1108Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3399Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3368Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3328Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3308Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3288Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3228Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3188Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3128Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3066Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3036Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for PX30Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: fix bank's pin_base computingQuentin Schulz
The logic in the core reads the nr_pins of the controller and uses it as the index of the first pin in the bank (pin_base) it currently parses. It then increments the number of pins in the controller before going to the next bank. This works "fine" for controllers where nr_pins isn't defined in their rockchip_pin_ctrl struct as it defaults to 0. However, when it is already set, it'll make the index pin of each bank offset by the number in nr_pins declared in the struct at initialization, and it'll keep growing while adding banks, which means the total number of pins in the controller will be misrepresented. Additionally, U-Boot proper may probe this driver twice (pre-reloc and true proper) and not reset nr_pins of the controller in-between meaning the second probe will have an offset of the actual correct nr_pins. Instead, let's just store locally the number of pins in the controller and make sure it's reset between probes. Finally, this stops modifying a const struct which will soon be triggering a CPU abort at runtime. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-03firmware: scmi_agent: add SCMI pin control protocol supportAlice Guo
This patch adds SCMI pin control protocol support to make the pin controller driver based on SCMI, such as drivers/pinctrl/nxp/pinctrl-imx-scmi.c, can be bound to the SCMI agent device whose protocol id is 0x19. Signed-off-by: Alice Guo <[email protected]>
2025-05-03pinctrl: nxp: add a pin controller driver based on SCMI pin control protocolAlice Guo
This patch provides a pinctrl driver based on SCMI pin control protocol. Currently, only the PINCTRL_CONFIG_SET command is implemented. Signed-off-by: Ranjani Vaidyanathan <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Alice Guo <[email protected]> Reviewed-by: Ye Li <[email protected]>
2025-05-02Merge patch series "Qualcomm: cleanup OF_LIVE fixup and fix RB1/2"Tom Rini
Caleb Connolly <[email protected]> says: Introduce a new event to signal that the live tree has been built, allowing boards to perform fixups on the tree before devices are bound. Crucially this allows for devices to be enabled or disabled, but also allows for properties that are parsed during the bind stage to be modified (such as dr_mode for dwc3). With this in place, mach-snapdragon is switched over to use the event and some hacky U-Boot specific DT overrides (which had to be undone prior to booting an image) are removed in favour of fixing up the livetree (which is not passed on to further boot stages). Finally, some minor fixes are made for the QCM2290 RB1 board, the sdcard is enabled and it now uses USB host mode in U-Boot like it's bigger sibling the RB2. Link: https://lore.kernel.org/r/[email protected]
2025-05-02pinctrl: qcom: qcm2290: fix off by 1 in pin_countCaleb Connolly
There are 134 pins not 133, oops! This fixes the sdcard on the RB1 as the pins now all get configured correctly. Fixes: 0ecb8cfcb930 ("pinctrl: qcom: add qcm2290 pinctrl driver") Reviewed-by: Sumit Garg <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Tested-by: Sumit Garg <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2025-04-23pinctrl: rockchip: support rk3576 pinctrlSteven Liu
Add support for the rk3576 variant of pinctrl. Signed-off-by: Steven Liu <[email protected]> [adapted to mainline u-boot] Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-04-23pinctrl: rockchip: Add support for RK3528Steven Liu
Add pinctrl driver for RK3528. Imported from vendor U-Boot linux-6.1-stan-rkr5 tag with adjustments to use regmap_update_bits(). Signed-off-by: Steven Liu <[email protected]> Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-04-12ARM: tegra20: add funcmux for exposing UART over uSD slot on Tegra 20Artur Kowalski
UART-A can be exposed through uSD, this was tested on Transformer T20 but should work on all Ventana-based boards. TX is exported on SDD pingroup corresponding to uSD CLK pin RX is exported on SDB which is CMD pin in uSD slot Signed-off-by: Artur Kowalski <[email protected]> Reviewed-by: Svyatoslav Ryhel <[email protected]> Signed-off-by: Svyatoslav Ryhel <[email protected]>
2025-04-12pinctrl: tegra: detect unknown/invalid pin/func configurationsSvyatoslav Ryhel
Applies same logic to general Tegra pincontrol driver as is done to Tegra20 by commit: a35bf832d70 ("pinctrl: tegra20: detect unknown/invalid pin/func configurations") Suggested-by: Artur Kowalski <[email protected]> Signed-off-by: Svyatoslav Ryhel <[email protected]>
2025-04-12pinctrl: tegra20: detect unknown/invalid pin/func configurationsArtur Kowalski
Tegra20 driver doesn't know about some pin configurations and even about some pins. In case when pin configuration is unknown the pin would be muxed to whatever is under function 0, in case when pin itself is unknown, it could cause out-of-bounds array access in pinmux_set_func and pinmux_set_pullupdown. Signed-off-by: Artur Kowalski <[email protected]> Reviewed-by: Svyatoslav Ryhel <[email protected]> Signed-off-by: Svyatoslav Ryhel <[email protected]>
2025-04-11Merge patch series "Switch to using $(PHASE_) in Makefiles"Tom Rini
Tom Rini <[email protected]> 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/[email protected]
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 <[email protected]>
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 <[email protected]> Reviewed-by: Sumit Garg <[email protected]> Link: https://lore.kernel.org/r/20250410-topic-sm8x50-pinctrl-reserved-ranges-v2-1-654488392b9a@linaro.org Signed-off-by: Caleb Connolly <[email protected]>