Skip to content

Commit fdd7c96

Browse files
chenhuacaidtor
authored andcommitted
Input: i8042 - add LoongArch support in i8042-acpipnpio.h
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>
1 parent 8761b9b commit fdd7c96

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/input/serio/i8042-acpipnpio.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#ifndef _I8042_ACPIPNPIO_H
33
#define _I8042_ACPIPNPIO_H
44

5+
#include <linux/acpi.h>
56

67
#ifdef CONFIG_X86
78
#include <asm/x86_init.h>
@@ -1453,9 +1454,14 @@ static int __init i8042_pnp_init(void)
14531454
return -ENODEV;
14541455
#else
14551456
pr_info("PNP: No PS/2 controller found.\n");
1457+
#if defined(__loongarch__)
1458+
if (acpi_disabled == 0)
1459+
return -ENODEV;
1460+
#else
14561461
if (x86_platform.legacy.i8042 !=
14571462
X86_LEGACY_I8042_EXPECTED_PRESENT)
14581463
return -ENODEV;
1464+
#endif
14591465
pr_info("Probing ports directly.\n");
14601466
return 0;
14611467
#endif

drivers/input/serio/i8042.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "i8042-snirm.h"
2020
#elif defined(CONFIG_SPARC)
2121
#include "i8042-sparcio.h"
22-
#elif defined(CONFIG_X86) || defined(CONFIG_IA64)
22+
#elif defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_LOONGARCH)
2323
#include "i8042-acpipnpio.h"
2424
#else
2525
#include "i8042-io.h"

0 commit comments

Comments
 (0)