Commit Graph

8026 Commits

Author SHA1 Message Date
Linus Torvalds
cf9610f911 Pin control bulk changes for kernel v7.3
Core changes:
 
 - Use the non-blocking mux_state_try_select() in the generic
   MUX pin control back-end.
 
 - Free pin maps on pinctrl_generic_to_map() failure in the core
   helpers.
 
 New drivers:
 
 - Qualcomm Maili TLMM SoC pin control.
 
 - Qualcomm PMG1110 PMIC pin control.
 
 - Qualcomm Eliza LPASS LPI TLMM SoC pin control (this is for
   the low power audio, LPASS = Low Power Audio SubSystem
   portions).
 
 - Upboard support on top of the Intel pin controller.
 
 - Apple T6030 and T6031 support (just compatible strings).
 
 - Samsung Exynos 8855 SoC pin control.
 
 - Mediatek MT6858 SoC pin control.
 
 - Rockchip RK3308B SoC pin control.
 
 - Rockchip RV1106 SoC pin control.
 
 - Airoha EN7523 SoC pin control.
 
 - Airoha AN7563 SoC pin control.
 
 Improvements:
 
 - Qualcomm TLMM GPIOs are unconditionally marked as wakeup capable.
 
 - Qualcomm improvements on top of the Qualcomm PDC (power domain
   controller) irqchip improvements from tglx:s tree.
 
 - Qualcomm IPQ806x and IPQ9650 nonurgent pin grop fixups.
 
 - The NPCM8xx driver has been put into shape fixing many pin and
   group definitions.
 
 - Some nonurgent Tegra 264 pin assignments are fixed up.
 
 - Some nonurgent fixups to Airoha AN7581 and AN7583 registers and
   pin assignments, missing features etc.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmqMBvYACgkQQRCzN7AZ
 XXOCRw//aRnxM6R7HJkmcJt70749sE2GSbQ5Vx22zkRLRt8FA0QL4GdPQWjG+rwA
 /Q5XhMv5TpSXaBo63fFyAEHEhgbuxlgyUMijpXuMFVHB4AKIcp0P9Mn+TfTkpsIu
 QPIUktn2wqaIoFoAZj7G2KhXUyyeQnISplBSFl4wfpsJ25fjKqqeoiOMrMCVc05A
 Hfgm047beur5vkvYBIwFG0BC992l9ucSQJ4jDEm2XtkQ/NqIQBd16lYdxrb6vkJu
 Bj2qUH/GVQN3c+n2ZgfwVbkoWMum7VgBymxbnjhraJmQoGm27IQsnBtDnhD5bv6s
 bk5Y6Vyji0kNhHYU5uBFwjDWmYt5PxjXynkeFuruNuBkqnioQCyoTNlIeiJf5pZv
 kM0dBkR0eUTQVPrZX5kXbi9B2JqdbnkdhKbL2YQt1zV0uvs1m8xl3dLu+bvtHjEM
 xNghQKkSDvSHDgulbjTcKEthILSA48Q+poCaOoYre8KIOc4I7novSal6UzcHoTH7
 4D8+BnwJXbS5RRIG2snUWHRLB8aY+yuPlfAQBrAu0apuKWrnr2SjfWMMek1kDv57
 U/iXjSKvjSUQc+sYhq+cPMrD8yYqjIgfg483p4L8xsTIi0Mer6UhnHcZJ82TONTa
 K1A3iGlKOtw4jNFOeow8VAW8MyEHcnx3q70rgA2O+eH7WpT28rs=
 =sSjn
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control updates from Linus Walleij:
 "Core changes:

   - Use the non-blocking mux_state_try_select() in the generic MUX pin
     control back-end

   - Free pin maps on pinctrl_generic_to_map() failure in the core
     helpers

  New hardware pin control:

   - Qualcomm Maili TLMM SoC, PMG1110 PMIC, and Eliza LPASS LPI TLMM SoC
     (this is for the low power audio, LPASS = Low Power Audio SubSystem
     portions)

   - Upboard support on top of the Intel pin controller

   - Apple T6030 and T6031 support (just compatible strings)

   - Samsung Exynos 8855 SoC

   - Mediatek MT6858 SoC

   - Rockchip RK3308B and RV1106 SoCs

   - Airoha EN7523 and AN7563 SoCs

  Improvements:

   - Qualcomm TLMM GPIOs are unconditionally marked as wakeup capable

   - Qualcomm improvements on top of the Qualcomm PDC (power domain
     controller) irqchip improvements from tglx:s tree

   - Qualcomm IPQ806x and IPQ9650 non-urgent pin grop fixups

   - The NPCM8xx driver has been put into shape fixing many pin and
     group definitions

   - Some non-urgent Tegra 264 pin assignments are fixed up

   - Some non-urgent fixups to Airoha AN7581 and AN7583 registers and
     pin assignments, missing features etc"

