]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Input: i8042 - add LoongArch support in i8042-acpipnpio.h
authorHuacai Chen <chenhuacai@loongson.cn>
Sat, 1 Oct 2022 21:29:01 +0000 (14:29 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 10 Oct 2022 05:26:52 +0000 (22:26 -0700)
LoongArch uses ACPI and nearly the same as X86/IA64 for 8042. So modify
i8042-acpipnpio.h slightly and enable it for LoongArch in i8042.h. Then
i8042 driver can work well under the ACPI firmware with PNP typed key-
board and mouse configured in DSDT.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220917064020.1639709-2-chenhuacai@loongson.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/serio/i8042-acpipnpio.h
drivers/input/serio/i8042.h

index e91c6a1814a88d2e105b4723529b76eb2efb32ca..0778dc03cd9e08b8bb3e24c0d1b4f651a29adf46 100644 (file)
@@ -2,6 +2,7 @@
 #ifndef _I8042_ACPIPNPIO_H
 #define _I8042_ACPIPNPIO_H
 
+#include <linux/acpi.h>
 
 #ifdef CONFIG_X86
 #include <asm/x86_init.h>
@@ -1453,9 +1454,14 @@ static int __init i8042_pnp_init(void)
                return -ENODEV;
 #else
                pr_info("PNP: No PS/2 controller found.\n");
+#if defined(__loongarch__)
+               if (acpi_disabled == 0)
+                       return -ENODEV;
+#else
                if (x86_platform.legacy.i8042 !=
                                X86_LEGACY_I8042_EXPECTED_PRESENT)
                        return -ENODEV;
+#endif
                pr_info("Probing ports directly.\n");
                return 0;
 #endif
index bf2592fa9a783d17d32e4456b6e454738e5e42d3..adb5173372d3ee6d83d2164f0c6bd434cba9975f 100644 (file)
@@ -19,7 +19,7 @@
 #include "i8042-snirm.h"
 #elif defined(CONFIG_SPARC)
 #include "i8042-sparcio.h"
-#elif defined(CONFIG_X86) || defined(CONFIG_IA64)
+#elif defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_LOONGARCH)
 #include "i8042-acpipnpio.h"
 #else
 #include "i8042-io.h"