summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
AgeCommit message (Collapse)Author
2026-06-08pinctrl: mediatek: mt8516: Fix Schmitt trigger register offset of pins 34-39Luca Leonardo Scorcia
The correct Schmitt trigger register offset for pins 34-39 is 0xA00. Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com> Fixes: 264667112ef0 ("pinctrl: mediatek: Add MT8516 Pinctrl driver") Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-08pinctrl: qcom: Fix resolving register base address from device nodeSneh Mankad
Commit 56ffb63749f4 ("pinctrl: qcom: add multi TLMM region option parameter") added reg-names property based register reading. However multiple platforms are not using the reg-names as they have only single TLMM register region. Commit tried to handle this using the default_region module parameter, however this condition is unreachable as the error return precedes it by just checking if reg-names property exists or not, making it impossible to use tlmm-test for the SoCs (x1e80100) which don't have reg-names property in TLMM device. Fix this by moving the default_region check at the start of the tlmm_reg_base(). Fixes: 56ffb63749f4 ("pinctrl: qcom: add multi TLMM region option parameter") Signed-off-by: Sneh Mankad <sneh.mankad@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-08pinctrl: qcom: Modify MSM_PULL_MASK to accurately represent PULL bitsSneh Mankad
MSM_PULL_MASK currently spans bits [2:0], but the GPIO_PULL field in the GPIO_CFG register only occupies bits [1:0]. Bit 2 belongs to FUNC_SEL. MSM_PULL_MASK is used to isolate the GPIO_PULL bits before writing the pull configuration (PULL_DOWN: 0x1, PULL_UP: 0x3) to the GPIO_CFG register. Narrow it to bits [1:0] to prevent unintended modification of the FUNC_SEL field. This causes no functional change since the driver currently does not modify the FUNC_SEL bit, but align the mask with hardware configuration nonetheless. Signed-off-by: Sneh Mankad <sneh.mankad@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-08pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PMAjay Kumar Nandam
Convert the LPASS LPI pinctrl driver to use the PM clock framework for runtime power management. This allows the LPASS LPI pinctrl driver to drop clock votes when idle, improves power efficiency on platforms using LPASS LPI island mode, and aligns the driver with common runtime PM patterns used across Qualcomm LPASS subsystems. Guard GPIO register read/write helpers and slew-rate register programming with synchronous runtime PM calls so the device is active during MMIO operations whenever autosuspend is enabled. Make PINCTRL_LPASS_LPI depend on PM_CLK, since this patch introduces direct PM clock API use in the shared core. Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-08pinctrl: qcom: lpass-lpi: Enable runtime PM hooks on LPASS LPI SoCsAjay Kumar Nandam
The LPASS LPI core conversion to PM clock framework relies on variant drivers wiring runtime PM callbacks. Hook up runtime PM callbacks for the LPASS LPI variant drivers touched in this patch so they are prepared for the shared core conversion. This commit is a preparatory NOP on its own, as runtime PM is still disabled on these devices until the following core conversion patch. This is a mechanical per-variant driver update that relies on the same generic PM clock flow (of_pm_clk_add_clks() + pm_clk_suspend/ pm_clk_resume()) and DT-provided clocks. Runtime behavior was validated on Kodiak (sc7280). Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-08pinctrl: aspeed: Fix GPIO mux value for ADC-capable ballsBilly Tsai
aspeed_g7_soc1_gpio_request_enable() unconditionally writes mux function 0 to route the requested pin to GPIO. This is wrong for the ADC-capable balls W17 through AB19 (ADC0-ADC15), where function 0 selects the ADC input and function 1 selects GPIO. Requesting one of those GPIOs therefore muxed the ball to ADC instead. Write mux value 1 for balls W17 through AB19 so the GPIO function is actually selected. Fixes: 4af4eb66aac3 ("pinctrl: aspeed: Add AST2700 SoC1 support") Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-08pinctrl: Move Airoha driver to dedicated directoryChristian Marangi
In preparation for additional SoC support, move the Airoha pinctrl driver for AN7581 SoC to a dedicated directory. This is to tidy things up and keep code organized without polluting the Mediatek driver directory. The driver doesn't depend on any generic or common code from the Mediatek codebase so it can be safely moved without any modification. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-05pinctrl: renesas: rzg2l: Use raw_spinlock_irqsave() on power source updateClaudiu Beznea
The rest of the driver uses raw_spin_lock_irqsave() and raw_spin_unlock_irqrestore() for locking. To avoid concurrency issues or deadlocks, use raw_spinlock_irqsave() via the scoped_guard() helper for power source updates as well. Fixes: bbe2277dedbe ("pinctrl: renesas: rzg2l: Add support for selecting power source for {WDT,AWO,ISO}") Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260603151642.4075678-2-claudiu.beznea@kernel.org Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2026-06-01Merge tag 'renesas-pinctrl-for-v7.2-tag2' of ↵Linus Walleij
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v7.2 (take two) - Add GPIO config support on RZ/G2L, - Miscellaneous fixes and improvements. Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-06-01Merge tag 'intel-pinctrl-v7.2-1' of ↵Linus Walleij
git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v7.2-1 * Tidy up the PWM base computation to avoid false positive *SAN warnings Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-30Revert "pinctrl-amd: enable IRQ for WACF2200 touchscreen on Lenovo Yoga 7 ↵Hardik Prakash
14AGP11" This reverts commit 3812a9e84265a5cdd90d29fe8d97a023e91fb945. The probe ordering fix in the following patch ensures amd_gpio_probe() completes before i2c-designware probes AMDI0010:02, allowing the existing amd_gpio_irq_enable() flow to work correctly. The manual IRQ restoration added by this patch is therefore no longer needed. Link: https://bugzilla.kernel.org/show_bug.cgi?id=221494 Signed-off-by: Hardik Prakash <hardikprakash.official@gmail.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Fixes: 3812a9e84265a ("pinctrl-amd: enable IRQ for WACF2200 touchscreen on Lenovo Yoga 7 14AGP11") Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-29pinctrl: max77620: Unify usage of space and comma in platform_device_id arrayUwe Kleine-König (The Capable Hub)
The most accepted style for the array terminator is to use a single space between the curly braces and no trailing comma. Also don't use a comma directly before a closing brace in the other entries. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-29pinctrl: Use named initializers for platform_device_id arraysUwe Kleine-König (The Capable Hub)
Named initializers are better readable and more robust to changes of the struct definition. This robustness is relevant for a planned change to struct platform_device_id replacing .driver_data by an anonymous unit. While touching these arrays unify spacing and usage of commas. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> # renesas Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> # renesas Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-29pinctrl: qcom: Replace open coded eoi call with irq_chip_eoi_parent()Maulik Shah
Before commit 14dbe186b9d4 ("pinctrl: msmgpio: Make the irqchip immutable") msm gpio irqchip conditionally initialized pctrl->irq_chip.irq_eoi to irq_chip_eoi_parent() only for the GPIO irqs having a wakeup capable irq. In order to make gpio irqchip immutable pctrl->irq_chip.irq_eoi is initialized to msm_gpio_irq_eoi() which now gets invoked for both wake up and non-wakeup capable GPIO IRQs. Replace open coded eoi call to parent irqchip with irq_chip_eoi_parent(). Since the irq_chip_*_parent() APIs internally do not check the valid parent data is present to ensure irq_chip_eoi_parent() is only invoked for wakeup capable GPIOs validate d->parent_data within msm_gpio_irq_eoi(). For non wakeup capable GPIOs d->parent_data will be NULL since parent irqchip diconnects hierarchy using irq_domain_disconnect_hierarchy() and later irq framework trims hierarchy using irq_domain_trim_hierarchy() which makes d->parent_data as NULL. No functional impact. Reviewed-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-29pinctrl: meson: support amlogic A9 SoCXianwei Zhao
In Amlogic A9 SoC, subordinate bank reuse other master bank is not from bit0, and subordinate bank reuse multi master banks. This submission implements this situation. Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-29pinctrl: tegra238: remove unused entriesArnd Bergmann
The -Wunused-const-variable check points out a number of added entries that are currently not referenced: drivers/pinctrl/tegra/pinctrl-tegra238.c:1169:27: error: 'soc_gpio86_phh3_pins' defined but not used [-Werror=unused-const-variable=] 1169 | static const unsigned int soc_gpio86_phh3_pins[] = { | ^~~~~~~~~~~~~~~~~~~~ drivers/pinctrl/tegra/pinctrl-tegra238.c:1165:27: error: 'uart5_cts_phh2_pins' defined but not used [-Werror=unused-const-variable=] 1165 | static const unsigned int uart5_cts_phh2_pins[] = { | ^~~~~~~~~~~~~~~~~~~ drivers/pinctrl/tegra/pinctrl-tegra238.c:1161:27: error: 'uart5_rts_phh1_pins' defined but not used [-Werror=unused-const-variable=] 1161 | static const unsigned int uart5_rts_phh1_pins[] = { | ^~~~~~~~~~~~~~~~~~~ Remove them for now, they can just be added back if they get used in the future. Fixes: 25cac7292d49 ("pinctrl: tegra: Add Tegra238 pinmux driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-28pinctrl: renesas: rzg2l: Use tab instead of spacesClaudiu Beznea
Use tab instead of spaces to follow the same coding style. Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Link: https://patch.msgid.link/20260528080439.615958-5-claudiu.beznea@kernel.org Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2026-05-28pinctrl: renesas: rzg2l: Keep member documentation alignedClaudiu Beznea
Keep the documentation for struct rzg2l_pinctrl_reg_cache members aligned with the struct member order. Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Link: https://patch.msgid.link/20260528080439.615958-4-claudiu.beznea@kernel.org Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2026-05-28pinctrl: renesas: rzv2m: Use -ENOTSUPP instead of -EOPNOTSUPPClaudiu Beznea
The pinctrl and GPIO core code make exceptions for the -ENOTSUPP error code. One such example is gpio_set_config_with_argument_optional(), which returns success when gpio_set_config_with_argument() returns -ENOTSUPP, but reports failure for all other error codes. Returning -EOPNOTSUPP from the pinctrl driver on the unsupported pinctrl operation may lead to boot failures when pinctrl drivers implements struct gpio_chip::set_config, the system uses GPIO hogs, and the struct gpio_chip::set_config implementation returns -EOPNOTSUPP for the unsupported operations. Currently, the driver does not implement struct gpio_chip::set_config(). To avoid future failures, return -ENOTSUPP from rzv2m_pinctrl_pinconf_set(). rzv2m_pinctrl_pinconf_group_get() is used when dumping pinctrl configuration. pinconf_generic_dump_one(), which calls it, makes exceptions for the -EINVAL and -ENOTSUPP error codes. The documentation for struct pinconf_ops::pin_config_group_get states that it "should return -ENOTSUPP and -EINVAL using the same rules as pin_config_get()". The documentation for struct pinconf_ops::pin_config_get states: "get the config of a certain pin, if the requested config is not available on this controller this should return -ENOTSUPP and if it is available but disabled it should return -EINVAL". Return -ENOTSUPP for the unsupported pinctrl operation. Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260522105717.1727837-1-claudiu.beznea@kernel.org Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2026-05-27pinctrl: qcom: sm6115: Add egpio supportStanislav Zaikin
This mirrors the egpio support added to sc7280/sm8450/sm8250/etc. This change is necessary for GPIOs 98-112 (15 GPIOs) to be used as normal GPIOs. Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: mediatek: fix SPDX comment style in headerMayur Kumar
Header files should use the C-style '/*' block comment for SPDX license identifiers. Correct the style in pinctrl-mtk-mt8365.h to satisfy checkpatch requirements. Signed-off-by: Mayur Kumar <kmayur809@gmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: actions: fix SPDX comment style in headerMayur Kumar
Header files should use the C-style '/*' block comment for SPDX license identifiers. Correct the style in pinctrl-owl.h to satisfy checkpatch requirements. Signed-off-by: Mayur Kumar <kmayur809@gmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: bcm: fix SPDX comment style in headerMayur Kumar
Header files should use the C-style '/*' block comment for SPDX license identifiers. Correct the style in pinctrl-bcm63xx.h to satisfy checkpatch requirements. Signed-off-by: Mayur Kumar <kmayur809@gmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: cs42l43: Fix polarity on debounceCharles Keepax
The debounce bit sets a bypass on the debounce rather than enabling it, as such the current polarity of the debounce is set incorrectly. Invert the polarity to correct this. Fixes: d5282a539297 ("pinctrl: cs42l43: Add support for the cs42l43") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: cs42l43: Fix leaked pm reference on error pathCharles Keepax
Returning directly if the regmap_update_bits() fails causes a pm runtime reference to be leaked, let things run to the end of the function instead. Fixes: e52c741907fb ("pinctrl: cirrus: cs42l43: use new GPIO line value setter callbacks") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: nuvoton: ma35d1: fix MFP register offset and pin tableJoey Lu
Each GPIO bank has two 32-bit MFP registers: MFPL covering pins 0-7 at the bank base offset, and MFPH covering pins 8-15 at base offset+4. ma35_pinctrl_parse_groups() computed the register address without accounting for this split, so any pin with an index >= 8 within its bank was written to the wrong register. Also fix the pin descriptor table in pinctrl-ma35d1.c: switch from sequential to 16-per-bank pin numbering, add missing PC8-PC11 pins and their mux options, and remove the duplicate PN10-PN15 entries. Fixes: f805e356313b ("pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver") Signed-off-by: Joey Lu <a0987203069@gmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: spacemit: Use FIELD_MODIFY()Hans Zhang
Use FIELD_MODIFY() to remove open-coded bit manipulation. No functional change intended. Signed-off-by: Hans Zhang <18255117159@163.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: sophgo: Use FIELD_MODIFY()Hans Zhang
Use FIELD_MODIFY() to remove open-coded bit manipulation. No functional change intended. Signed-off-by: Hans Zhang <18255117159@163.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: tegra: Add Tegra264 pinmux driverPrathamesh Shete
Add support for the three pin controllers (MAIN, UPHY and AON) found on Tegra264. Signed-off-by: Prathamesh Shete <pshete@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: tegra: Add Tegra238 pinmux driverPrathamesh Shete
Add support for the two pin controllers (MAIN and AON) found on Tegra238. Signed-off-by: Prathamesh Shete <pshete@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-27pinctrl: tegra: Export tegra_pinctrl_probe()Prathamesh Shete
Export tegra_pinctrl_probe() to allow SoC-specific Tegra pinctrl drivers built as modules to use the common probe path. Signed-off-by: Prathamesh Shete <pshete@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-26pinctrl: spacemit: move over to generic pinmux dt_node_to_map implementationConor Dooley
Replace the custom implementation of dt_node_to_map with pinctrl_generic_dt_node_to_map() to demonstrate its use. spacemit_pin_mux_config didn't provide much value in the first place, because the group contains the information required to look up the spacemit_pin struct corresponding to a pin, so there's no loss in functionality as a result of the generic function carrying only the mux data in the group's data pointer rather than having an array of spacemit_pin_mux_config structs. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-26pinctrl: spacemit: delete spacemit_pctrl_check_power()Conor Dooley
As far as I can tell spacemit_pctrl_check_power(), called during the custom implementation of dt_node_to_map, is redundant because the driver's implementation generate_config performs the check too. Removing this would allow the driver to use the newly added common function pinctrl_generic_pinmux_dt_node_to_map(). Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-26pinctrl: add new generic groups/function creation function for pinmuxConor Dooley
Akin to my recently added pinctrl_generic_pins_functions_dt_node_to_map(), create an analogue that performs the same role of dynamically creating groups at runtime for controllers using the pinmux property. The pinmux property is freeform, so this function mandates that the upper 16 bits contain the pin and the lower 16 bits contains the mux setting. The group's data pointer is populated with an array of the mux settings for each pin it contains. Since the node parsing and subsequent pinctrl core function calls are practically identical to the pins + functions case, other than which properties are examined, it makes sense to extract the common code from pinctrl_generic_pins_function_dt_node_to_map() into a generic function that takes the case-specific devicetree parsing function as an argument. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-26pinctrl: generic: change signature of pinctrl_generic_to_map() to pass void dataConor Dooley
In order to make pinctrl_generic_to_map() usable for controllers that use pinmux, change the functions char array pointer that it passes to pinctrl_generic_add_group() to a void pointer. In the pinmux case this property will contain the mux setting as a number rather than as strings in the pins + functions case. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-26pinctrl: meson: amlogic-a4: fix gpio output glitchXianwei Zhao
When the system transitions from bootloader to kernel, the GPIO is expected to keep driving high. However, the Linux kernel first configures the pin direction and then sets the output value. This may cause a brief low-level glitch on the GPIO line, which can be problematic for regulator control. By configuring the output value before switching the pin direction to output, the glitch can be avoided. This commit fixes the issue by swapping the configuration order. Fixes: 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoCs") Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-25pinctrl: renesas: rzg2l: Populate struct gpio_chip::set_configClaudiu Beznea
Populate struct gpio_chip::set_config to allow various GPIO settings. Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260515124008.2947838-3-claudiu.beznea@kernel.org Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2026-05-25pinctrl: renesas: rzg2l: Use -ENOTSUPP instead of -EOPNOTSUPPClaudiu Beznea
The pinctrl and GPIO core code make exceptions for the -ENOTSUPP error code. One such example is gpio_set_config_with_argument_optional(), which returns success when gpio_set_config_with_argument() returns -ENOTSUPP, but reports failure for all other error codes. Returning -EOPNOTSUPP from the pinctrl driver on the unsupported pinctrl operation may lead to boot failures when pinctrl drivers implements struct gpio_chip::set_config, the system uses GPIO hogs, and the struct gpio_chip::set_config implementation returns -EOPNOTSUPP for the unsupported operations. Return -ENOTSUPP for the unsupported pinctrl operation. Fixes: 560c633d378a ("pinctrl: renesas: rzg2l: Drop oen_read and oen_write callbacks") Fixes: c4c4637eb57f ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver") Cc: stable@vger.kernel.org Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260515124008.2947838-2-claudiu.beznea@kernel.org Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2026-05-25pinctrl: renesas: rzt2h: Skip PFC mode configuration if already setLad Prabhakar
In rzt2h_pinctrl_set_pfc_mode(), read the PMC and PFC registers upfront and skip the pin function configuration if the pin is already in peripheral mode with the desired function. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260513115312.1574367-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2026-05-25pinctrl: renesas: rzt2h: Remove unused variable in rzt2h_pinctrl_register()Lad Prabhakar
Variable 'j' in rzt2h_pinctrl_register() is incremented during pin descriptor initialization but never used afterwards. Remove the unused variable and the associated dead code. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260513115312.1574367-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2026-05-25pinctrl: spacemit: fix NULL check in spacemit_pin_set_configHan Gao
spacemit_pin_set_config() looks up the per-pin descriptor with spacemit_get_pin() then checks the wrong variable for failure: const struct spacemit_pin *spin = spacemit_get_pin(pctrl, pin); ... if (!pin) return -EINVAL; reg = spacemit_pin_to_reg(pctrl, spin->pin); pin is an unsigned int pin id, where 0 (GPIO_0 / gmac0_rxdv on K3) is a valid pin, so rejecting it here drops the PAD config write for the first pin of every group. On K3 Pico-ITX the GMAC RGMII group lists pin 0 as its first entry, so its drive-strength / bias configuration was silently ignored. The intended guard is against spacemit_get_pin() returning NULL when the pin id isn't in the SoC's pin table. Check spin instead, which both restores PAD setup for pin 0 and prevents a NULL deref on spin->pin. Fixes: a83c29e1d145 ("pinctrl: spacemit: add support for SpacemiT K1 SoC") Signed-off-by: Han Gao <gaohan@iscas.ac.cn> Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Reviewed-by: Yixun Lan <dlan@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-25pinctrl: s32cc: use dev_err_probe() and improve error messagesKhristine Andreea Barbulescu
Change dev_err&return statements into dev_err_probe throughout the driver on the probing path. Signed-off-by: Andrei Stefanescu <andrei.stefanescu@oss.nxp.com> Signed-off-by: Khristine Andreea Barbulescu <khristineandreea.barbulescu@oss.nxp.com> Reviewed-by: Enric Balletbo i Serra <eballetb@redhat.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Tested-by: Enric Balletbo i Serra <eballetb@redhat.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-25pinctrl: avoid duplicate function definitionsArnd Bergmann
The pinctrl_generic_to_map() and pinctrl_generic_pins_function_dt_node_to_map() functions are built whenever CONFIG_GENERIC_PINCTRL is enabled, including configurations without CONFIG_OF. When CONFIG_OF is disabled, the dummy definitions are also present in the header, which causes the build to fail: drivers/pinctrl/pinctrl-generic.c:20:5: error: conflicting types for 'pinctrl_generic_to_map'; have 'int(struct pinctrl_dev *, struct device_node *, struct device_node *, struct pinctrl_map **, unsigned int *, unsigned int *, const char **, unsigned int, const char **, unsigned int *, unsigned int)' 20 | int pinctrl_generic_to_map(struct pinctrl_dev *pctldev, struct device_node *parent, | ^~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/pinctrl/pinctrl-generic.c:16: drivers/pinctrl/pinconf.h:193:1: note: previous definition of 'pinctrl_generic_to_map' with type 'int(struct pinctrl_dev *, struct device_node *, struct device_node *, struct pinctrl_map **, unsigned int *, unsigned int *, const char **, unsigned int, const char **, unsigned int *, void *)' 193 | pinctrl_generic_to_map(struct pinctrl_dev *pctldev, struct device_node *parent, | ^~~~~~~~~~~~~~~~~~~~~~ drivers/pinctrl/pinctrl-generic.c:130:5: error: redefinition of 'pinctrl_generic_pins_function_dt_node_to_map' 130 | int pinctrl_generic_pins_function_dt_node_to_map(struct pinctrl_dev *pctldev, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/pinctrl/pinconf.h:184:1: note: previous definition of 'pinctrl_generic_pins_function_dt_node_to_map' with type 'int(struct pinctrl_dev *, struct device_node *, struct pinctrl_map **, unsigned int *)' 184 | pinctrl_generic_pins_function_dt_node_to_map(struct pinctrl_dev *pctldev, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Removing either set of definitions is sufficient to avoid the problem. Remove the copy from the header for simplicity. Fixes: aaaf31be0426 ("pinctrl: extract pinctrl_generic_to_map() from pinctrl_generic_pins_function_dt_node_to_map()") Fixes: 43722575e5cd ("pinctrl: add generic functions + pins mapper") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-25pinctrl: starfive: jh7110: Avoid ifdefferyLinus Walleij
Use IS_ENABLED() inline assigning a variable instead of ifdeffery. Cc: Rosen Penev <rosenp@gmail.com> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/linux-gpio/CAMuHMdX7t7VHTzybjYo3s8SU3XLEH9GKsxmLBbh7p4D1CT3H_Q@mail.gmail.com/ Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-25pinctrl: starfive: jh7110: Use __counted_by() flexarrayLinus Walleij
Flexible arrays should use __counted_by() to be able to do runtime checks that the array does not go out of range. Cc: Rosen Penev <rosenp@gmail.com> Fixes: 87182ef0bf93 ("pinctrl: starfive: jh7110: use struct_size") Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-25pinctrl: aspeed: Add AST2700 SoC1 supportBilly Tsai
Implement pin multiplexing (and pin configuration where applicable) for the AST2700 SoC1 SCU pinctrl block using static SoC data tables. Unlike legacy ASPEED pin controllers, the SoC1 pin function control fields are highly regular, which makes it practical to describe the packed-field register layout directly in driver data rather than reuse the existing Aspeed pinctrl macro infrastructure. The driver uses the generic pinctrl, pinmux and pinconf frameworks. The controller registers are accessed via regmap from the parent syscon, allowing shared ownership of the SCU register block. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-25pinctrl: core: Make pin group callbacks optional for pin-only driversOleksij Rempel
Currently, the pinctrl core strictly requires all drivers to implement .get_groups_count and .get_group_name callbacks in their pinctrl_ops. However, for simple pinctrl drivers that act purely as GPIO controllers and pin-specific configuration proxies, without any concept of muxing or pin groups, this strict requirement forces the implementation of dummy callbacks just to satisfy pinctrl_check_ops(). Relax this requirement for pin-only drivers by making the group callbacks optional when no muxing or group pin configuration support is provided. Update the core and debugfs helpers to check for the existence of these callbacks before invoking them. Drivers that provide muxing or group pin configuration operations still must implement group enumeration and naming callbacks, and are rejected at registration time if they do not. Suggested-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-25pinctrl: mcp23s08: Read spi-present-mask as u8 not u32Judith Mendez
The binding (microchip,mcp23s08) specifies microchip,spi-present-mask as uint8, but driver would read u32, causing type mismatch. Use device_property_read_u8 to match binding spec, hardware (8 chips max), & prevent probe failure. Cc: stable@vger.kernel.org Fixes: 3ad8d3ec6d87 ("dt-bindings: pinctrl: convert pinctrl-mcp23s08.txt to yaml format") Signed-off-by: Judith Mendez <jm@ti.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-25pinctrl: mcp23s08: Initialize mcp->dev and mcp->addr before regmap initJudith Mendez
Regmap initialization triggers regcache_maple_populate() which attempts SPI read to populate cache. SPI read requires mcp->dev and mcp->addr to be set, without them, NULL pointer dereference occurs during probe. Move initialization before mcp23s08_spi_regmap_init() call. Cc: stable@vger.kernel.org Fixes: f9f4fda15e72 ("pinctrl: mcp23s08: init reg_defaults from HW at probe and switch cache type") Signed-off-by: Judith Mendez <jm@ti.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-05-23pinctrl: qcom: eliza: Merge QUP1_SE4 lanes in groupsAbel Vesa
QUP1_SE4 uses GPIO36 and GPIO37 for two selectable lane pairs. The current driver exposes lanes 0, 1, 2 and 3 as independent functions. However, since these are usually configured in pairs in devicetree, it makes more sense to merge them into groups. So merge the per-lane functions into qup1_se4_01 and qup1_se4_23, and list both GPIO36 and GPIO37 in each function group. Fixes: 4f5b1f4e770b ("pinctrl: qcom: eliza: Split QUP1_SE4 lanes") Suggested-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>