* tag 'pinctrl-v7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (130 commits)
  dt-bindings: pinctrl: Convert TI DA850 pupd to DT schema
  pinctrl: meson: sync some modify from A4
  pinctrl: meson: a4: Add input enable pin configuration
  pinctrl: realtek: rtd1625: remove unused group name spdif_sel
  pinctrl: realtek: rtd1625: fix base_bit for VE4 GPIO 13
  dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema
  Revert "Merge branch 'ib-rsk7204' into devel"
  pinctrl: rockchip: Add RV1106 pinctrl support
  dt-bindings: pinctrl: rockchip: Add RV1106 compatible
  pinctrl: rockchip: Decode drive strength in the get function
  pinctrl: fix PINCTRL_GENERIC_MUX not always being selectable
  pinctrl: airoha: add support of an7563 SoC
  dt-bindings: pinctrl: airoha: add support of an7563 pin controller
  pinctrl: airoha: try to find chip scu node by phandle first
  pinctrl: airoha: add support of en7523 SoC
  dt-bindings: pinctrl: airoha: add support of en7523 pin controller
  pinctrl: airoha: an7583: add support for olt pinmux
  pinctrl: airoha: an7583: add support for pon_alt pinmux
  pinctrl: airoha: an7583: add support for npu_uart pinmux
  dt-bindings: pinctrl: airoha: an7583: add missed features
  ...
2026-08-24 08:46:03 -07:00
Bartosz Golaszewski
146cc263e4 Linux 7.2
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCgA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmqCLGoeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGJzYH/0SFjcgnk1Z3Km+3
 2kEeGAMETajW41W7+5QQkuHk83UXDxigDRoD857/d8utK90GrZAoTMS9/6zF3tra
 ht4G1yc2x7/xgVLkWii54d/sp1LEWTRDntN95fzYZwbeAXwd0AcYBlKXZYHKl4t/
 4yZCgYPmYTkewaYdbyWNPiZvCwhBUl5k1E9i/drh5IJXdgXRcqoO86FY9JX+Ks9x
 r0g+d6RIiSbDfwzgRpkBn0TRnqzh2OeBfgyrsgGZO2axwlKcA7SP0vwwT6c6nOUI
 s8F2xXrqrUI75JbSI4YbdwOSvktwbtkz83idlRAYBOdxof3LJ6i2YaxrT8iG+KUH
 l7+e18M=
 =eQMh
 -----END PGP SIGNATURE-----

Merge tag 'v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into gpio/for-next

Linux 7.2
2026-08-18 14:21:04 +02:00
Linus Walleij
d067f0f4c9 Qualcomm pinctrl updates for v7.3-rc1
New drivers:
 - add pinctrl drivers for Maili TLMM and Elize LPASS LPI TLMM controllers
 
 Driver updates:
 - acknowledge interrupts for the PDC interrupt controller in pinctrl-msm
 - implement irq_get/set_irqchip_state() for pinctrl-msm
 - add support for a new model to Qualcomm pinctrl-spmi-gpio
 - drop some dead code from qcom pinctrl modules
 
 Devicetree bindings:
 - document new TLMM controllers and the new model for the SPMI GPIO
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEkeUTLeW1Rh17omX8BZ0uy/82hMMFAmp9hDsACgkQBZ0uy/82
 hMNAfw/7B+1mXt6RwtxMBpZVDowERkscYM+/3SSDAznvvkXB+hQje4xhr+k2VIIA
 qKz1icMe0YD5cI4hWzgh0Ac9xFVYntkcTZcJeg4pn5HyEfllZQyaha6Yk1w0WQVK
 c9XaovY/scEPECoUXCtfcQ9/dipAd8xd8TTJWMC1ZG4ojk7XKh6yZPMmdeF4yYUn
 LR6nAsSduRhHLYoWtwDkCIG12iKwsUzgUSH2X6ZjqyIMjlQl1PYxTbctmagWY03k
 irYkcuPhviHb6zZtM+JEtv0cN0riG7WUfXnI324zCNTxJBCvcyRaOA/s0KUMut9L
 r1U6EG+yMkEORupwPprS3uMG/g3tWYu9iZoxukLz7cb+2LUJuP5vMzAlsBi8qPWY
 8MmgTdOHrN4tQSVBPBl9za/rw79Vz1y+BR5u/h7rhN+qmV1WsiKwMUXYxYNF9uc+
 0/pFUVelKg5DvA0flsDzKBdgiZ5RNFBcthbN8QHS861oNyYqWAau4g6iOht+PyoD
 Gld+daVpAM5MV1sulQZgURREGiXrG16f6QLTSdBjuB9lqvTdULqkK46n9dugCBui
 mlLcYEDxb92i6X36OEvqA/y3D+KW/BVrjKo/034qFCFMvK2YpTT/I448r8/tZ5bd
 aEh1YCtNUFuT/kmKQKkVq52G5UwYN9c7tS+Uug49ZAdQhrT3dCA=
 =CTqf
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-qcom-updates-for-v7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel

