summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2026-08-03 08:10:24 -0600
committerLinus Walleij <linusw@kernel.org>2026-08-07 00:11:05 +0200
commit35ff52e54b38b01914be62ece27899665a46af56 (patch)
tree8d25713568e5a21e9132794a0e855828333cb0d2
parent5b695c191cc85f0fd62eec885b55d01468dc9f2c (diff)
downloadlinux-35ff52e54b38b01914be62ece27899665a46af56.tar.gz
linux-35ff52e54b38b01914be62ece27899665a46af56.zip
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: 6d3ea3120eaa ("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>
-rw-r--r--drivers/pinctrl/pinctrl-rockchip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index dbbbfdc73848..8c7e410ec9d1 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -3350,7 +3350,7 @@ static int rockchip_get_drive_perpin(struct rockchip_pin_bank *bank,
u8 bit;
int drv_type = bank->drv[pin_num / 8].drv_type;
- if (ctrl->type == RV1103B && pin_num >= 12)
+ if (ctrl->type == RV1103B && bank->bank_num == 2 && pin_num >= 12)
drv_type = DRV_TYPE_IO_LEVEL_2_BIT;
ret = ctrl->drv_calc_reg(bank, pin_num, &regmap, &reg, &bit);