Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dmitry Torokhov and committed by
Thomas Gleixner
93ffa9a4 2b4c9156

+30
+18
arch/x86/include/asm/x86_init.h
··· 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 + */ 176 + enum 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 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 187 * @rtc: this device has a CMOS real-time clock present 171 188 * @reserve_bios_regions: boot code will search for the EBDA address and the 172 189 * start of the 640k - 1M BIOS region. If false, the platform must ··· 192 175 * documentation for further details. 193 176 */ 194 177 struct x86_legacy_features { 178 + enum x86_legacy_i8042_state i8042; 195 179 int rtc; 196 180 int reserve_bios_regions; 197 181 struct x86_legacy_devices devices;
+7
arch/x86/kernel/acpi/boot.c
··· 930 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 940 if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) { 934 941 pr_debug("ACPI: not registering RTC platform device\n"); 935 942 x86_platform.legacy.rtc = 0;
+5
arch/x86/kernel/platform-quirks.c
··· 6 6 7 7 void __init x86_early_init_platform_quirks(void) 8 8 { 9 + x86_platform.legacy.i8042 = X86_LEGACY_I8042_EXPECTED_PRESENT; 9 10 x86_platform.legacy.rtc = 1; 10 11 x86_platform.legacy.reserve_bios_regions = 0; 11 12 x86_platform.legacy.devices.pnpbios = 1; ··· 17 16 break; 18 17 case X86_SUBARCH_XEN: 19 18 case X86_SUBARCH_LGUEST: 19 + x86_platform.legacy.devices.pnpbios = 0; 20 + x86_platform.legacy.rtc = 0; 21 + break; 20 22 case X86_SUBARCH_INTEL_MID: 21 23 case X86_SUBARCH_CE4100: 22 24 x86_platform.legacy.devices.pnpbios = 0; 23 25 x86_platform.legacy.rtc = 0; 26 + x86_platform.legacy.i8042 = X86_LEGACY_I8042_PLATFORM_ABSENT; 24 27 break; 25 28 } 26 29