Qualcomm pinctrl updates for v7.3-rc1

New drivers:
- add pinctrl drivers for Maili TLMM and Elize LPASS LPI TLMM controllers

Driver updates:
- acknowledge interrupts for the PDC interrupt controller in pinctrl-msm
- implement irq_get/set_irqchip_state() for pinctrl-msm
- add support for a new model to Qualcomm pinctrl-spmi-gpio
- drop some dead code from qcom pinctrl modules

Devicetree bindings:
- document new TLMM controllers and the new model for the SPMI GPIO

Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-16 18:59:43 +02:00
Linus Walleij
e4c90e39c9 Qualcomm pin control fixes for v7.2
- fix intr_target_width for summary interrupt routing in pinctrl-shikra
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEkeUTLeW1Rh17omX8BZ0uy/82hMMFAmp9gIsACgkQBZ0uy/82
 hMPASg//Vw5Sj1HRPDplOyehxJ39m8ulsnp6A4oTnv5vAobSWL4jgq3owR15BdZq
 VKeDjMXwptNzYfSRS/kw98LjM2UTkGE1O0VrPV060IJOmSQWTkJrMNxerKxKjDRX
 R3QCnDRtKypS++mGJMR/lKP6Lt5zEX+Rv9BXeCWjks1zYbhqoH7ZE+kblsXPbiCj
 RBKNHlD1hOcPM9CSG4V79ad9dQXjCd4N3DHU0ZY3lnMBPE5hjAikQmPtE2umt1yz
 h3+EKHkvv3KgyC3WzwjPoXdDHVVL5aNc9iwSnL04b3G4E579eC/9e0oN3wO9sCjW
 3w2ggStsh9DfPI1v0Y4cCWQQuGHFZV04t5Mv/25JaM7kPHo4fGubndzTA5oA9Lsq
 jnrXjOyi6MoTETQCoYvOVAOvsQHwTX5r9xU/ZP+RJAzWIBiUTusqjpa8wWEnVaiq
 GTtykqExdNv3O7GtY8Fv6Or1wkNjZLc3lV0PNaU6X8/U8N41A0KFlnGi9OJul6gl
 cyXysep1B8O1phX7olI3sTjMwhc3jxtkJUtSx117G35GwjvzJtb/lwDJkeG8rmap
 c6QdQ0WJNsWnqIHitXoTOeF2GClPPRLVrvhCzWp8DehUC4vsihmMMuKVbIcvBTyo
 v/290KBSmfMg0FyWSXdmW/Uf6nBURJ7Hso5G5uhI9P3+Dzh7B7Q=
 =LAzZ
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-qcom-fixes-for-v7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel

Qualcomm pin control fixes for v7.2

- fix intr_target_width for summary interrupt routing in pinctrl-shikra

Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-16 18:59:23 +02:00
Xianwei Zhao
fa410c3165 pinctrl: meson: sync some modify from A4
Set the drive strength before enabling the output to avoid enabling
the output with an unintended drive strength.

Also return the actual output enable state from
PIN_CONFIG_OUTPUT_ENABLE instead of always reporting it as enabled.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-14 09:37:21 +02:00
Xianwei Zhao
44f10eb888 pinctrl: meson: a4: Add input enable pin configuration
Add support for PIN_CONFIG_INPUT_ENABLE in the Amlogic A4 pinctrl
driver.

Use the existing output enable control to configure the input enable
state, since the hardware uses the same control with inverse semantics.

Also update PIN_CONFIG_OUTPUT_ENABLE handling to return the actual
output enable state instead of treating any non-zero value as enabled.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-14 09:31:45 +02:00
Yu-Chun Lin
f080cfd001 pinctrl: realtek: rtd1625: remove unused group name spdif_sel
Remove the undefined "spdif_sel" from rtd1625_iso_spdif_in_coaxial_groups
to clean up the code.

Signed-off-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-14 09:26:52 +02:00
Yu-Chun Lin
287ff7feb1 pinctrl: realtek: rtd1625: fix base_bit for VE4 GPIO 13
Fix a typo in the base_bit of RTD1625_VE4_GPIO_13.
It was incorrectly set to 18, which overlaps with GPIO 16.

