Lines Matching +full:static +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * osi.c - _OSI implementation
27 bool enable; member
30 static struct acpi_osi_config {
40 static struct acpi_osi_config osi_config;
41 static struct acpi_osi_entry
48 * Linux-Dell-Video is used by BIOS to disable RTD3 for NVidia graphics
55 {"Linux-Dell-Video", true},
57 * Linux-Lenovo-NV-HDMI-Audio is used by BIOS to power on NVidia's HDMI
58 * audio device which is turned off for power-saving in Windows OS.
63 {"Linux-Lenovo-NV-HDMI-Audio", true},
65 * Linux-HPI-Hybrid-Graphics is used by BIOS to enable dGPU to
70 {"Linux-HPI-Hybrid-Graphics", true},
73 static u32 acpi_osi_handler(acpi_string interface, u32 supported) in acpi_osi_handler()
96 bool enable = true; in acpi_osi_setup() local
120 osi->enable = false; in acpi_osi_setup()
127 enable = false; in acpi_osi_setup()
132 if (!strcmp(osi->string, str)) { in acpi_osi_setup()
133 osi->enable = enable; in acpi_osi_setup()
135 } else if (osi->string[0] == '\0') { in acpi_osi_setup()
136 osi->enable = enable; in acpi_osi_setup()
137 strncpy(osi->string, str, OSI_STRING_LENGTH_MAX); in acpi_osi_setup()
143 static void __init __acpi_osi_setup_darwin(bool enable) in __acpi_osi_setup_darwin() argument
145 osi_config.darwin_enable = !!enable; in __acpi_osi_setup_darwin()
146 if (enable) { in __acpi_osi_setup_darwin()
155 static void __init acpi_osi_setup_darwin(bool enable) in acpi_osi_setup_darwin() argument
160 __acpi_osi_setup_darwin(enable); in acpi_osi_setup_darwin()
166 * From pre-history through Linux-2.6.22, Linux responded TRUE upon a BIOS
171 * ill-conceived and opening the door to an un-bounded number of BIOS
174 * For example, OSI(Linux) was used on resume to re-POST a video card on
177 * capability, Linux has no way to tell the BIOS to skip the time-consuming
178 * POST -- putting Linux at a permanent performance disadvantage. On
185 * Linux-2.6.23 onward we respond FALSE.
192 static void __init __acpi_osi_setup_linux(bool enable) in __acpi_osi_setup_linux() argument
194 osi_config.linux_enable = !!enable; in __acpi_osi_setup_linux()
195 if (enable) in __acpi_osi_setup_linux()
201 static void __init acpi_osi_setup_linux(bool enable) in acpi_osi_setup_linux() argument
206 __acpi_osi_setup_linux(enable); in acpi_osi_setup_linux()
214 * otherwise string is added to list, augmenting built-in strings
216 static void __init acpi_osi_setup_late(void) in acpi_osi_setup_late()
234 str = osi->string; in acpi_osi_setup_late()
237 if (osi->enable) { in acpi_osi_setup_late()
249 static int __init osi_setup(char *str) in osi_setup()
272 static void __init acpi_osi_dmi_darwin(void) in acpi_osi_dmi_darwin()
279 static void __init acpi_osi_dmi_linux(bool enable, in acpi_osi_dmi_linux() argument
282 pr_notice("DMI detected to setup _OSI(\"Linux\"): %s\n", d->ident); in acpi_osi_dmi_linux()
284 __acpi_osi_setup_linux(enable); in acpi_osi_dmi_linux()
287 static int __init dmi_enable_osi_linux(const struct dmi_system_id *d) in dmi_enable_osi_linux()
294 static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) in dmi_disable_osi_vista()
296 pr_notice("DMI detected: %s\n", d->ident); in dmi_disable_osi_vista()
304 static int __init dmi_disable_osi_win7(const struct dmi_system_id *d) in dmi_disable_osi_win7()
306 pr_notice("DMI detected: %s\n", d->ident); in dmi_disable_osi_win7()
312 static int __init dmi_disable_osi_win8(const struct dmi_system_id *d) in dmi_disable_osi_win8()
314 pr_notice("DMI detected: %s\n", d->ident); in dmi_disable_osi_win8()
326 static const struct dmi_system_id acpi_osi_dmi_table[] __initconst = {
348 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
354 .ident = "Sony VGN-NS10J_S",
357 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NS10J_S"),
362 .ident = "Sony VGN-SR290J",
365 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR290J"),
370 .ident = "VGN-NS50B_L",
373 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NS50B_L"),
378 .ident = "VGN-SR19XN",
381 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR19XN"),
491 static __init void acpi_osi_dmi_blacklisted(void) in acpi_osi_dmi_blacklisted()
495 /* Enable _OSI("Darwin") for Apple platforms. */ in acpi_osi_dmi_blacklisted()