aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-12-09 15:57:38 -0500
committerThomas Gleixner <tglx@linutronix.de>2016-12-19 05:34:15 -0500
commit93ffa9a479ffb65d045e74e141346e7f107fcde1 (patch)
tree796ede7c9f1d849f055c197dec491c64725bc173
parent2b4c91569a40c4512ea1b413e0c817d179ce9868 (diff)
x86/init: Add i8042 state to the platform data
Add i8042 state to the platform data to help i8042 driver make decision whether to probe for i8042 or not. We recognize 3 states: platform/subarch ca not possible have i8042 (as is the case with Inrel MID platform), firmware (such as ACPI) reports that i8042 is absent from the device, or i8042 may be present and the driver should probe for it. The intent is to allow i8042 driver abort initialization on x86 if PNP data (absence of both keyboard and mouse PNP devices) agrees with firmware data. It will also allow us to remove i8042_detect later. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Tested-by: Takashi Iwai <tiwai@suse.de> Acked-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Cc: linux-input@vger.kernel.org Link: http://lkml.kernel.org/r/1481317061-31486-2-git-send-email-dmitry.torokhov@gmail.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/include/asm/x86_init.h18
-rw-r--r--arch/x86/kernel/acpi/boot.c7
-rw-r--r--arch/x86/kernel/platform-quirks.c5
3 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 6ba793178441..c4d09c797cf7 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -165,8 +165,25 @@ struct x86_legacy_devices {
165}; 165};
166 166
167/** 167/**
168 * enum x86_legacy_i8042_state - i8042 keyboard controller state
169 * @X86_LEGACY_I8042_PLATFORM_ABSENT: the controller is always absent on
170 * given platform/subarch.
171 * @X86_LEGACY_I8042_FIRMWARE_ABSENT: firmware reports that the controller
172 * is absent.
173 * @X86_LEGACY_i8042_EXPECTED_PRESENT: the controller is likely to be
174 * present, the i8042 driver should probe for controller existence.
175 */
176enum x86_legacy_i8042_state {
177 X86_LEGACY_I8042_PLATFORM_ABSENT,
178 X86_LEGACY_I8042_FIRMWARE_ABSENT,
179 X86_LEGACY_I8042_EXPECTED_PRESENT,
180};
181
182/**
168 * struct x86_legacy_features - legacy x86 features 183 * struct x86_legacy_features - legacy x86 features
169 * 184 *
185 * @i8042: indicated if we expect the device to have i8042 controller
186 * present.
170 * @rtc: this device has a CMOS real-time clock present 187 * @rtc: this device has a CMOS real-time clock present
171 * @reserve_bios_regions: boot code will search for the EBDA address and the 188 * @reserve_bios_regions: boot code will search for the EBDA address and the
172 * start of the 640k - 1M BIOS region. If false, the platform must 189 * start of the 640k - 1M BIOS region. If false, the platform must
@@ -175,6 +192,7 @@ struct x86_legacy_devices {
175 * documentation for further details. 192 * documentation for further details.
176 */ 193 */
177struct x86_legacy_features { 194struct x86_legacy_features {
195 enum x86_legacy_i8042_state i8042;
178 int rtc; 196 int rtc;
179 int reserve_bios_regions; 197 int reserve_bios_regions;
180 struct x86_legacy_devices devices; 198 struct x86_legacy_devices devices;
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 6f65b0eed384..64422f850e95 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -930,6 +930,13 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
930 x86_platform.legacy.devices.pnpbios = 0; 930 x86_platform.legacy.devices.pnpbios = 0;
931 } 931 }
932 932
933 if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
934 !(acpi_gbl_FADT.boot_flags & ACPI_FADT_8042) &&
935 x86_platform.legacy.i8042 != X86_LEGACY_I8042_PLATFORM_ABSENT) {
936 pr_debug("ACPI: i8042 controller is absent\n");
937 x86_platform.legacy.i8042 = X86_LEGACY_I8042_FIRMWARE_ABSENT;
938 }
939
933 if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) { 940 if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) {
934 pr_debug("ACPI: not registering RTC platform device\n"); 941 pr_debug("ACPI: not registering RTC platform device\n");
935 x86_platform.legacy.rtc = 0; 942 x86_platform.legacy.rtc = 0;
diff --git a/arch/x86/kernel/platform-quirks.c b/arch/x86/kernel/platform-quirks.c
index 24a50301f150..91271122f0df 100644
--- a/arch/x86/kernel/platform-quirks.c
+++ b/arch/x86/kernel/platform-quirks.c
@@ -6,6 +6,7 @@
6 6
7void __init x86_early_init_platform_quirks(void) 7void __init x86_early_init_platform_quirks(void)
8{ 8{
9 x86_platform.legacy.i8042 = X86_LEGACY_I8042_EXPECTED_PRESENT;
9 x86_platform.legacy.rtc = 1; 10 x86_platform.legacy.rtc = 1;
10 x86_platform.legacy.reserve_bios_regions = 0; 11 x86_platform.legacy.reserve_bios_regions = 0;
11 x86_platform.legacy.devices.pnpbios = 1; 12 x86_platform.legacy.devices.pnpbios = 1;
@@ -16,10 +17,14 @@ void __init x86_early_init_platform_quirks(void)
16 break; 17 break;
17 case X86_SUBARCH_XEN: 18 case X86_SUBARCH_XEN:
18 case X86_SUBARCH_LGUEST: 19 case X86_SUBARCH_LGUEST:
20 x86_platform.legacy.devices.pnpbios = 0;
21 x86_platform.legacy.rtc = 0;
22 break;
19 case X86_SUBARCH_INTEL_MID: 23 case X86_SUBARCH_INTEL_MID:
20 case X86_SUBARCH_CE4100: 24 case X86_SUBARCH_CE4100:
21 x86_platform.legacy.devices.pnpbios = 0; 25 x86_platform.legacy.devices.pnpbios = 0;
22 x86_platform.legacy.rtc = 0; 26 x86_platform.legacy.rtc = 0;
27 x86_platform.legacy.i8042 = X86_LEGACY_I8042_PLATFORM_ABSENT;
23 break; 28 break;
24 } 29 }
25 30