Signed-off-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-14 09:26:52 +02:00
Linus Walleij
9e48545582 intel-pinctrl for v7.3-1
* Enable CPLD pin control on UP Xtreme i12 board
 * Miscellaneous cleanup
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAmp7NiQACgkQb7wzTHR8
 rCj76RAAtCBPugRp6vJ6I/CwOgFJ8tsjK+G8o8zTdmS646ogbw6urLck5Mepxh0S
 ouJ4zHDNCuOfyupLqAbHp7+VbaV2lOKYxYSM8+1BARNJVKfHhdukv5prjSxxwuqj
 mXC39WAi/hIiSup/NQkGXBKhR7DTg/tOonIkBUqT5vSCh9+MsCf80N0sNyqsbk06
 aaiNURo6Mgt691oDVia5aZWAlohuKkdfh5qmQq8PDuxHodwYUMmL/VJNrFPpv9Eu
 Ro7RLKVBA8o8/ri+cGs3+aoWukfNieOPIw7gg7rF92pSzP85b0vXCh4SUIBdC7aq
 3rW2zjJEK/cEJNT8owyqZInusOtg1EldgssFGND4NINUwgon/9sRHIT9/urfi56b
 /F2BpdzuwW60/OtBU64xCAmCOJeRmbNQLuw9d4c9gbGvMP7ImAn8YGHb4f7hM7Q5
 OsvD0j9HX6Djnk0yNCdGeTs1O2GvuEYJBDl/R7sJl5S2ZT26zXLURstE3BgQNFh0
 FBTSlGc4TjTILmRkV5BJANh5CdjUrLDhsUT0JW9Wwuom2zNUHMlAhpbsSvfvhPEC
 zKiwY62qQ6owPYekV9zdLwD22Sbj/cMCHnPaao2CJwThpGo4gN5XCFLlB7AlxGGc
 tJwYMgJOO9Fu/tsMO+ZG/rrHpucrHNCitboi1LakU7tV4vQ3YZA=
 =1E9e
 -----END PGP SIGNATURE-----

Merge tag 'intel-pinctrl-v7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel

intel-pinctrl for v7.3-1

* Enable CPLD pin control on UP Xtreme i12 board
* Miscellaneous cleanup

Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-11 17:41:52 +02:00
Linus Walleij
fedfa225fd Revert "Merge branch 'ib-rsk7204' into devel"
This reverts commit d922b54e94, reversing
changes made to 3f0245e23a.

The SH maintainer has indicated that he want to carry these changes
in the SH tree instead, and need more time to review and merge the
changes, so reverting it out from my tree.

Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-11 08:49:40 +02:00
Simon Glass
63113d4fce pinctrl: rockchip: Add RV1106 pinctrl support
Add pinctrl support for the Rockchip RV1106, based on the vendor
kernel in the Luckfox Pico SDK [1] at commit 824b817f8 (a Linux
5.10.160 kernel tree). Each GPIO bank has its own IO control (IOC)
register block, referenced by the rockchip,grf phandle of the bank
node; the register offsets are relative to the bank's own block. The
drive strength uses the RK3568-style exponential encoding and only
pins 0-6 of GPIO0 have drive-strength registers.

The RV1103 is a package variant of the RV1106 with fewer pins and uses
the same pin controller.

[1] https://github.com/LuckfoxTECH/luckfox-pico

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://github.com/LuckfoxTECH/luckfox-pico
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-10 22:07:06 +02:00
Simon Glass
8aa25c6e88 pinctrl: rockchip: Decode drive strength in the get function
The decoding of the 2-bit and 8-bit level drive-strength values sits in
rockchip_set_drive_perpin(), where it is unreachable: the SoCs whose
banks declare these drive types (RK3506 and RV1103B) take the early
ctrl->type branch in the set path, and the read-and-decode logic in a
set function has no purpose. Meanwhile rockchip_get_drive_perpin()
lacks the decoding, so pin_config_get() and the debugfs output report
-EINVAL for these SoCs.

Move the two cases to rockchip_get_drive_perpin(), where they belong.

Fixes: dbd2317d7b ("pinctrl: rockchip: Add rk3506 pinctrl support")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-10 22:06:01 +02:00
Alvin Šipraga
465f276bb9 pinctrl: fix PINCTRL_GENERIC_MUX not always being selectable
CONFIG_MULTIPLEXER can only be enabled indirectly. If it's not already
enabled, then CONFIG_PINCTRL_GENERIC_MUX cannot be selected at all in
menuconfig. That's because it depends on MULTIPLEXER.

Follow similar consumers of the multiplexer core and select MULTIPLEXER
instead. This way the driver will be visible in menuconfig as long as
PINCTRL is selected.

