/* * Copyright (C) 2015 Red Hat Inc. * Hans de Goede <[email protected]> * Copyright (C) 2008 SuSE Linux Products GmbH * Thomas Renninger <[email protected]> * * May be copied or modified under the terms of the GNU General Public License * * video_detect.c: * After PCI devices are glued with ACPI devices * acpi_get_pci_dev() can be called to identify ACPI graphics * devices for which a real graphics card is plugged in * * Depending on whether ACPI graphics extensions (cmp. ACPI spec Appendix B) * are available, video.ko should be used to handle the device. * * Otherwise vendor specific drivers like thinkpad_acpi, asus-laptop, * sony_acpi,... can take care about backlight brightness. * * Backlight drivers can use acpi_video_get_backlight_type() to determine which * driver should handle the backlight. RAW/GPU-driver backlight drivers must * use the acpi_video_backlight_use_native() helper for this. * * If CONFIG_ACPI_VIDEO is neither set as "compiled in" (y) nor as a module (m) * this file will not be compiled and acpi_video_get_backlight_type() will * always return acpi_backlight_vendor. */ #include <linux/export.h> #include <linux/acpi.h> #include <linux/apple-gmux.h> #include <linux/backlight.h> #include <linux/dmi.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/platform_data/x86/nvidia-wmi-ec-backlight.h> #include <linux/pnp.h> #include <linux/types.h> #include <linux/workqueue.h> #include <acpi/video.h> static enum acpi_backlight_type acpi_backlight_cmdline = …; static enum acpi_backlight_type acpi_backlight_dmi = …; static void acpi_video_parse_cmdline(void) { … } static acpi_status find_video(acpi_handle handle, u32 lvl, void *context, void **rv) { … } /* This depends on ACPI_WMI which is X86 only */ #ifdef CONFIG_X86 static bool nvidia_wmi_ec_supported(void) { … } #else static bool nvidia_wmi_ec_supported(void) { return false; } #endif /* Force to use vendor driver when the ACPI device is known to be * buggy */ static int video_detect_force_vendor(const struct dmi_system_id *d) { … } static int video_detect_force_video(const struct dmi_system_id *d) { … } static int video_detect_force_native(const struct dmi_system_id *d) { … } static int video_detect_portege_r100(const struct dmi_system_id *d) { … } static const struct dmi_system_id video_detect_dmi_table[] = …; static bool google_cros_ec_present(void) { … } /* * Windows 8 and newer no longer use the ACPI video interface, so it often * does not work. So on win8+ systems prefer native brightness control. * Chromebooks should always prefer native backlight control. */ static bool prefer_native_over_acpi_video(void) { … } /* * Determine which type of backlight interface to use on this system, * First check cmdline, then dmi quirks, then do autodetect. */ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto_detect) { … } EXPORT_SYMBOL(…);