summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
AgeCommit message (Collapse)Author
5 daysMerge tag 'pinctrl-v7.4-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "Nothing special really, some new drivers, the usual trickle of fixes. Oddly not even vary many LLM-assisted fixes, I guess they haven't found their way into this subsystem yet. Core changes: - Support input-debounce-ns pin config property. New drivers: - Qualcomm: - Hawi SoC TLMM and LPASS LPI TLMM - Kuno (ARM32!) SoC TLMM - MSM8952 SoC TLMM - PMAU0102 SPMIO GPIO - Starfive JHB100 SoC sys0, sys0h, sys1, sys2, per0, per1, per2 per2pok and per3 (apparently strongly modularized silicon) - Ambarella CV75 - Apple T8140 SoC used in iPhone 16 [Pro] and MacBook Neo - Econet EN7528 - Allwinner Sunxi A733 - Mediatek MT6735 Improvements: - Renesas RZ/3GL: SD channel PoC, I2C power source etc - The SCMI pin controller uses generic helpers for handling groups and functions" * tag 'pinctrl-v7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (106 commits) pinctrl: stm32: program the EXTI mux from .alloc instead of .activate pinctrl: stm32: Fix the unit of the hwspinlock timeout pinctrl: stm32: Fix fwnode reference leak in stm32_gpiolib_register_bank() dt-bindings: pinctrl: brcm,nsp-gpio: Convert to DT schema pinctrl: mediatek: Add MT6735 pinctrl driver dt-bindings: pinctrl: mediatek,mt6779-pinctrl: Add bindings for MT6735 pin controller dt-bindings: pinctrl: mediatek,mt6779-pinctrl: Document MT6765 pin controller dt-bindings: pinctrl: mediatek,mt6779-pinctrl: Add MT6795 dt-bindings: pinctrl: mediatek,mt6779-pinctrl: Improve pinctrl subnode and property descriptions dt-bindings: pinctrl: mediatek,mt6779-pinctrl: Pull pinctrl node changes from MT6795 document pinctrl: tegra: xusb: free maps on DT map failure pinctrl: sprd: free maps on DT map failure pinctrl: kconfig: Select generic pinctrl helpers for scmi pinctrl pinctrl: scmi: Replace pinctrl ops get group info with generics pinctrl: scmi: Replace pinmux ops get function info with generics pinctrl: ambarella: fix NULL vs IS_ERR() bug in amb_pinctrl_register() pinctrl: starfive: fix missing CONFIG_OF dependencies pinctrl: ambarella: add CONFIG_OF dependency pinctrl: apple: Add t8140-pinctrl support dt-bindings: pinctrl: apple,pinctrl: Add t8140 compatible ...
7 daysMerge tag 'gpio-updates-for-v7.4-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "Nothing stands out as particularly interesting, it's been a calm cycle. We have three new drivers, support for more models and lots of updates across many modules (details are in the signed tag as usual). There are also some minor changes and additions to the in-kernel GPIO API. GPIO core: - provide a new controller API: gpiochip_generic_get_config() - return -EOPNOTSUPP instead of -ENODEV to user-space if it requests hardware timestamping on systems where it's unavailable (no user-space regressions reported) New drivers: - add a driver for ROHM BD73800 PMIC GPIO controller - add a driver for Axiado AX3005 SGPIO controller - add a driver for Analog Devices AD7768 GPIO controller New hardware support: - extend gpio-rcar with support for R-Car X5H (R8A78000) - extend gpio-tegra186 with support for Tegra 268 Driver changes: - refactor and improve gpio-rtd1625: switch to modern or better fitting interfaces and improve coding style - improve error handling of return values of platform_get_irq_optional() in several drivers - normalize the return value of the gpio_chip::get() callback in gpio-siox in order to not propagate invalid values up to the GPIO core - implement gpio_chip::get_direction() for gpio-pcf857x - use managed variants of notifier registration functions in several drivers - remove legacy gpio_set_value_cansleep() as it has no more users - add pinctrl support to gpio-realtek-otto - add runtime PM support to the gpio-regmap helper module - add more ACPI GPIO quirks for various hardware - stop needlessly reading gpio_chip::base in gpio-pxa - add support for tracking of direction of generic GPIO chips with no direction registers via pinctrl backend to gpio-mmio (use the new core API: gpiochip_generic_get_config()) - use the "safe" variants of debugfs_create_file() in gpio-sloppy-analyzer - use device name as GPIO chip label in gpio-omap - refactor bit ops in gpio-dln2 - prepare gpio-it87 for upcoming kmalloc_obj() conversion Devicetree bindings: - document new model in gpio-pca95xx - allow the gpio-hogs property in gpio-zynq and fsl,qoriq-gpio - allow the gpio-ranges property in gpio-realtek-otto Misc fixes: - add missing MODULE_ALIAS() to gpio-crystalcove - fix a comment typo in example GPIO tools - fix unbalanced brackets in documentation - add names to regmaps in gpio-mvebu to avoid collisions in debugfs output - fix GPIO lookup using relative paths in GPIO ACPI" * tag 'gpio-updates-for-v7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (63 commits) gpiolib: acpi: Fix GPIO lookup using relative path gpio: legacy: Kill gpio_set_value_cansleep() dt-bindings: gpio: pca95xx: add onnn,pca9655 with nxp,pca9555 fallback gpiolib: acpi: Ignore GPIO 11 interrupt on Acer Nitro V 16S AI gpio: pxa: stop reading gpio_chip::base in direction callbacks gpio: axiado: add AX3005 SGPIO controller support dt-bindings: gpio: add Axiado AX3005 SGPIO controller gpiolib: acpi: Add quirk for Lenovo IdeaPad Slim 3 15ABR8 MAINTAINERS: Add ROHM BD73800 PMIC files gpio: bd73800: Support ROHM BD73800 PMIC GPIOs clk: bd718x7: Support ROHM BD73800 regulator: bd71828: Support ROHM BD73800 rtc: bd70528: Support RTC on ROHM BD73800 mfd: Support for ROHM BD73800 PMIC core dt-bindings: mfd: ROHM BD73800 PMIC dt-bindings: regulator: ROHM BD73800 regulators dt-bindings: rohm,bd*: Ref common ROHM bindings dt-bindings: mfd: Common ROHM PMIC properties gpio: siox: normalize return value of gpio_get() gpio: dln2: use assign_bit() where applicable ...
14 dayspinctrl: stm32: program the EXTI mux from .alloc instead of .activateJu Nan
stm32_gpio_domain_activate() writes the EXTI interrupt multiplexer through a regmap obtained from the generic syscon driver. The irq core calls .activate from __setup_irq() with the raw desc->lock held, so this happens in a raw atomic section. regmap-mmio sets fast_io, and syscon does not ask for a raw spinlock, so the regmap is protected by a spinlock_t. On PREEMPT_RT that is a sleeping lock, which must not be taken there. lockdep reports it as soon as a GPIO interrupt is requested: [ BUG: Invalid wait context ] 7.1.13 #7 Not tainted ----------------------------- kworker/u8:1/29 is trying to lock: (syscon:117:(&syscon_config)->lock){....}-{3:3}, at: regmap_lock_spinlock other info that might help us debug this: context-{5:5} 5 locks held by kworker/u8:1/29: #0: ((wq_completion)async){+.+.}-{0:0}, at: process_one_work #1: ((work_completion)(&entry->work)){+.+.}-{0:0}, at: process_one_work #2: (&dev->mutex){....}-{4:4}, at: __device_attach_async_helper #3: (&desc->request_mutex){+.+.}-{4:4}, at: __setup_irq #4: (&irq_desc_lock_class){-...}-{2:2}, at: __setup_irq The driver was already aware of running in atomic context there: it uses the _in_atomic() hwspinlock primitives around the very same access. The syscon lock is the one lock in that section it does not control. Program the mux from .alloc instead, which runs in a sleepable context. That callback already owns this resource: it reserves the mux line in pctl->irqmux_map under irqmux_lock, so writing the value it just claimed is a natural fit, and the value only depends on the bank. Nothing requires the mux to be reprogrammed at interrupt startup time: the domain has no .deactivate, .free() only releases the irqmux_map bit without touching the registers. Keep the access inside the existing irqmux_lock section rather than after it. hwspin_lock_timeout_in_atomic() deliberately skips the local lock that the other hwspinlock modes take, so its caller is responsible for disabling preemption and for excluding other local contexts; every other hwspinlock user in this driver relies on bank->lock for that. irqmux_lock plays the same role here, and it also turns the mux reservation and the mux write into a single critical section. Nesting the regmap spinlock_t inside irqmux_lock, itself a spinlock_t, is what the wait-context checker expects. Note that this bounds the semaphore hold time on !PREEMPT_RT only. On PREEMPT_RT spinlock_t disables neither interrupts nor preemption, so the hardware semaphore can be held across a preemptible section and a coprocessor contending for it may poll for an unbounded time. That is not introduced here: bank->lock is a spinlock_t too, so every existing hwspinlock user in this driver behaves the same way on PREEMPT_RT. Removing that exposure requires the EXTI mux regmap to be raw-spinlock based, which the syscon core does not currently offer, and is left for a separate change. While moving the code, release the mux reservation when the hwspinlock cannot be taken, which the .activate callback had no way of doing. Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Closes: https://lore.kernel.org/all/20220202174430.pf37tt6lua2op3gc@pengutronix.de/ Signed-off-by: Ju Nan <junan76@163.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
14 dayspinctrl: stm32: Fix the unit of the hwspinlock timeoutJu Nan
HWSPNLCK_TIMEOUT is passed to hwspin_lock_timeout_in_atomic(), whose timeout argument is in milliseconds, not microseconds: atomic_delay += HWSPINLOCK_RETRY_DELAY_US; if (atomic_delay > to * 1000) return -ETIMEDOUT; The hwspinlock core documents this explicitly: If the mode is HWLOCK_IN_ATOMIC (called from an atomic context) the timeout is handled with busy-waiting delays, hence shall not exceed few msecs. Fixes: 290a9f937e5a ("pinctrl: stm32: use the hwspin_lock_timeout_in_atomic() API") Signed-off-by: Ju Nan <junan76@163.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-14Merge tag 'intel-pinctrl-v7.4-1' of ↵Linus Walleij
git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v7.4-1 * Enable pure platform device enumeration for the Intel pin control Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-14pinctrl: stm32: Fix fwnode reference leak in stm32_gpiolib_register_bank()Ma Ke
stm32_gpiolib_register_bank() walks the "gpio-ranges" property with fwnode_property_get_reference_args(). As documented in drivers/base/property.c: * The caller is responsible for calling fwnode_handle_put() on the * returned @args->fwnode pointer. The returned reference is never put. The function calls the helper twice, once directly and then repeatedly in a while loop, and each call overwrites args, so only the last reference is even reachable and all the earlier ones are leaked for good. Put the reference as soon as args.args[] has been consumed, both for the initial call and for every iteration of the loop. Found by code review. Cc: stable@vger.kernel.org Fixes: bb949ed9b16b ("pinctrl: stm32: Switch to use for_each_gpiochip_node() helper") Signed-off-by: Ma Ke <make_ruc2021@163.com> Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-12pinctrl: sunxi: dt: do not accumulate npins across probe attemptsPablo Mazzini
init_pins_table() adds to npins in the driver's static descriptor, so after a probe deferral the count doubles and the next probe fails with "pin 0 already registered". Reset it first. Signed-off-by: Pablo Mazzini <pmazzini@gmail.com> Fixes: f5e2cd34b12f ("pinctrl: sunxi: allow reading mux values from DT") Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-08Merge tag 'pinctrl-qcom-updates-for-v7.4-rc1' of ↵Linus Walleij
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel Qualcomm pin control updates for v7.4-rc1 New drivers: - add the TLMM drivers for Kuno and MSM8952 - add the LPASS LPI driver for Hawi New model support: - support PMAU0102 GPIO in pinctrl-spmi-gpio Driver improvements: - fix/unify naming convention in defines specific to Qualcomm pinctrl drivers - extend debugfs verbosity for pinctrl-lpass-lpi - make the return type from kcalloc() const in tlmm-test Devicetree bindings: - add binding documents for new drivers - document compatibles for new models - document the gpio-line-names property for qcom,sc8280xp-tlmm Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-08Merge tag 'pinctrl-qcom-fixes-for-v7.3-rc7' of ↵Linus Walleij
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into fixes Qualcomm pin control fixes for v7.3-rc7 - fix intr_target_width in several qualcomm pinctrl drivers - make direction changes exclusive in pinctrl-spmi-gpio - fix function issues in pinctrl-ipq5018 - add missing OF module alias to pinctrl-ipq5210 - split QUP1 SE2/SE3 into lane-pair functions Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-07pinctrl: mediatek: Add MT6735 pinctrl driverYassine Oudjana
Add a driver for the MediaTek MT6735 SoC pin controller. This driver also supports the pin controller on MT6735M, which lacks 6 physical pins (198-203) used for MSDC2 on MT6735. Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-07pinctrl: amd: Clear S4 wake bits when firmware has _AEIMario Limonciello
Commit ffe8a0c6b552 ("pinctrl-amd: Don't clear S4 wake bits at probe") preserves firmware-programmed S4 wake sources because some PCIe devices rely on them for Wake-on-LAN. The system that motivated that change does not expose ACPI GPIO events through _AEI. On a Chuwi CoreBook Plus, firmware exposes _AEI but also leaves the S4/S5 wake bit set for GPIO 24. This causes the machine to power back on immediately after shutdown even though Wake-on-LAN is not enabled. GPIO register dumps show that the only relevant difference is bit 15 on GPIO 24. Clearing that bit makes the machine remain off. GPIO 24 is not itself listed in _AEI, so _AEI is not a per-pin indication of which pins the OS manages; it is a platform level signal of which wake model the firmware follows. Use that signal to decide what to clear. Continue clearing S0i3/S3 bits on every system. Clear S4 bits when firmware exposes _AEI, indicating that the platform hands GPIO events to the OS, but preserve S4 bits when _AEI is absent so that firmware-programmed sources such as PCIe PME that bypass the GPIO IRQ wake API keep working. A platform that exposes _AEI for some pins while routing a wake capable device through a raw GPIO not listed in _AEI would lose that wake source unless firmware re-arms it during the sleep transition. No such system has been reported. Fixes: ffe8a0c6b552 ("pinctrl-amd: Don't clear S4 wake bits at probe") Reported-by: Olzhas Marat <marat.olzhas@gmail.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222041 Cc: stable@vger.kernel.org Tested-by: Olzhas Marat <marat.olzhas@gmail.com> Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-07pinctrl: tegra: xusb: free maps on DT map failureJiale Yao
tegra_xusb_padctl_parse_subnode() can append mappings before a later child or configuration operation fails. The top-level callback currently returns the error while retaining all mappings allocated for earlier children. Free the accumulated map on failure. The caller ignores the output parameters when the mapping callback returns an error, so they do not need to be reset after freeing the map. Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-07pinctrl: sprd: free maps on DT map failureJiale Yao
sprd_dt_node_to_map() reserves map storage before adding mux and configuration entries. If a later operation fails, the error path only frees the temporary configurations and leaves the map allocation reachable through the output pointer. Free the partially built map on failure. The caller ignores the output parameters when the mapping callback returns an error, so they do not need to be reset after freeing the map. Fixes: 41d32cfce1ae ("pinctrl: sprd: Add Spreadtrum pin control driver") Signed-off-by: Jiale Yao <yaojiale02@163.com> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-07pinctrl: kconfig: Select generic pinctrl helpers for scmi pinctrlAlex Tran
Select the corresponding pinctrl and pinmux generic Kconfig symbols when PINCTRL_SCMI is enabled. Signed-off-by: Alex Tran <alex.tran@oss.qualcomm.com> Acked-by: Sudeep Holla <sudeep.holla@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-07pinctrl: scmi: Replace pinctrl ops get group info with genericsAlex Tran
During probe, populate the pinctrl device with group info so that the generic callbacks can be used to fetch group count, name, and pins. Signed-off-by: Alex Tran <alex.tran@oss.qualcomm.com> Acked-by: Sudeep Holla <sudeep.holla@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-07pinctrl: scmi: Replace pinmux ops get function info with genericsAlex Tran
During probe, populate the pinctrl device with function info so that the generic callbacks can be used to fetch function count, name, and groups. Remove locally stored functions since caching them in this driver is no longer needed. Signed-off-by: Alex Tran <alex.tran@oss.qualcomm.com> Acked-by: Sudeep Holla <sudeep.holla@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-06pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12Adriel Santos
The pingroup table has gcc_plltest at function 5 of gpio12 and does not offer pwm2 on that pin, so the pinmux core rejects a request for pwm2 on gpio12 as an invalid group. On the hardware, function 5 of gpio12 carries the PWM2 output: the Xiaomi AX3000T v2 drives its blue status LED from PWM2 on gpio12. The vendor kernel shipped on that router (Linux 4.4, stock firmware 2.0.28) has pwm2 in this slot. Its pingroup table, as read from the firmware image, lists these functions for gpio12: gpio, blsp0_spi, blsp0_i2c, blsp1_uart0, _, pwm2, qdss_tracedata_a, _, _, _ and has pwm3 at function 4 of gpio13, matching commit c6c159fcdb4e ("pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13"). Measured on the board: with gpio12 set to each of the 16 function values in turn, and PWM2 held at 0% and then at 100% duty, the pad level read back from GPIO_IN follows PWM2 only at function 5. There it does not follow PWM channels 0, 1 or 3, and the LED switches with PWM2. Functions 4 and 7, which the table leaves empty, do not carry PWM2. Put pwm2 in function 5 of gpio12 and list gpio12 in pwm2_groups. Drop gpio12 from gcc_plltest_groups: none of its functions is gcc_plltest any more, and selecting it would trigger the WARN_ON() in msm_pinmux_set_mux(). Fixes: 725d1c891658 ("pinctrl: qcom: Add IPQ5018 pinctrl driver") Assisted-by: LLM Signed-off-by: Adriel Santos <adriel@adriel.eu> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://patch.msgid.link/20261002160958.908424-1-adriel@adriel.eu Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-10-02pinctrl: ambarella: fix NULL vs IS_ERR() bug in amb_pinctrl_register()Dan Carpenter
The devm_kasprintf_strarray() function never returns NULL, it returns error pointers on error or a valid pointer on success. Fix the error checking to match. Fixes: b40e9d140c24 ("pinctrl: ambarella: add CV75 pin controller") Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-02pinctrl: starfive: fix missing CONFIG_OF dependenciesArnd Bergmann
The common driver portion requires CONFIG_OF, but the drivers selecting it do not, so we get random warnings: WARNING: unmet direct dependencies detected for PINCTRL_STARFIVE_JHB100 Depends on [n]: PINCTRL [=y] && OF [=n] Selected by [y]: - PINCTRL_STARFIVE_JHB100_PER1 [=y] && PINCTRL [=y] && (ARCH_STARFIVE || COMPILE_TEST [=y]) - PINCTRL_STARFIVE_JHB100_PER2POK [=y] && PINCTRL [=y] && (ARCH_STARFIVE || COMPILE_TEST [=y]) - PINCTRL_STARFIVE_JHB100_SYS1 [=y] && PINCTRL [=y] && (ARCH_STARFIVE || COMPILE_TEST [=y]) Selected by [m]: - PINCTRL_STARFIVE_JHB100_PER0 [=m] && PINCTRL [=y] && (ARCH_STARFIVE || COMPILE_TEST [=y]) - PINCTRL_STARFIVE_JHB100_SYS0 [=m] && PINCTRL [=y] && (ARCH_STARFIVE || COMPILE_TEST [=y]) Apparently the problem is selecting CONFIG_OF_GPIO, which is a mistake the newly added driver copied from others. This was recently cleaned up with commit e785c990adcc ("pinctrl: Kconfig: drop unneeded dependencies on OF_GPIO"). Do the same here for consistency and to avoid the warning. Fixes: 9c4d0c8fc4c1 ("pinctrl: starfive: Add StarFive JHB100 sys0 controller driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-02pinctrl: ambarella: add CONFIG_OF dependencyArnd Bergmann
On randconfig builds without CONFIG_OF, this driver fails to link: x86_64-linux-ld: vmlinux.o: in function `pinconf_generic_dt_node_to_map_all': pinctrl-ambarella.c:(.text+0x54cdf0): undefined reference to `pinconf_generic_dt_node_to_map' Enforce OF as a dependency as we do for other such drivers. Fixes: b40e9d140c24 ("pinctrl: ambarella: add CV75 pin controller") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: apple: Add t8140-pinctrl supportYureka Lilian
Ensure the regmap does not attempt to read REG_GPIOx of any of the pins marked with gpio-reserved-ranges. For this purpose, move the regmap_init just before the first regmap_read, at which point the valid_mask has been populated from the gpio-reserved-ranges device tree property. With this, make the driver accept the new t8140 base compatible as with this modifications the driver can now be loaded on this SoC without crashing. Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: mediatek: mt7629: fix the 2.4 GHz Wi-Fi pin mode arrayChuanhong Guo
The wf0_2g group contains nine pins but only eight mux values. mtk_pinmux_set_mux() indexes the mode array once for each pin, reading past its end when configuring pin 78 (WF0_2G_HB6). This can select an unrelated mux value or fail with -EINVAL, preventing the Wi-Fi device from probing. Add the missing mode 1 entry for WF0_2G_HB6. Fixes: b44677375fee ("pinctrl: mediatek: add pinctrl support for MT7629 SoC") Signed-off-by: Chuanhong Guo <gch981213@gmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: s32cc: Remove const from groups allocation typeKees Cook
In preparation for making the devm_kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "const char **", but the converted allocation type would be "const char * const *", as the size was taken from "*func->groups", whose type "const char * const" is const qualified. As there is no general way to remove const qualifiers, take the size from the assignment target instead. No change in allocation size results. Build tested ARCH=arm64 allmodconfig with GCC aarch64-linux-gnu 16.1.0: drivers/pinctrl/nxp/pinctrl-s32cc.o Assisted-by: LLM coccinelle Signed-off-by: Kees Cook <kees+treewide@kernel.org> Reviewed-by: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: sunplus: fix kernel-doc parameter descriptions in sppctl.cAndrew Gaylard
Add missing parameter descriptions to kernel-doc comments for sppctl_func_set(), sppctl_gmx_set(), sppctl_first_get(), sppctl_master_get(), and sppctl_fully_pinmux_conv(), fixing all W=1 kernel-doc warnings in this file. Improve the phrasing of some the other comments in this file, while we're at it. The warnings for sppctl_func_set() (@val) and sppctl_gmx_set() (@pctl) were newly introduced by commit 7dcf87d2dbbe ("pinctrl: fix PINCTRL_SPPCTL=m"); the rest were pre-existing. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202609240204.VHoUp5qw-lkp@intel.com/ Signed-off-by: Andrew Gaylard <ag@ffroot.co.za> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: qcom: ipq5018: update PWM groups and corresponding pin functionsGeorge Moussalem
On multiple Linksys routers, GPIOs 1, 30, and 46 drive the PWM LED on the PWM1, PWM3, and PWM0 channels, respectively. Update the corresponding PWM groups to include these GPIOs and allocate the PWM functions to empty slots in the relevant pin groups. Signed-off-by: George Moussalem <george.moussalem@outlook.com> Link: https://patch.msgid.link/20260928-ipq5018-pwm-functions-v2-1-87bbcd706bc6@outlook.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-10-01pinctrl: pinctrl-generic-mux: Fix provider resource leak on re-parseChancel Liu
The pinctrl core re-parses a consumer's pinctrl on every probe attempt (pinctrl_bind_pins() runs before the driver's probe(), and again on each deferred-probe retry or re-bind), so .dt_node_to_map() must be side-effect free and safe to call repeatedly. mux_pinmux_dt_node_to_map() instead allocated provider-side resources on every call - the mux_pin_function, the group name table and a mux_state reference, plus a group name and a pinctrl_generic_add_group() registration via pinctrl_generic_to_map(). All of these are allocated with devm_*() against the provider device, so they live for the provider's lifetime and are only released when the provider itself is unbound. The .dt_free_map() path never touches them; it frees the per-consumer pinctrl_map only. Every re-parse therefore adds another set of provider-side allocations that are never reclaimed, so a consumer that repeatedly defers probe or is re-bound leaks memory and mux_state references on the provider without bound. The groups and functions of a board-level mux are static and fully described by the device tree, so build them once at probe time in the new mux_pinctrl_probe_dt(). mux_pinmux_dt_node_to_map() then only looks up the already registered group and builds the per-consumer mux map, which the core frees via .dt_free_map. As the mux has no pin electrical configuration, no config map is emitted. Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://sashiko.dev/#/patchset/20260824022020.2812810-1-chancel.liu%40oss.nxp.com Fixes: 34acc5a8adfb ("pinctrl: add generic board-level pinctrl driver using mux framework") Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Assisted-by: LLM Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01Merge branch 'ib-ambarella-pinctrl' into develLinus Walleij
2026-10-01pinctrl: ambarella: add CV75 pin controllerLong Zhao
Add an Ambarella pinmux-only pinctrl driver with CV75 function/group tables. GPIO is handled by the PL061 driver. Signed-off-by: Long Zhao <longzhao@ambarella.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: axp209: Drop check for disabled devicesUwe Kleine-König
Since commit 6b5c350648b8 ("mfd: mfd-core: Honour Device Tree's request to disable a child-device") the mfd core checks for disabled devices, so there is no use in doing that again in the mfd child driver. Drop the check. Signed-off-by: Uwe Kleine-König <ukleinek@debian.org> Reviewed-by: Chen-Yu Tsai <wens@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: amd: Add support for the Remote GPIO (RGPIO) bankBasavaraj Natikar
Some AMD platforms expose a second GPIO bank, Remote GPIO (RGPIO), covering pins 256-271 through a separate register region advertised by name. Add support for these pins, including their interrupts, when the region is advertised and the main bank spans the expected number of registers, so they are usable like the main bank pins. The RGPIO pins stay inactive on platforms that do not expose the region. Co-developed-by: Matt DeVillier <Matt.Devillier@amd.com> Signed-off-by: Matt DeVillier <Matt.Devillier@amd.com> Co-developed-by: Guruvendra Punugupati <Guruvendra.Punugupati@amd.com> Signed-off-by: Guruvendra Punugupati <Guruvendra.Punugupati@amd.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: amd: Factor out optional named resource lookupBasavaraj Natikar
The optional iomux resource is looked up by name. A following patch needs the same lookup for another optional resource, along with a minimum size check. Factor it out into a helper that also rejects a resource smaller than a caller-supplied size. No functional change for iomux. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: amd: Centralize per-pin register accessBasavaraj Natikar
Add a helper to translate a pin into its per-pin register address and use it at every per-pin access, so a second GPIO bank added later can be addressed from a single place. No functional change. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: starfive: Add StarFive JHB100 per3 controller driverChanghuang Liang
Add pinctrl driver for StarFive JHB100 SoC Peripheral-3(per3) pinctrl controller. Co-developed-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: starfive: Add StarFive JHB100 per2pok controller driverChanghuang Liang
Add pinctrl driver for StarFive JHB100 SoC Peripheral-2 Power OK (per2pok) pinctrl controller. Co-developed-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: starfive: Add StarFive JHB100 per2 controller driverChanghuang Liang
Add pinctrl driver for StarFive JHB100 SoC Peripheral-2(per2) pinctrl controller. Co-developed-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: starfive: Add StarFive JHB100 per1 controller driverChanghuang Liang
Add pinctrl driver for StarFive JHB100 SoC Peripheral-1(per1) pinctrl controller. Co-developed-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: starfive: Add StarFive JHB100 per0 controller driverChanghuang Liang
Add pinctrl driver for StarFive JHB100 SoC Peripheral-0(per0) pinctrl controller. Co-developed-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: starfive: Add StarFive JHB100 sys2 controller driverChanghuang Liang
Add pinctrl driver for StarFive JHB100 SoC System-2(sys2) pinctrl controller. Co-developed-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: starfive: Add StarFive JHB100 sys1 controller driverChanghuang Liang
Add pinctrl driver for StarFive JHB100 SoC System-1(sys1) pinctrl controller. Co-developed-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: starfive: Add StarFive JHB100 sys0h controller driverChanghuang Liang
Add pinctrl driver for StarFive JHB100 SoC System-0 Host(sys0h) pinctrl controller. Co-developed-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: starfive: Add StarFive JHB100 sys0 controller driverChanghuang Liang
Add pinctrl driver for StarFive JHB100 SoC System-0(sys0) pinctrl controller. Simultaneously add a generic pinctrl driver framework for registering the pinctrl of other domains (sys1, sys2, and so on) in the JHB100 SoC. Co-developed-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Lianfeng Ouyang <lianfeng.ouyang@starfivetech.com> Signed-off-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-10-01pinctrl: pinconf-generic: Add property 'input-debounce-ns'Changhuang Liang
Add 'input-debounce-ns' to the generic parameters used for parsing DT files, along with the corresponding configuration parameter PIN_CONFIG_INPUT_DEBOUNCE_NS. This allows debounce time to be specified in nanoseconds as an alternative to the existing 'input-debounce' property which uses microseconds Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-30pinctrl: imx: Remove const from group_names allocation typeKees Cook
In preparation for making the devm_kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "const char **", but the converted allocation type would be "const char * const *", as the size was taken from "*func->groups", whose type "const char * const" is const qualified. As there is no general way to remove const qualifiers, take the size from the assignment target instead. No change in allocation size results. Build tested ARCH=x86_64 allmodconfig with GCC 16.2.0: drivers/pinctrl/freescale/pinctrl-imx.o Assisted-by: LLM coccinelle Signed-off-by: Kees Cook <kees+treewide@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-30pinctrl: mediatek: Fix eint->base allocation typeKees Cook
In preparation for making the devm_kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) This allocates the single-entry array that mtk-eint expects (nbase is set to 1). The assigned type is "void __iomem **", but the converted allocation type would be "void __iomem ***", as the size was taken from "pctl->eint->base" itself rather than from what it points at. Luckily "void __iomem **" and "void __iomem *" are the same size. Take the size from the pointed-at type to match the assignment. Build tested ARCH=x86_64 allmodconfig with GCC 16.2.0: drivers/pinctrl/mediatek/pinctrl-mtk-common.o Assisted-by: LLM coccinelle Signed-off-by: Kees Cook <kees+treewide@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-30pinctrl: gemini: fix kernel-doc warningsAryan Sinha
struct gemini_pmx documents a virtbase member that does not exist and leaves pctl undocumented. struct gemini_pmx_func is missing num_groups. Drop the stale entry and add the two missing ones. No functional change. Signed-off-by: Aryan Sinha <sinha.aryan03@gmail.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-30pinctrl: stm32: Fix clock reference leak in stm32_pctl_probe()Wentao Liang
stm32_pctl_probe() obtains one clock per bank with of_clk_get_by_name(), but none of the error paths drop those references: the loop returns directly when a later clock lookup fails, and both the clk_bulk_prepare_enable() failure and the err_register path return without calling clk_bulk_put(). clk_bulk_disable_unprepare() only disables the clocks, it does not release them. Release the references on these paths; the success path keeps them as the driver needs them for suspend/resume. Fixes: 451bc9aea9a1 ("pinctrl: stm32: Add check for clk_enable()") Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-30pinctrl: nuvoton: Fix clock reference leak in ma35_get_bank_data()Wentao Liang
ma35_get_bank_data() obtains the bank clock with of_clk_get() and stores it in bank->clk, but returns clk_prepare_enable() directly. If that call fails, the reference taken by of_clk_get() is never dropped, and the driver has no other clk_put() for it. Drop the reference when clk_prepare_enable() fails. Fixes: f805e356313b ("pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver") Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-28pinctrl: qcom: spmi-gpio: make direction changes exclusiveShawn Guo
Neither direction callback clears the opposite buffer: .direction_output() only packs PIN_CONFIG_LEVEL and .direction_input() only packs PIN_CONFIG_INPUT_ENABLE. As pmic_gpio_populate() seeds input_enabled and output_enabled from MODE_CTL, a pad left in DIGITAL_INPUT[_OUTPUT] by the bootloader ends up in DIGITAL_INPUT_OUTPUT whichever direction is requested. That leaves an input still driving the line, and makes pmic_gpio_get_direction() report an output as an input, which breaks consumers that read the direction back: reg-fixed-voltage regulator-wcn-core-vm-1p35: setup of GPIO (default) failed: -1 reg-fixed-voltage regulator-wcn-core-vm-1p35: error -EPERM: can't get GPIO Pack the opposite buffer's PIN_CONFIG_*_ENABLE along with the requested direction, so MODE_CTL becomes DIGITAL_INPUT or DIGITAL_OUTPUT, never both. pmic_gpio_config_set() writes the registers once after walking all configs, so this stays a single write. An open-drain or open-source output is the exception: it only drives one rail, so pmic_gpio_get() needs the input buffer to sample the line rather than return the value last written. Program the input buffer from pad->buffer_type, which gpiolib has already updated via PIN_CONFIG_DRIVE_OPEN_DRAIN, and key pmic_gpio_get_direction() off output_enabled so such pads still read back as outputs. Genuinely bidirectional pads can still be described that way through pinconf; the gpiolib callbacks now mean what gpiolib says they mean. Fixes: 263447532463 ("pinctrl: qcom: spmi-gpio: implement .get_direction()") Assisted-by: LLM Reviewed-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com> Link: https://patch.msgid.link/20260927010913.1212600-1-shengchao.guo@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-09-28Merge tag 'v7.3-rc5' of ↵Bartosz Golaszewski
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into pinctrl-qcom/for-current Linux 7.3-rc5
2026-09-22pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13Gilberto Conde
GPIO13 supports the PWM3 function at mux select value 4, but the pingroup table leaves that slot empty and gpio13 is not listed in pwm3_groups. Selecting pwm3 on gpio13 is therefore rejected by the pinmux core: ipq5018-tlmm: invalid group "gpio13" for function "pwm3" The GL.iNet GL-X2000 drives its fan from PWM3 on this pin, and the vendor firmware muxes it with select value 4: gpio13 : out low func4 8mA no pull Add pwm3 to the fourth function slot of gpio13 and list gpio13 in pwm3_groups. With this the pin muxes as expected: pin 13 (GPIO_13): device 1941010.pwm function pwm3 group gpio13 Fixes: 725d1c891658 ("pinctrl: qcom: Add IPQ5018 pinctrl driver") Signed-off-by: Gilberto Conde <gilbertorconde@gmail.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260921093419.2870168-1-gilbertorconde@gmail.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>