Fixes: 34acc5a8ad ("pinctrl: add generic board-level pinctrl driver using mux framework")
Signed-off-by: Alvin Šipraga <alvin.sipraga@analog.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 22:31:41 +02:00
Mikhail Kshevetskiy
87b42c8b21 pinctrl: airoha: add support of an7563 SoC
This patch adds support of Airoha an7563 SoC pin controller.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:26 +02:00
Mikhail Kshevetskiy
18c510bafa pinctrl: airoha: try to find chip scu node by phandle first
The "airoha,en7581-chip-scu" is not a good compatible string in the en7523
case. Let's search chip scu regmap with "airoha,chip-scu" phangle first
and fallback to SoC specific chip scu compatible string on failure.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:25 +02:00
Mikhail Kshevetskiy
3b82470583 pinctrl: airoha: add support of en7523 SoC
This patch adds support of Airoha en7523 SoC pin controller.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:25 +02:00
Mikhail Kshevetskiy
13243f4178 pinctrl: airoha: an7583: add support for olt pinmux
Add support for olt pin function for olt pin group.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:25 +02:00
Mikhail Kshevetskiy
1594233ef6 pinctrl: airoha: an7583: add support for pon_alt pinmux
Add support for pon pin function for pon_alt pin group.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:25 +02:00
Mikhail Kshevetskiy
24cde06b06 pinctrl: airoha: an7583: add support for npu_uart pinmux
Add support for uart pin function for npu_uart pin group.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:25 +02:00
Mikhail Kshevetskiy
c4776d20be pinctrl: airoha: an7583: rename registers to match its an7583 names
In the an7581 case the register at 0x1FA20214 is called
RG_GPIO_2ND_I2C_MODE. The same register in the an7583 case is called
RG_SW_TOD_1PPS_MODE.

Let's rename this register to avoid potential confuse.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:25 +02:00
Mikhail Kshevetskiy
bf3cdf90e3 pinctrl: airoha: an7583: remove an7583 prefix from variable names and definitions
We have only an7583 specific code in the pinctrl-an7583 kernel module,
so an7583 prefix is not necessary anymore. Remove it.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:24 +02:00
Mikhail Kshevetskiy
cb9b160da4 pinctrl: airoha: an7581: remove en7581 prefix from variable names
We have only an7581 specific code in the pinctrl-an7581 kernel module,
so 'en7581_' prefix is not necessary anymore. Remove it.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:24 +02:00
Mikhail Kshevetskiy
900b49e603 pinctrl: airoha: split driver on shared code and SoC specific drivers
Split combined an7581/an7583 source file on a
 * shared pinctrl code (pinctrl-airoha.c)
 * an7581 specific pinctrl driver (pinctrl-an7581.c)
 * an7583 specific pinctrl driver (pinctrl-an7583.c)

Ininialization code was adapted a bit to work properly for shared
and SoC specific cases.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:24 +02:00
Mikhail Kshevetskiy
3f263f7636 pinctrl: airoha: move common definitions to the separate header
Let's move the SoC independent definitions and declarations of structures
required for Airoha SoC-specific pinctrl drivers to a common header. Later
we'll have several SoC-specific drivers, so this step is necessary.

We will not move to the common header file other register addresses,
register bitfields definitions and macroses that use SoC specific
information. We will keep SoC specific definitions inside SoC specific
files.

No functional changes.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:24 +02:00
Mikhail Kshevetskiy
e3a62553d4 pinctrl: airoha: statically allocate gpio regs structure
just a small refactoring to collect all gpio register information
in the one statically allocated structure.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:24 +02:00
Mikhail Kshevetskiy
ad1a8fd485 pinctrl: airoha: remove not needed irq_type[] array
irq_type[] array inside airoha_pinctrl_gpiochip structure is not
actually necessary. Use trigger type from 'struct irq_data' instead.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:24 +02:00
Mikhail Kshevetskiy
3de4686cdf pinctrl: airoha: fix edge-triggered interrupts handling
Edge-triggered interrupts are handled incorrectly because of
 * no irq_ack() handler was defined,
 * no handle_level_irq() handler was used,

This patch probably fixes an issue

Fixes: 1c8ace2d07 ("pinctrl: airoha: Add support for EN7581 SoC")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:44:24 +02:00
Mikhail Kshevetskiy
20b9962806 pinctrl: airoha: fix IRQ mask/unmask code
When using IRQCHIP_IMMUTABLE, airoha_irq_unmask() must manually call
gpiochip_enable_irq() and airoha_irq_mask() must call
gpiochip_disable_irq(). Without these calls, gpiolib never sets the
GPIOD_FLAG_IRQ_IS_ENABLED bit. Because this bit is missing,
gpiod_direction_output() will not realize the pin is actively used
as an interrupt.

Fixes: 1c8ace2d07 ("pinctrl: airoha: Add support for EN7581 SoC")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:48 +02:00
Mikhail Kshevetskiy
a02fa031b9 pinctrl: airoha: add missed IRQ resource helpers
Without hooking .irq_request_resources, gpiolib cannot set
GPIOD_FLAG_USED_AS_IRQ. This breaks pin direction locking and can allow
userspace or another driver to reconfigure an active IRQ pin as an output

Fixes: 1c8ace2d07 ("pinctrl: airoha: Add support for EN7581 SoC")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:48 +02:00
Mikhail Kshevetskiy
b8dd305548 pinctrl: airoha: fix getting gpiochip/pinctrl pointers in the IRQ handling code
airoha_irq_unmask(), airoha_irq_mask(), airoha_irq_type() functions
impements brain damaged logic to retrieve gpiochip and pinctrl pointers.

