提交 93ffa9a4 编写于 作者: D Dmitry Torokhov 提交者: Thomas Gleixner

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: NDmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: NTakashi Iwai <tiwai@suse.de>
Acked-by: NMarcos 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.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 2b4c9156
...@@ -164,9 +164,26 @@ struct x86_legacy_devices { ...@@ -164,9 +164,26 @@ struct x86_legacy_devices {
int pnpbios; int pnpbios;
}; };
/**
* enum x86_legacy_i8042_state - i8042 keyboard controller state
* @X86_LEGACY_I8042_PLATFORM_ABSENT: the controller is always absent on
* given platform/subarch.
* @X86_LEGACY_I8042_FIRMWARE_ABSENT: firmware reports that the controller
* is absent.
* @X86_LEGACY_i8042_EXPECTED_PRESENT: the controller is likely to be
* present, the i8042 driver should probe for controller existence.
*/
enum x86_legacy_i8042_state {
X86_LEGACY_I8042_PLATFORM_ABSENT,
X86_LEGACY_I8042_FIRMWARE_ABSENT,
X86_LEGACY_I8042_EXPECTED_PRESENT,
};
/** /**
* struct x86_legacy_features - legacy x86 features * struct x86_legacy_features - legacy x86 features
* *
* @i8042: indicated if we expect the device to have i8042 controller
* present.
* @rtc: this device has a CMOS real-time clock present * @rtc: this device has a CMOS real-time clock present
* @reserve_bios_regions: boot code will search for the EBDA address and the * @reserve_bios_regions: boot code will search for the EBDA address and the
* start of the 640k - 1M BIOS region. If false, the platform must * start of the 640k - 1M BIOS region. If false, the platform must
...@@ -175,6 +192,7 @@ struct x86_legacy_devices { ...@@ -175,6 +192,7 @@ struct x86_legacy_devices {
* documentation for further details. * documentation for further details.
*/ */
struct x86_legacy_features { struct x86_legacy_features {
enum x86_legacy_i8042_state i8042;
int rtc; int rtc;
int reserve_bios_regions; int reserve_bios_regions;
struct x86_legacy_devices devices; struct x86_legacy_devices devices;
......
...@@ -930,6 +930,13 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table) ...@@ -930,6 +930,13 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
x86_platform.legacy.devices.pnpbios = 0; x86_platform.legacy.devices.pnpbios = 0;
} }
if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
!(acpi_gbl_FADT.boot_flags & ACPI_FADT_8042) &&
x86_platform.legacy.i8042 != X86_LEGACY_I8042_PLATFORM_ABSENT) {
pr_debug("ACPI: i8042 controller is absent\n");
x86_platform.legacy.i8042 = X86_LEGACY_I8042_FIRMWARE_ABSENT;
}
if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) { if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) {
pr_debug("ACPI: not registering RTC platform device\n"); pr_debug("ACPI: not registering RTC platform device\n");
x86_platform.legacy.rtc = 0; x86_platform.legacy.rtc = 0;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
void __init x86_early_init_platform_quirks(void) void __init x86_early_init_platform_quirks(void)
{ {
x86_platform.legacy.i8042 = X86_LEGACY_I8042_EXPECTED_PRESENT;
x86_platform.legacy.rtc = 1; x86_platform.legacy.rtc = 1;
x86_platform.legacy.reserve_bios_regions = 0; x86_platform.legacy.reserve_bios_regions = 0;
x86_platform.legacy.devices.pnpbios = 1; x86_platform.legacy.devices.pnpbios = 1;
...@@ -16,10 +17,14 @@ void __init x86_early_init_platform_quirks(void) ...@@ -16,10 +17,14 @@ void __init x86_early_init_platform_quirks(void)
break; break;
case X86_SUBARCH_XEN: case X86_SUBARCH_XEN:
case X86_SUBARCH_LGUEST: case X86_SUBARCH_LGUEST:
x86_platform.legacy.devices.pnpbios = 0;
x86_platform.legacy.rtc = 0;
break;
case X86_SUBARCH_INTEL_MID: case X86_SUBARCH_INTEL_MID:
case X86_SUBARCH_CE4100: case X86_SUBARCH_CE4100:
x86_platform.legacy.devices.pnpbios = 0; x86_platform.legacy.devices.pnpbios = 0;
x86_platform.legacy.rtc = 0; x86_platform.legacy.rtc = 0;
x86_platform.legacy.i8042 = X86_LEGACY_I8042_PLATFORM_ABSENT;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册