Commit Graph

8050 Commits

Author SHA1 Message Date
Pablo Mazzini
c5895eadf2 pinctrl: sunxi: dt: do not accumulate npins across probe attempts
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: f5e2cd34b1 ("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-12 11:30:12 +02:00
Linus Walleij
85b3a4d503 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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEkeUTLeW1Rh17omX8BZ0uy/82hMMFAmrHXMIACgkQBZ0uy/82
 hMN6ZQ/+LQi2B9W9kqtSq047/MRUOKgKDPl5AiZjlP7k9lmV3FKDgi6NtUnFJURY
 xIx7z00/9mffqqnLlXkBP8bZq4N6wgUiqVE//0F+K+8MfYfXDQsZdHgHet6GvQak
 kpVrwLG+G9brGpfDvoOZxPMQsYUoLvOnUgdG8L3kuPloaquk/3lv9HXHi2J7QFqo
 J64t1ZPYgfszhwpbMtrDT5s1xn8KeahQmi3ZOB6dJq65F1FF3/BvjjeI8UaMcH+6
 M1NCgqs2Q6Lwiqa8y8pFXzgcOkPKlRd1PSdKzFfsKt9FuPTx33xtwJ/kGl7P0P2E
 PHxr9YtYaWw1n498skbA+I850GHUeE4Fj66rSIdwktTfcz7VDR5WfHUAsJ9WZY/x
 iErOCazqVSu8fAY44HhX3s1fc/mb91JrMX0GdxpsfKHVpI93Yb9pNZE70aoqSOC/
 iMCwqQy6sX1LazUlELyheHFB/flftykaieeBp0VpUOEaN6WsmcdpAiRMQIWEldWg
 +AmeFK59hqUdwoQLieN4Dk/SCXt2zW0KRiz4rGSySfY/c0qCGh6hU/Pcko/G7L04
 CfvAGPHD52lnMVq8J1DxbQ5exYw2wby2m77mJnALRI9tGJ1rcAJXMgXOZZPGqdxi
 cR0eOKlYmt9l/tD8vW1QhXBfrQWTboVCkBaWHrkPOef4dowdv8I=
 =fFv6
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-qcom-fixes-for-v7.3-rc7' of 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-08 13:38:23 +02:00
Mario Limonciello
1cca81a683 pinctrl: amd: Clear S4 wake bits when firmware has _AEI
Commit ffe8a0c6b5 ("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: ffe8a0c6b5 ("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-07 13:26:54 +02:00
Adriel Santos
709ba1c547 pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12
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 c6c159fcdb
("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: 725d1c8916 ("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-06 10:05:09 +02:00
George Moussalem
65db42a9fa pinctrl: qcom: ipq5018: update PWM groups and corresponding pin functions
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-01 14:32:42 +02:00
Shawn Guo
19fc424035 pinctrl: qcom: spmi-gpio: make direction changes exclusive
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: 2634475324 ("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-28 19:15:24 +02:00
Bartosz Golaszewski
8157cd417d Linux 7.3-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCgA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmq5gqUeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG1m0IAKReEZDW1PRuno8+
 eLDLgJ2pYk8CMAnl7UO6OAG9dQWT5vLIJrRerLeoG2ZDP9kr5cJPGytXryxUtH1D
 8UfuSRZ+/b/JD0yhHlod0MSvZeVWbRtcL7r03kcea0p4ziNeR+V20oUQqM33ZuCL
 7o12W0EYtsQwfSmtMsO+5ayIoOu05FSBb/l2mnWi3TFUUYcLbna4SwBcQuVf/jXQ
 mCeNqTtFMHsdAFp27AFfu4wV87+y158QFyXxpCeoUk8cGcFDY8zu5R8CqijtHSar
 x9hpPGSMDVm+BSxfrIsDXWVU/1WskRAPyNw+l14vFR1NwY6uLUBruajPyLEnh3B4
 SzHSAxg=
 =5Bii
 -----END PGP SIGNATURE-----

Merge tag 'v7.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into pinctrl-qcom/for-current

Linux 7.3-rc5
2026-09-28 19:15:10 +02:00
Gilberto Conde
c6c159fcdb pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13
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: 725d1c8916 ("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>
2026-09-22 10:13:19 +02:00
Prathamesh Shete
ae2c5bf969 pinctrl: tegra238: Fix register bank for AON pin groups
The AON pin controller has a single register region and therefore,
the bank defined in the tegra238_functions[] and tegra238_aon_groups[]
for the AON pin groups must be 0. However, commit 25cac7292d
("pinctrl: tegra: Add Tegra238 pinmux driver") incorrectly specified the
bank for these pins as 1 and not 0. This means that in the
tegra_pinctrl_probe() function we use an invalid index when accessing
the pmx->regs[] array which causes an incorrect address to be used for
accessing the pinmux registers.

Fix this by correcting the bank for the AON pin groups.

Fixes: 25cac7292d ("pinctrl: tegra: Add Tegra238 pinmux driver")
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-21 00:06:32 +02:00
hpp.iscas
447dcff905 pinctrl: qcom: ipq5210: Publish the OF module alias
The IPQ5210 TLMM platform driver can be a module and matches through
ipq5210_tlmm_of_match. This table is not published for OF modalias
matching.

Publish the existing table, preserving arch_initcall ordering and
the shared MSM pinctrl probe.

Fixes: a549fe2237 ("pinctrl: qcom: Introduce IPQ5210 TLMM driver")
Signed-off-by: hpp.iscas <hppiscas@163.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260905134340.67477-1-hppiscas@163.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-18 19:00:35 +02:00
Shawn Guo
b0be01f133 pinctrl: qcom: nord: Split QUP1 SE2/SE3 into lane-pair functions
QUP1 SE2 and SE3 pack all four of their lanes pair-wise onto only two
pins each: lanes 0/1 (I2C SDA/SCL) at mux value 2 and lanes 2/3 (UART
TX/RX) at mux value 1, on gpio127/gpio128 and gpio129/gpio130
respectively.

Both mux values were named "qup1_se2" (respectively "qup1_se3"), so the
two distinct lane pairs became indistinguishable. msm_pinmux_set_mux()
stops at the first entry matching the requested function, which means
mux value 1 was always selected and the I2C lanes could never be muxed
out. In practice i2c9 and i2c10 got the UART lanes and did not work,
while uart9 and uart10 happened to be muxed correctly.

Give each lane pair its own function, following the _01/_23 naming
already used for the same hardware arrangement by the shikra, eliza,
hawi and maili TLMM drivers. Both functions still cover the full pin
pair, so a single pinctrl state per protocol remains sufficient.

Drop gpio129/gpio130 from the SE2 group list, since those pins
belong to SE3 and were never reachable through the SE2 function.

Also rename QUP1 SE2/SE3 functions in the binding doc accordingly.

While at it, add missing "gpio", "qup3_se0_mira" and "qup3_se0_mirb"
to the binding function enum to get the list complete.

Fixes: c24dd0826f ("pinctrl: qcom: add the TLMM driver for the Nord platforms")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260830030201.135637-1-shengchao.guo@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-18 19:00:14 +02:00
Konrad Dybcio
dcb5df182b pinctrl: qcom: qcs8300: Fix intr_target_width
The default width of the interrupt target field doesn't match the actual
register layout. Fix it.

Fixes: 0c4cd2cc87 ("pinctrl: qcom: add the tlmm driver for QCS8300 platforms")
Assisted-by: LLM
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260917-topic-tlmm_intr_width_fixes-v1-3-3bc1d056aa6b@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-09-17 11:49:25 +02:00
Konrad Dybcio
912df33f29 pinctrl: qcom: maili: Fix intr_target_width
The default width of the interrupt target field doesn't match the actual
register layout. Fix it.

Fixes: 251b53103a ("pinctrl: qcom: Add the tlmm driver for Maili platform")
Assisted-by: LLM
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260917-topic-tlmm_intr_width_fixes-v1-2-3bc1d056aa6b@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-09-17 11:49:25 +02:00
Konrad Dybcio
9d4c3e0c6a pinctrl: qcom: hawi: Fix intr_target_width
The default width of the interrupt target field doesn't match the actual
register layout. Fix it.

Fixes: 90700e10d2 ("pinctrl: qcom: Add Hawi pinctrl driver")
Assisted-by: LLM
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260917-topic-tlmm_intr_width_fixes-v1-1-3bc1d056aa6b@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-09-17 11:49:24 +02:00
Zhangfei Gao
68ab4a6a84 pinctrl: qcom: nord: fix GPIO interrupt target width
The TARGET_PROC field in the Nord GPIO_INTR_CFG registers occupies bits
11:8. Describe it as four bits wide so the common Qualcomm pinctrl code
clears the complete field before routing an interrupt to the application
processor.

Without intr_target_width, the common code uses its three-bit default
mask. Since GPIO_INTR_CFG resets with TARGET_PROC set to 0xf (NONE), bit
11 remains set when the driver programs HMSS target 3. The resulting
target is 0xb (HPASS_DSP_1), observed as an interrupt configuration value
of 0xb1b instead of 0x31b.

The GPIO interrupt status is consequently latched, but the HMSS TLMM
summary interrupt at GIC SPI 208 is never asserted. This affects all Nord
GPIO interrupts using the TLMM summary path, including the Ethernet PHY
interrupts on GPIO55 and GPIO141.

Fixes: c24dd0826f ("pinctrl: qcom: add the TLMM driver for the Nord platforms")
Signed-off-by: Zhangfei Gao <zhangfei.gao@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260916085720.771498-1-zhangfei.gao@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-09-17 11:49:14 +02:00
Myeonghun Pak
1d9bb9c870 pinctrl: single: free the IRQ on domain creation failure
pcs_irq_init_chained_handler() requests a shared IRQ on affected SoCs, but
its domain creation failure path only removes a chained handler. That does
not release the action installed by request_irq(). The probe can continue
without interrupt support while leaving the shared IRQ action registered.

Use pcs_irq_free() to undo the appropriate type of handler registration.
At this point pcs->domain is NULL, so the helper only releases the parent
IRQ handler. Then mark the IRQ invalid, as the other initialization error
paths already do, to prevent another release from a later probe unwind or
remove.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: 3e6cee1786 ("pinctrl: single: Add support for wake-up interrupts")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-16 19:19:04 +02:00
Andre Przywara
ef56085dfd pinctrl: sunxi: A523: fix voltage withstand encoding
The Allwinner A523 uses the same GPIO voltage "withstand" programming
(setting the input level voltage thresholds) as the previous SoCs, but
for some odd reason inverts the encoding of 1.8V vs. 3.3V.

Add a new bias voltage type to note this difference, and select it for
the A523. At the same time also use the newer "CTL" version, which in
addition allows to turn off the withstand programming for I/O voltages
other than exact 1.8V or 3.3V (for instance for 2.5V sometimes used for
Ethernet PHYs). The A523 has that enable register, but didn't use it
so far.

This fixes eMMC and reportedly Ethernet operation on some A523 boards.

Fixes: 648be4cd95 ("pinctrl: sunxi: Add support for the Allwinner A523")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Per Larsson <per@palvencia.se>
Tested-by: Juan Manuel Lopez Carrillo <juanmanuellopezcarrillo@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Tested-by: Chen-Yu Tsai <wens@kernel.org> # Fixes eMMC on Orange Pi 4A
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-16 19:07:42 +02:00
Ilya Titov
a13f7f5d14 pinctrl: sunxi: keep a shadow copy of the data register output latches
On Allwinner SoCs, reading a bank's data register returns the pin level,
not the output latch, for pins that are muxed as inputs.  Writing a GPIO
therefore corrupts the output latches of all input-muxed pins in the
same bank: the read-modify-write in sunxi_pinctrl_gpio_set() reads back
their pin levels and writes those into their latches.

This breaks emulated open-drain lines (e.g. a bit-banged I2C bus from
i2c-gpio).  Such a line is released high by muxing it as input and
letting the pull-up raise it, so any concurrent GPIO write in the same
bank stores 1 into its latch.  Driving the line low afterwards is a
non-atomic data-then-mux sequence in sunxi_pinctrl_gpio_direction_output();
if the poisoning write lands between the two steps, the pin actively
drives high (push-pull) instead of low.

Observed in practice as sporadic glitches on a T507 board bit-banging
I2C on port E while other PE GPIOs are toggled.  On a scope the failure
is unmistakable: on a clock pulse where SCL should fall to GND, the line
instead steps *above* its idle high level for the whole low phase — the
pad drives a strong push-pull 3.3 V high, higher than the level the
pull-up sustains on the loaded bus — before the next transition recovers
it.  The same can hit SDA, corrupting data instead of clocks.

Steps to reproduce on any sunxi board with a bit-banged (i2c-gpio) bus:

  # background: toggle any other GPIO of the same bank, e.g. line 21
  gpioset -c <chip> --toggle 100us 21=0 &

  # foreground: keep the bit-banged bus busy
  while :; do i2cdetect -y <bus> 0x50 0x57; done

  # watch SCL/SDA with a scope or logic analyzer: sporadic clock-low
  # phases driven high (above the pull-up level) instead of low

The bank spinlock cannot help: the racing write is a perfectly valid
whole-register RMW that faithfully writes back what the hardware
returned.  There are no set/clear registers on this IP to write a single
bit atomically.

Fix it the same way gpio-mmio handles hardware whose data register read
does not return the output latch: keep a shadow copy of each bank's
latches, base the read-modify-write on the shadow, and only write the
register.  The shadow is seeded from the hardware at probe time so pins
left in output mode by the bootloader keep their state.  Pins that reach
output mode through the gpiolib paths write their value (and thereby
their shadow bit) before the mux switch in
sunxi_pinctrl_gpio_direction_output(); pins muxed to gpio_out directly
through a pinmux node bypass that path, so sunxi_pmx_set() refreshes
their shadow bit from the latch (readable once the pin is in output
mode) to keep them driving their pre-existing level.

Seeding the shadow reads the PIO registers at probe time, which requires
the bus clock to be enabled.  The clock was only requested at the very
end of probe, after devm_pinctrl_register() had already claimed the pin
hogs described in the device tree - which mux pins, and thus access
registers, with the clock still gated.  Move the request ahead of both.
Boards whose bootloader leaves the PIO clock running are unaffected,
which is why the pre-existing hog problem has gone unnoticed since
commit 950707c0eb ("pinctrl: sunxi: add clock support").

Fixes: df7b34f4c3 ("pinctrl: sunxi: Fix gpio_set behaviour")
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Titov <ilya.titov@wirenboard.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-16 15:03:50 +02:00
Conor Dooley
8039b75af5 pinctrl: mpfs-mssio: use correct regmap function to set bank voltage
regmap_assign_bits() is not the correct function to use for an RMW
operation, as it maps to regmap_set_bits() or regmap_clear_bits() and
the former will never zero a bit. Use regmap_update_bits() instead,
which will actually set the bank voltages to what have been requested.

CC: stable@vger.kernel.org
Fixes: 488d704ed7 ("pinctrl: add polarfire soc mssio pinctrl driver")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-14 11:09:21 +02:00
Conor Dooley
e6c5d6c589 pinctrl: mpfs-mssio: fix width of unused bank voltage setting
The bank voltages are only 4 bits wide, so when a pin was unused the
driver was not correctly interpreting it as being at zero volts, because
the driver's value for unused had two extra set bits.

CC: stable@vger.kernel.org
Fixes: 488d704ed7 ("pinctrl: add polarfire soc mssio pinctrl driver")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-14 11:09:11 +02:00
Sarah Emery
51ae996594 pinctrl: generic: serialise pinctrl_generic_dt_node_to_map()
pinctrl_generic_add_group() documents that the caller must take care of
locking, and pinmux_generic_add_function() needs it too, but
pinctrl_generic_dt_node_to_map() calls them without holding
pctldev->mutex, and the core caller in create_pinctrl() does not take it
either.

The driver core calls pinctrl_bind_pins() before probing a device, so
two devices that reference the same pin controller can run
pinctrl_generic_dt_node_to_map() on one pctldev at the same time.

Both `add` functions take the new selector from pctldev->num_groups or
pctldev->num_functions, and radix_tree_insert() at that index.
Two racing callers can read the same selector before either
has inserted, so the second insert collides and fails:

  k1-pinctrl d401e000.pinctrl:
  error -EEXIST: error adding function pcie2-0-cfg
  k1-pinctrl d401e000.pinctrl:
  does not have pin group pcie0-0-cfg.pcie0-0-pins

leaving one consumer without its pin configuration.

This was hit on a SpacemiT K3 board, where PCIe devices probe in parallel
against the single shared pin controller.

Take pctldev->mutex across the whole function, so that the groups and the
function referring are in a single critical section.

Fixes: 43722575e5 ("pinctrl: add generic functions + pins mapper")
Signed-off-by: Sarah Emery <sarah.emery@canonical.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-14 10:59:33 +02:00
Sean Anderson
692f32609a pinctrl: meson: Fix typo in s4 group name
One of the i2c pin groups has some junk at the end. The name should be
i2c2_scl_h1, and indeed that's the name used by i2c2_pins3 in
meson-s4.dtsi.

Fixes: 775214d389 ("pinctrl: meson: add pinctrl driver support for Meson-S4 Soc")
Signed-off-by: Sean Anderson <sanderson@brivo.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-09-14 10:39:01 +02:00
hpp.iscas
818103dc7f pinctrl: qcom: ipq5210: Publish the OF module alias
The IPQ5210 TLMM platform driver can be a module and matches through
ipq5210_tlmm_of_match. This table is not published for OF modalias
matching.

Publish the existing table, preserving arch_initcall ordering and
the shared MSM pinctrl probe.

Fixes: a549fe2237 ("pinctrl: qcom: Introduce IPQ5210 TLMM driver")
Signed-off-by: hpp.iscas <hppiscas@163.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260905134340.67477-1-hppiscas@163.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-09-07 10:51:54 +02:00
Shawn Guo
fbfd6d0d35 pinctrl: qcom: nord: Split QUP1 SE2/SE3 into lane-pair functions
QUP1 SE2 and SE3 pack all four of their lanes pair-wise onto only two
pins each: lanes 0/1 (I2C SDA/SCL) at mux value 2 and lanes 2/3 (UART
TX/RX) at mux value 1, on gpio127/gpio128 and gpio129/gpio130
respectively.

Both mux values were named "qup1_se2" (respectively "qup1_se3"), so the
two distinct lane pairs became indistinguishable. msm_pinmux_set_mux()
stops at the first entry matching the requested function, which means
mux value 1 was always selected and the I2C lanes could never be muxed
out. In practice i2c9 and i2c10 got the UART lanes and did not work,
while uart9 and uart10 happened to be muxed correctly.

Give each lane pair its own function, following the _01/_23 naming
already used for the same hardware arrangement by the shikra, eliza,
hawi and maili TLMM drivers. Both functions still cover the full pin
pair, so a single pinctrl state per protocol remains sufficient.

Drop gpio129/gpio130 from the SE2 group list, since those pins
belong to SE3 and were never reachable through the SE2 function.

Also rename QUP1 SE2/SE3 functions in the binding doc accordingly.

While at it, add missing "gpio", "qup3_se0_mira" and "qup3_se0_mirb"
to the binding function enum to get the list complete.

Fixes: c24dd0826f ("pinctrl: qcom: add the TLMM driver for the Nord platforms")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260830030201.135637-1-shengchao.guo@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-09-07 09:55:50 +02:00
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