Details:

    gpiochip = irq_data_get_irq_chip_data(data);

will initialize gpiochip variable with data->chip_data value. This value
initialized inside gpiochip_irq_map() function

    static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
			        irq_hw_number_t hwirq)
    {
	struct gpio_chip *gc = d->host_data;
        ...
	irq_set_chip_data(irq, gc);
	...
    }

Thus gpiochip variable of 'struct airoha_pinctrl_gpiochip *' type will be
initialized with a pointer to a variable of 'struct gpio_chip' type.

Luckily, gpio_chip is the first element of airoha_pinctrl_gpiochip, so
gpiochip pointer will get a correct value.

This patch implements correct logic of getting gpiochip and pinctrl
pointers.

Fixes: 1c8ace2d07 ("pinctrl: airoha: Add support for EN7581 SoC")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:48 +02:00
Mikhail Kshevetskiy
0d3b5e7b84 pinctrl: airoha: minor improvements
Changes:
 * use field_get() macro instead of direct bit operations
 * improve error handling

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:48 +02:00
Mikhail Kshevetskiy
62b1dd7eea pinctrl: airoha: add set_direction() helper for gpio_chip
The patch creates set_direction() helper for gpio_chip abstraction.
It also implements/reimplements some function using newly defined
helper.

This is cosmetic patch used to place gpio_chip specific code together.
No functional changes.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:48 +02:00
Mikhail Kshevetskiy
d6392502a9 pinctrl: airoha: add missed get_direction() function for gpio_chip
This patch adds missed get_direction() function for gpio_chip.
Also it reimplements pinconf's get_direction() function using
newly defined function.

Fixes: 1c8ace2d07 ("pinctrl: airoha: Add support for EN7581 SoC")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:48 +02:00
Mikhail Kshevetskiy
ccc41d2559 pinctrl: airoha: an7583: fix spi group pins
pcm pins were used insted of spi pins. This patch fixes an issue.

Thanks to Daniel Schwierzeck for noticing it.

Fixes: 3ffeb17a9a ("pinctrl: airoha: add support for Airoha AN7583 PINs")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:48 +02:00
Daniel Schwierzeck
239fd71600 pinctrl: airoha: fix AN7583 MDIO pin mux config
an7583_mdio_pins[] pointed at pins 43/44 (I2C1_SDA/I2C1_SCL) instead of
pins 53/54 (MDC_0/MDIO_0 respectively GPIO 51/52). Also the MDIO function
group wrote GPIO_SGMII_MDIO_MODE_MASK (bit 13 of REG_GPIO_PON_MODE, an
unrelated SGMII MDIO mode) and GPIO_MDC_IO_MASTER_MODE_MODE (BIT(14),
an EN7581 specific bit from REG_GPIO_2ND_I2C_MODE).

Fix both by setting an7583_mdio_pins[] to { 53, 54 } and rewriting the
function group to clear AN7583_MDC_0_GPIO_MODE_MASK (bit 25) and
AN7583_MDIO_0_GPIO_MODE_MASK (bit 26) of REG_GPIO_PON_MODE. Both bits
are cleared by the hwinit at probe.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:48 +02:00
Daniel Schwierzeck
0562b05f4a pinctrl: airoha: fix I2C pin mux config for AN7583
On AN7583 both I2C busses have a pin sharing with GPIO. Also the pin mux
setting is done in REG_GPIO_PON_MODE instead of REG_GPIO_2ND_I2C_MODE.

Add dedicated I2C pin groups and function groups for AN7583. The new
groups must support i2c0 and i2c1.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:47 +02:00
Daniel Schwierzeck
bf76a61cf9 pinctrl: airoha: fix I2C1 pin mux config for AN7581
The pin mux on GPIOs 1 and 2 on AN7581 supports I2C in master and
slave mode. When selecting I2C the according bits (bit 13 for master,
bit 11 for slave) must be set in REG_GPIO_2ND_I2C_MODE.

Fix the i2c1 pin group to set bits 0 and 13 to set I2C1 master mode by
default.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:47 +02:00
Mikhail Kshevetskiy
aaa41d8010 pinctrl: airoha: an7583: fix muxing of non-gpio default pins
Current an7583 pinmux implementation have following issues:
 * pins 51 and 52 can't be set as pcie_reset, current pcie_reset code
   will sets pins to gpio mode instead.
 * there is no proper way to set pins 41--54 to gpio mode.
 * pins 41--53 can't be actually set as pwm pins. These pins must be
   muxed to gpio mode as well.

This patch fixes above issues.

Fixes: 3ffeb17a9a ("pinctrl: airoha: add support for Airoha AN7583 PINs")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:47 +02:00
Mikhail Kshevetskiy
739bc85aed pinctrl: airoha: an7581: fix mux/conf of pcie_reset pins
In the an7581 case
 * gpio47 and pcie_reset0 shares pin 60,
 * gpio48 and pcie_reset1 shares pin 61,
 * gpio49 and pcie_reset2 shares pin 62.
