Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  osi.c - _OSI implementation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Copyright (C) 2016 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *    Author: Lv Zheng <lv.zheng@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) /* Uncomment next line to get verbose printout */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) /* #define DEBUG */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #define pr_fmt(fmt) "ACPI: " fmt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/dmi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/platform_data/x86/apple.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include "internal.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define OSI_STRING_LENGTH_MAX	64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #define OSI_STRING_ENTRIES_MAX	16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) struct acpi_osi_entry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	char string[OSI_STRING_LENGTH_MAX];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	bool enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) static struct acpi_osi_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	u8		default_disabling;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	unsigned int	linux_enable:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	unsigned int	linux_dmi:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	unsigned int	linux_cmdline:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	unsigned int	darwin_enable:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	unsigned int	darwin_dmi:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	unsigned int	darwin_cmdline:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) } osi_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) static struct acpi_osi_config osi_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) static struct acpi_osi_entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	{"Module Device", true},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	{"Processor Device", true},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	{"3.0 _SCP Extensions", true},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	{"Processor Aggregator Device", true},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	 * Linux-Dell-Video is used by BIOS to disable RTD3 for NVidia graphics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	 * cards as RTD3 is not supported by drivers now.  Systems with NVidia
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	 * cards will hang without RTD3 disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	 * Once NVidia drivers officially support RTD3, this _OSI strings can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	 * be removed if both new and old graphics cards are supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	{"Linux-Dell-Video", true},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	 * Linux-Lenovo-NV-HDMI-Audio is used by BIOS to power on NVidia's HDMI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	 * audio device which is turned off for power-saving in Windows OS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	 * This power management feature observed on some Lenovo Thinkpad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	 * systems which will not be able to output audio via HDMI without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	 * a BIOS workaround.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	{"Linux-Lenovo-NV-HDMI-Audio", true},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	 * Linux-HPI-Hybrid-Graphics is used by BIOS to enable dGPU to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	 * output video directly to external monitors on HP Inc. mobile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	 * workstations as Nvidia and AMD VGA drivers provide limited
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	 * hybrid graphics supports.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	{"Linux-HPI-Hybrid-Graphics", true},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) static u32 acpi_osi_handler(acpi_string interface, u32 supported)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	if (!strcmp("Linux", interface)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		pr_notice_once(FW_BUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 			"BIOS _OSI(Linux) query %s%s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 			osi_config.linux_enable ? "honored" : "ignored",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 			osi_config.linux_cmdline ? " via cmdline" :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 			osi_config.linux_dmi ? " via DMI" : "");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	if (!strcmp("Darwin", interface)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 		pr_notice_once(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 			"BIOS _OSI(Darwin) query %s%s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 			osi_config.darwin_enable ? "honored" : "ignored",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 			osi_config.darwin_cmdline ? " via cmdline" :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 			osi_config.darwin_dmi ? " via DMI" : "");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	return supported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) void __init acpi_osi_setup(char *str)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	struct acpi_osi_entry *osi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	bool enable = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	if (!acpi_gbl_create_osi_method)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	if (str == NULL || *str == '\0') {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		pr_info("_OSI method disabled\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		acpi_gbl_create_osi_method = FALSE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	if (*str == '!') {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 		str++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		if (*str == '\0') {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 			/* Do not override acpi_osi=!* */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 			if (!osi_config.default_disabling)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 				osi_config.default_disabling =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 					ACPI_DISABLE_ALL_VENDOR_STRINGS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 		} else if (*str == '*') {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 			osi_config.default_disabling = ACPI_DISABLE_ALL_STRINGS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 			for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 				osi = &osi_setup_entries[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 				osi->enable = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		} else if (*str == '!') {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 			osi_config.default_disabling = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		enable = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		osi = &osi_setup_entries[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		if (!strcmp(osi->string, str)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 			osi->enable = enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		} else if (osi->string[0] == '\0') {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 			osi->enable = enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 			strncpy(osi->string, str, OSI_STRING_LENGTH_MAX);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) static void __init __acpi_osi_setup_darwin(bool enable)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	osi_config.darwin_enable = !!enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	if (enable) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		acpi_osi_setup("!");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		acpi_osi_setup("Darwin");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		acpi_osi_setup("!!");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		acpi_osi_setup("!Darwin");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) static void __init acpi_osi_setup_darwin(bool enable)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	/* Override acpi_osi_dmi_blacklisted() */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	osi_config.darwin_dmi = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	osi_config.darwin_cmdline = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	__acpi_osi_setup_darwin(enable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)  * The story of _OSI(Linux)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)  * From pre-history through Linux-2.6.22, Linux responded TRUE upon a BIOS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)  * OSI(Linux) query.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)  * Unfortunately, reference BIOS writers got wind of this and put
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)  * OSI(Linux) in their example code, quickly exposing this string as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)  * ill-conceived and opening the door to an un-bounded number of BIOS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)  * incompatibilities.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)  * For example, OSI(Linux) was used on resume to re-POST a video card on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)  * one system, because Linux at that time could not do a speedy restore in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)  * its native driver. But then upon gaining quick native restore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)  * capability, Linux has no way to tell the BIOS to skip the time-consuming
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)  * POST -- putting Linux at a permanent performance disadvantage. On
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)  * another system, the BIOS writer used OSI(Linux) to infer native OS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)  * support for IPMI!  On other systems, OSI(Linux) simply got in the way of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)  * Linux claiming to be compatible with other operating systems, exposing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)  * BIOS issues such as skipped device initialization.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)  * So "Linux" turned out to be a really poor chose of OSI string, and from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)  * Linux-2.6.23 onward we respond FALSE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)  * BIOS writers should NOT query _OSI(Linux) on future systems. Linux will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)  * complain on the console when it sees it, and return FALSE. To get Linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)  * to return TRUE for your system  will require a kernel source update to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)  * add a DMI entry, or boot with "acpi_osi=Linux"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) static void __init __acpi_osi_setup_linux(bool enable)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	osi_config.linux_enable = !!enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	if (enable)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		acpi_osi_setup("Linux");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		acpi_osi_setup("!Linux");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) static void __init acpi_osi_setup_linux(bool enable)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	/* Override acpi_osi_dmi_blacklisted() */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	osi_config.linux_dmi = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	osi_config.linux_cmdline = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	__acpi_osi_setup_linux(enable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)  * Modify the list of "OS Interfaces" reported to BIOS via _OSI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)  * empty string disables _OSI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)  * string starting with '!' disables that string
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)  * otherwise string is added to list, augmenting built-in strings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) static void __init acpi_osi_setup_late(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	struct acpi_osi_entry *osi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	char *str;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	if (osi_config.default_disabling) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 		status = acpi_update_interfaces(osi_config.default_disabling);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 		if (ACPI_SUCCESS(status))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 			pr_info("Disabled all _OSI OS vendors%s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 				osi_config.default_disabling ==
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 				ACPI_DISABLE_ALL_STRINGS ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 				" and feature groups" : "");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		osi = &osi_setup_entries[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 		str = osi->string;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 		if (*str == '\0')
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 		if (osi->enable) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 			status = acpi_install_interface(str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 			if (ACPI_SUCCESS(status))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 				pr_info("Added _OSI(%s)\n", str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 			status = acpi_remove_interface(str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 			if (ACPI_SUCCESS(status))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 				pr_info("Deleted _OSI(%s)\n", str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) static int __init osi_setup(char *str)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	if (str && !strcmp("Linux", str))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 		acpi_osi_setup_linux(true);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	else if (str && !strcmp("!Linux", str))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 		acpi_osi_setup_linux(false);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	else if (str && !strcmp("Darwin", str))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 		acpi_osi_setup_darwin(true);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	else if (str && !strcmp("!Darwin", str))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 		acpi_osi_setup_darwin(false);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 		acpi_osi_setup(str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) __setup("acpi_osi=", osi_setup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) bool acpi_osi_is_win8(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	return acpi_gbl_osi_data >= ACPI_OSI_WIN_8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) EXPORT_SYMBOL(acpi_osi_is_win8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) static void __init acpi_osi_dmi_darwin(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 	pr_notice("DMI detected to setup _OSI(\"Darwin\"): Apple hardware\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	osi_config.darwin_dmi = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	__acpi_osi_setup_darwin(true);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) static void __init acpi_osi_dmi_linux(bool enable,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 				      const struct dmi_system_id *d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	pr_notice("DMI detected to setup _OSI(\"Linux\"): %s\n", d->ident);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	osi_config.linux_dmi = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	__acpi_osi_setup_linux(enable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) static int __init dmi_enable_osi_linux(const struct dmi_system_id *d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	acpi_osi_dmi_linux(true, d);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) static int __init dmi_disable_osi_vista(const struct dmi_system_id *d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 	pr_notice("DMI detected: %s\n", d->ident);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 	acpi_osi_setup("!Windows 2006");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 	acpi_osi_setup("!Windows 2006 SP1");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 	acpi_osi_setup("!Windows 2006 SP2");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) static int __init dmi_disable_osi_win7(const struct dmi_system_id *d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 	pr_notice("DMI detected: %s\n", d->ident);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 	acpi_osi_setup("!Windows 2009");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) static int __init dmi_disable_osi_win8(const struct dmi_system_id *d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	pr_notice("DMI detected: %s\n", d->ident);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 	acpi_osi_setup("!Windows 2012");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321)  * Linux default _OSI response behavior is determined by this DMI table.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323)  * Note that _OSI("Linux")/_OSI("Darwin") determined here can be overridden
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)  * by acpi_osi=!Linux/acpi_osi=!Darwin command line options.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) static const struct dmi_system_id acpi_osi_dmi_table[] __initconst = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 	.callback = dmi_disable_osi_vista,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 	.ident = "Fujitsu Siemens",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 		     DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 		     DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 	 * There have a NVIF method in MSI GX723 DSDT need call by Nvidia
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	 * driver (e.g. nouveau) when user press brightness hotkey.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 	 * Currently, nouveau driver didn't do the job and it causes there
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 	 * have a infinite while loop in DSDT when user press hotkey.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 	 * We add MSI GX723's dmi information to this table for workaround
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	 * this issue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 	 * Will remove MSI GX723 from the table after nouveau grows support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 	.callback = dmi_disable_osi_vista,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 	.ident = "MSI GX723",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 		     DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 		     DMI_MATCH(DMI_PRODUCT_NAME, "GX723"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	.callback = dmi_disable_osi_vista,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 	.ident = "Sony VGN-NS10J_S",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 		     DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 		     DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NS10J_S"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 	.callback = dmi_disable_osi_vista,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 	.ident = "Sony VGN-SR290J",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 		     DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 		     DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR290J"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 	.callback = dmi_disable_osi_vista,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 	.ident = "VGN-NS50B_L",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 		     DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 		     DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NS50B_L"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 	.callback = dmi_disable_osi_vista,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 	.ident = "VGN-SR19XN",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 		     DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 		     DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR19XN"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 	.callback = dmi_disable_osi_vista,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 	.ident = "Toshiba Satellite L355",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 		     DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 		     DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 	.callback = dmi_disable_osi_win7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	.ident = "ASUS K50IJ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 		     DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 		     DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 	.callback = dmi_disable_osi_vista,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 	.ident = "Toshiba P305D",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 		     DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 		     DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 	.callback = dmi_disable_osi_vista,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 	.ident = "Toshiba NB100",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 		     DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 		     DMI_MATCH(DMI_PRODUCT_NAME, "NB100"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 	 * The wireless hotkey does not work on those machines when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 	 * returning true for _OSI("Windows 2012")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 	.callback = dmi_disable_osi_win8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 	.ident = "Dell Inspiron 7737",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 		    DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 		    DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7737"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 	.callback = dmi_disable_osi_win8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 	.ident = "Dell Inspiron 7537",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 		    DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 		    DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7537"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 	.callback = dmi_disable_osi_win8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 	.ident = "Dell Inspiron 5437",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 		    DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 		    DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 5437"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 	.callback = dmi_disable_osi_win8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 	.ident = "Dell Inspiron 3437",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 		    DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 		    DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 3437"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 	.callback = dmi_disable_osi_win8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 	.ident = "Dell Vostro 3446",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 		    DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 		    DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3446"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 	.callback = dmi_disable_osi_win8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 	.ident = "Dell Vostro 3546",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 		    DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 		    DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3546"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 	 * BIOS invocation of _OSI(Linux) is almost always a BIOS bug.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 	 * Linux ignores it, except for the machines enumerated below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 	 * Without this EEEpc exports a non working WMI interface, with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 	 * this it exports a working "good old" eeepc_laptop interface,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 	 * fixing both brightness control, and rfkill not working.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) 	.callback = dmi_enable_osi_linux,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 	.ident = "Asus EEE PC 1015PX",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) 	.matches = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 		     DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer INC."),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 		     DMI_MATCH(DMI_PRODUCT_NAME, "1015PX"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) 	{}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) static __init void acpi_osi_dmi_blacklisted(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 	dmi_check_system(acpi_osi_dmi_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 	/* Enable _OSI("Darwin") for Apple platforms. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 	if (x86_apple_machine)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 		acpi_osi_dmi_darwin();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) int __init early_acpi_osi_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 	acpi_osi_dmi_blacklisted();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) int __init acpi_osi_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) 	acpi_install_interface_handler(acpi_osi_handler);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 	acpi_osi_setup_late();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) }