]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpio: loongson: Switch 2K2000/3000 GPIO to BYTE_CTRL_MODE
authorXi Ruoyao <xry111@xry111.site>
Fri, 28 Nov 2025 07:50:32 +0000 (15:50 +0800)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 28 Nov 2025 11:59:00 +0000 (12:59 +0100)
The manuals of 2K2000 says both BIT_CTRL_MODE and BYTE_CTRL_MODE are
supported but the latter is recommended.  Also on 2K3000, per the ACPI
DSDT the GPIO controller is compatible with 2K2000, but it fails to
operate GPIOs 62 and 63 (and maybe others) using BIT_CTRL_MODE.
Using BYTE_CTRL_MODE also makes those 2K3000 GPIOs work.

Fixes: 3feb70a61740 ("gpio: loongson: add more gpio chip support")
Cc: stable@vger.kernel.org
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Link: https://lore.kernel.org/r/20251128075033.255821-1-xry111@xry111.site
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-loongson-64bit.c

index d4e291b275f0bb1781a75a3829d166121442e437..77d07e31366fa4256b598748e175a5670f49d2a1 100644 (file)
@@ -408,11 +408,11 @@ static const struct loongson_gpio_chip_data loongson_gpio_ls2k2000_data0 = {
 
 static const struct loongson_gpio_chip_data loongson_gpio_ls2k2000_data1 = {
        .label = "ls2k2000_gpio",
-       .mode = BIT_CTRL_MODE,
-       .conf_offset = 0x0,
-       .in_offset = 0x20,
-       .out_offset = 0x10,
-       .inten_offset = 0x30,
+       .mode = BYTE_CTRL_MODE,
+       .conf_offset = 0x800,
+       .in_offset = 0xa00,
+       .out_offset = 0x900,
+       .inten_offset = 0xb00,
 };
 
 static const struct loongson_gpio_chip_data loongson_gpio_ls2k2000_data2 = {