but current driver treat them as pins 61--63. This is wrong.

Also current an7581 pinmux implementation have following issues:
 * current pcie_reset pin function actually sets corresponding
   pins as gpios.
 * there is no proper way to set pcie_reset pins as gpios.
 * there is no way to set pcie_reset pins as pwm.

This patch fixes above issues.

WARNING:
There is a contradiction in the Airoha documentation. AN7581 programming
guide claims:
 - gpio44 and pcie_reset0 shares the same pin
 - gpio45 and pcie_reset1 shares the same pin
 - gpio46 and pcie_reset2 shares the same pin
While AN7581 datasheet claims:
 - gpio47 and pcie_reset0 shares the same pin
 - gpio48 and pcie_reset1 shares the same pin
 - gpio49 and pcie_reset2 shares the same pin
The datasheet should be considered as a more reliable source.
Thanks to Benjamin Larsson for clarification.

Fixes: 1c8ace2d07 ("pinctrl: airoha: Add support for EN7581 SoC")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:47 +02:00
Mikhail Kshevetskiy
d560e28bdc pinctrl: airoha: an7583: fix I2C0_SDA_PD register bit order
I2C1_SCL_PD and RG_I2C1_SDA_PD bits are swapped, fix it.

Fixes: 3ffeb17a9a ("pinctrl: airoha: add support for Airoha AN7583 PINs")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:47 +02:00
Mikhail Kshevetskiy
65ce9d5d78 pinctrl: airoha: an7581: fix pinconf of i2c_scl/i2c_sda pins
Pinconfs of i2c_sda/i2c_scl pins are swapped, this needs to be fixed.

Fixes: 1c8ace2d07 ("pinctrl: airoha: Add support for EN7581 SoC")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:46 +02:00
Mikhail Kshevetskiy
a8454680a6 pinctrl: airoha: fix mdio bitfield names
Fix misprint in mdio bitfield name of GPIO_2ND_I2C_MODE register.

While at it also fix an7583 mdio. It should use an7583 specific
mdio bitfield.

Fixes: 1c8ace2d07 ("pinctrl: airoha: Add support for EN7581 SoC")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 20:39:46 +02:00
Simon Glass
35ff52e54b pinctrl: rockchip: Restrict the RV1103B 2-bit drive type to bank 2
The RV1103B override in rockchip_get_drive_perpin() forces the 2-bit
level drive type for every pin above 11, but only bank 2 has the
2-bit fields; banks 0 and 1 use the 8-bit level type for all pins,
as the corresponding check in rockchip_set_drive_perpin() shows.

Today this is harmless, since neither level type is decoded in the
get function and both paths fail with -EINVAL. It becomes an active
problem once decoding is added, as the pins of banks 0 and 1 would
be truncated to 2-bit values. Add the missing bank check, matching
the set path.

Fixes: 6d3ea3120e ("pinctrl: rockchip: Add RV1103B pinctrl support")
Link: https://sashiko.dev/#/patchset/20260729132736.3807082-1-sjg@chromium.org?part=1
Assisted-by: Claude:claude-opus-5
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 00:11:05 +02:00
Simon Glass
5b695c191c pinctrl: rockchip: Reset the pin count when recalculating SoC data
rockchip_pinctrl_get_soc_data() mutates the static per-SoC data. The
iomux and drive offsets are recalculated idempotently, since a rerun
anchors at the values calculated before, but the total pin count only
accumulates: each run adds every bank's pins again. When the probe is
deferred and runs a second time, nr_pins doubles and every bank's
pin_base shifts, so later pin lookups resolve to the wrong bank and
the wrong registers.

Reset the pin count at the start of the calculation, so that a rerun
produces the same values.

This is verified on a Luckfox Pico Mini B (RV1103, with the pending
RV1106 series applied) by forcing the probe to defer once: without
this patch the second probe calculates nr_pins=304 instead of 152 and
no GPIO bank comes up; with it the recalculation matches the first
run and all banks work.

Fixes: d3e5116119 ("pinctrl: add pinctrl driver for Rockchip SoCs")
Link: https://sashiko.dev/#/patchset/20260729132736.3807082-1-sjg@chromium.org?part=4
Assisted-by: Claude:claude-opus-5
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-07 00:11:05 +02:00
Prathamesh Shete
27e5b8efc2 pinctrl: tegra264: fix DAP2 DIN/DOUT pin assignment
The dap2_din and dap2_dout pin groups were given swapped ball suffixes:
DAP2_DIN was described as ball PV7 and DAP2_DOUT as ball PW0. On silicon
DAP2_DIN is on ball PW0 (mux register 0x6050, drive register 0x6054) and
DAP2_DOUT is on ball PV7 (mux register 0x6058, drive register 0x605c),
as reflected by the board pinmux.

Because the ball suffixes were swapped, the groups were also assigned the
wrong primary mux functions (dap2_din -> I2S2_SDATA_OUT and dap2_dout ->
I2S2_SDATA_IN), routing the I2S2 data-in and data-out signals to the wrong
pins and breaking DAP2 audio.

Rename the groups to dap2_din_pw0 and dap2_dout_pv7 and give each pad its
correct function (dap2_din_pw0 -> I2S2_SDATA_IN, dap2_dout_pv7 ->
I2S2_SDATA_OUT). The register offsets are already correct and are left
unchanged. This matches the board pinmux.

Fixes: c985062069 ("pinctrl: tegra: Add Tegra264 pinmux driver")
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-06 23:47:21 +02:00
Maulik Shah
aef612f013 pinctrl: Use IRQ trigger mask helpers
Use IRQ_TYPE_LEVEL_MASK and IRQ_TYPE_EDGE_BOTH instead of open-coded
trigger type combinations in irqchip callbacks.

No functional change intended.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-06 23:40:54 +02:00
Tsz Shan Chan
d4f32b8b8a pinctrl: sx150x: get parent IRQ trigger type from firmware
The driver currently hardcodes the parent interrupt trigger type to
IRQF_TRIGGER_FALLING.

Use the trigger type configured by firmware instead. If no trigger type
is specified, fall back to IRQF_TRIGGER_FALLING to maintain current
behaviour.

Support IRQF_TRIGGER_FALLING and IRQF_TRIGGER_LOW, which match the
sx150x open drain active low interrupt output. Reject unsupported
trigger types.

Signed-off-by: Tsz Shan Chan <tchan@jacques.com.au>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-06 23:37:39 +02:00
Tsz Shan Chan
c04957d2fc pinctrl: sx150x: Return IRQ_NONE if no pending irq
The driver currently reads the interrupt source register, writes the
value back to clear it, and always returns IRQ_HANDLED.
When the IRQ is shared, the handler should not claim interrupts that are
not from this device.

Check for zero interrupt source first. It no interrupt is pending,
return IRQ_NONE and skip the register write.

Signed-off-by: Tsz Shan Chan <tchan@jacques.com.au>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-06 23:37:39 +02:00
Linus Walleij
cda114315f Samsung pinctrl drivers changes for v7.3
Add drivers for newly introduced Samsung Exynos8855 SoC.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmp0RWAQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD1/8hD/wPUJ+Nf5JUKBy4ptV7/7WXPDOpwMW5innF
 WtJLlIn0+y1tRn6LCnY/Hwvtuxcr0WV7FQnqeKEZVSR5l4wHb2a9kJgYR1lJW8cn
 qCljtS6bUXwXfGPslw3UY4a3Cwez8q8cd0nm3h+tS6vTbEVkUPKD5yKkBb9cEcSM
 8lFjsuiM2rChZ3x2PNhYoroUb8zE52XKZ+q2Bjwg2TKlGO7/Xfgc7Vt4mG0AoXwf
 nFAlS3D5DIoFNtzTCayRwr47hzW4NoChACZURnWzk4+k2tJzAavnny0rECQ0KDST
 oHVqLr4v2HZ56G4rwuU607UQoRr8Z3B4682PJ+ENgPPRhb1zF6Mwj5uC++kmI4Fl
 TqmzBSnQHUiPQx7zEb1VkT9X8fz1ovENJfdDPJspeIEwboNspsjiMdlvJcj81pQ5
 ifjpoSt0D9hr8QlxQZcqVyHX1jisSs+V9tPQcjUeKiZAJRbCYUaVRFvbWl8w04PG
 mmRp0T2GK/6CrWxe4zCPSo4/w4/RGlFmpx3gCEKJf0t63GCS7bbLVZ8OaYA9Eq0u
 7hOCvVIMcdclZQyvpAs4UJWshAK+qkjTHF/65d2gdUQ9L4v+pV+Ofotrf1H+ljfO
 DjiuvbelK1sqtDwREwggMmI7lwtnzi61C02a2Svsp8UPyW67QKILTv+Wk3MVM5kZ
 G8YvU+P2CQ==
 =EWhM
 -----END PGP SIGNATURE-----

Merge tag 'samsung-pinctrl-7.3' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel

Samsung pinctrl drivers changes for v7.3

Add drivers for newly introduced Samsung Exynos8855 SoC.

Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-06 23:34:08 +02:00
Tsz Shan Chan
dbbb19b8e4 pinctrl: sx150x: allow build when I2C is a module
PINCTRL_SX150X currently depends on I2C=y. This prevents the driver
from being built when I2C is configured as module.

Change the Kconfig dependency to just I2C so sx150x can be built as a
module when I2C is also a module.

Signed-off-by: Tsz Shan Chan <tchan@jacques.com.au>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-08-04 09:43:30 +02:00