summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video_detect.c
Commit message (Collapse)AuthorAgeFilesLines
* ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device()Rafael J. Wysocki2021-12-171-4/+2
| | | | | | | | | Modify the ACPI code to use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() where applicable. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* ACPI: video: use platform backlight driver on Xiaomi Mi Pad 2Hans de Goede2021-11-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | The Xiaomi Mi Pad 2 is a Cherry Trail based x86 tablet which does not use the i915's driver backlight control support: i915 0000:00:02.0: [drm:intel_panel_setup_backlight [i915]] no backlight present per VBT Like all Cherry Trail devices the ACPI tables on the Xiaomi Mi Pad 2 contain a broken ACPI-video implementation which causes 6 different acpi_video backlights to get registered when used. The lack of the i915 driver registering a BACKLIGHT_RAW (aka native) type backlight causes acpi_video_get_backlight_type() to pick the broken acpi_video backlight code as the backlight driver to use. There actually is a separate lp8556 backlight controller connected over I2C which gets registered as a BACKLIGHT_PLATFORM (aka vendor). Add a quirk to force acpi_video_get_backlight_type() to return acpi_backlight_vendor, so that the broken acpi_video backlight interfaces do not get registered. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: video: Drop dmi_system_id.ident settings from video_detect_dmi_table[]Hans de Goede2021-11-031-35/+35
| | | | | | | | | | | The .ident field of the dmi_system_id structs in the video_detect_dmi_table[] is not used by the code. Change all .ident = "..." assignments to comments, this reduces the size of video_detect.o / video.ko by about 1500 bytes. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: video: use native backlight for GA401/GA502/GA503Luke D Jones2021-04-211-0/+24
| | | | | | | | Force backlight control in these models to use the native interface at /sys/class/backlight/amdgpu_bl0. Signed-off-by: Luke D. Jones <luke@ljones.dev> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: video: Add missing callback back for Sony VPCEH3U1EChris Chiu2021-03-191-0/+1
| | | | | | | | | | | | | | The .callback of the quirk for Sony VPCEH3U1E was unintetionally removed by the commit 25417185e9b5 ("ACPI: video: Add DMI quirk for GIGABYTE GB-BXBT-2807"). Add it back to make sure the quirk for Sony VPCEH3U1E works as expected. Fixes: 25417185e9b5 ("ACPI: video: Add DMI quirk for GIGABYTE GB-BXBT-2807") Signed-off-by: Chris Chiu <chris.chiu@canonical.com> Reported-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Pavel Machek (CIP) <pavel@denx.de> Cc: 5.11+ <stable@vger.kernel.org> # 5.11+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: video: Add DMI quirk for GIGABYTE GB-BXBT-2807Jasper St. Pierre2020-12-071-0/+7
| | | | | | | | | | | | | | | | The GIGABYTE GB-BXBT-2807 is a mini-PC which uses off the shelf components, like an Intel GPU which is meant for mobile systems. As such, it, by default, has a backlight controller exposed. Unfortunately, the backlight controller only confuses userspace, which sees the existence of a backlight device node and has the unrealistic belief that there is actually a backlight there! Add a DMI quirk to force the backlight off on this system. Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net> Reviewed-by: Chris Chiu <chiu@endlessos.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: Fix whitespace inconsistenciesMaximilian Luz2020-11-091-8/+8
| | | | | | | | Replaces spaces with tabs where spaces have been (inconsistently) used for indentation and removes trailing whitespaces. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* Merge branch 'acpi-misc'Rafael J. Wysocki2020-10-131-3/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * acpi-misc: ACPI: Make acpi_evaluate_dsm() prototype consistent ACPI: wakeup: Remove dead ACPICA debug code ACPI: video: Remove leftover ACPICA debug code ACPI: tiny-power-button: Remove dead ACPICA debug code ACPI: processor: Remove dead ACPICA debug code ACPI: proc: Remove dead ACPICA debug code ACPI: PCI: Remove unused ACPICA debug code ACPI: event: Remove leftover ACPICA debug code ACPI: dock: Remove dead ACPICA debug code ACPI: debugfs: Remove dead ACPICA debug code ACPI: custom_method: Remove dead ACPICA debug code ACPI: container: Remove leftover ACPICA debug functionality ACPI: platform: Remove ACPI_MODULE_NAME() ACPI: memhotplug: Remove leftover ACPICA debug functionality ACPI: LPSS: Remove ACPI_MODULE_NAME() ACPI: cmos_rtc: Remove leftover ACPI_MODULE_NAME() ACPI: Remove three unused inline functions
| * ACPI: video: Remove leftover ACPICA debug codeHanjun Guo2020-09-251-3/+0
| | | | | | | | | | | | | | | | | | | | After commit (87521e16a7ab "acpi-video-detect: Rewrite backlight interface selection logic"), ACPI_DEBUG_PRINT() was remove, so ACPI_MODULE_NAME() and _COMPONENT are not used anymore, remove them. Signed-off-by: Hanjun Guo <guohanjun@huawei.com> [ rjw: Subject edit ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* | ACPI: video: use ACPI backlight for HP 635 NotebookAlex Hung2020-09-251-0/+9
|/ | | | | | | | | | | | The default backlight interface is AMD's radeon_bl0 which does not work on this system, so use the ACPI backlight interface on it instead. BugLink: https://bugs.launchpad.net/bugs/1894667 Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Alex Hung <alex.hung@canonical.com> [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: video: Use native backlight on Acer TravelMate 5735ZPaul Menzel2020-05-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | Currently, changing the brightness of the internal display of the Acer TravelMate 5735Z does not work. Pressing the function keys or changing the slider, GNOME Shell 3.36.2 displays the OSD (five steps), but the brightness does not change. The Acer TravelMate 5735Z shipped with Windows 7 and as such does not trigger our "win8 ready" heuristic for preferring the native backlight interface. Still ACPI backlight control doesn't work on this model, where as the native (intel_video) backlight interface does work by adding `acpi_backlight=native` or `acpi_backlight=none` to Linux’ command line. So, add a quirk to force using native backlight control on this model. Link: https://bugzilla.kernel.org/show_bug.cgi?id=207835 Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: video: Use native backlight on Acer Aspire 5783zHans de Goede2020-04-011-0/+9
| | | | | | | | | | | | The Acer Aspire 5783z shipped with Windows 7 and as such does not trigger our "win8 ready" heuristic for prefering the native backlight interface. Still ACPI backlight control doesn't work on this model, where as the native (intel_video) backlight interface does work. Add a quirk to force using native backlight control on this model. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: video: Do not export a non working backlight interface on MSI MS-7721 ↵Hans de Goede2019-12-191-0/+13
| | | | | | | | | | | | | | | | | | | | boards Despite our heuristics to not wrongly export a non working ACPI backlight interface on desktop machines, we still end up exporting one on desktops using a motherboard from the MSI MS-7721 series. I've looked at improving the heuristics, but in this case a quirk seems to be the only way to solve this. While at it also add a comment to separate the video_detect_force_none entries in the video_detect_dmi_table from other type of entries, as we already do for the other entry types. Cc: All applicable <stable@vger.kernel.org> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1783786 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: video: Use native backlight on Lenovo E41-25/45Aaron Ma2019-12-161-0/+16
| | | | | | | | ACPI backlight control doesn't work on 2 Lenovo E41 laptops. So force to use native backlight control on them. Signed-off-by: Aaron Ma <aaron.ma@canonical.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
*-. Merge branches 'acpi-utils', 'acpi-video', 'acpi-soc' and 'acpi-button'Rafael J. Wysocki2019-05-061-0/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * acpi-utils: gpio: merrifield: Fix build err without CONFIG_ACPI ACPI / utils: Remove deprecated function since no user left ASoC: Intel: cht_bsw_rt5672: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5645: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5651: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5640: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_es8316: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_da7213: Convert to use acpi_dev_get_first_match_dev() gpio: merrifield: Convert to use acpi_dev_get_first_match_dev() extcon: axp288: Convert to use acpi_dev_get_first_match_dev() ACPI / utils: Introduce acpi_dev_get_first_match_dev() helper * acpi-video: ACPI: video: Use vendor backlight on Sony VPCEH3U1E * acpi-soc: ACPI / LPSS: Use acpi_lpss_* instead of acpi_subsys_* functions for hibernate * acpi-button: ACPI: button: reinitialize button state upon resume
| | * ACPI: video: Use vendor backlight on Sony VPCEH3U1EZhang Rui2019-04-011-0/+8
| |/ | | | | | | | | | | | | | | | | On Sony Vaio VPCEH3U1E, ACPI backlight control does not work, and native backlight works. Thus force use vendor backlight control on this system. Link: https://bugzilla.kernel.org/show_bug.cgi?id=202401 Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* / ACPI: Fix comment typosBjorn Helgaas2019-03-261-1/+1
|/ | | | | | | Fix some misspellings in comments. No functional change intended. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add quirk to force acpi-video backlight on Samsung 670Z5EHans de Goede2018-03-201-0/+9
| | | | | | | | | | | Just like many other Samsung models, the 670Z5E needs to use the acpi-video backlight interface rather then the native one for backlight control to work, add a quirk for this. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1557060 Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add force_none quirk for Dell OptiPlex 9020MAlex Hung2017-07-161-0/+14
| | | | | | | | Dell OptiPlex 9020M is a micro PC desktop that has no built-in LCD panel and its acpi_video does not work. Signed-off-by: Alex Hung <alex.hung@canonical.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add quirks for the Dell Precision 7510Shih-Yuan Lee (FourDollars)2017-06-281-0/+8
| | | | | | | | | | | | | The Dell Precision 7510 has a broken acpi-video implementation. The backlight control bits work, but when the brightness is changed via the acpi-video interface the backlight flickers annoyingly before settling at the new brightness, switching to using the native interface fixes the flickering so add a quirk for this (the vendor interface can not change the brightness at all). Signed-off-by: Shih-Yuan Lee (FourDollars) <sylee@canonical.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* Revert "ACPI / video: Add force_native quirk for HP Pavilion dv6"Hans de Goede2017-01-251-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit 6276e53fa8c0 (ACPI / video: Add force_native quirk for HP Pavilion dv6). In the commit message for the quirk this revert removes I wrote: "Note that there are quite a few HP Pavilion dv6 variants, some woth ATI and some with NVIDIA hybrid gfx, both seem to need this quirk to have working backlight control. There are also some versions with only Intel integrated gfx, these may not need this quirk, but it should not hurt there." Unfortunately that seems wrong, I've already received 2 reports of this commit causing regressions on some dv6 variants (at least one of which actually has a nvidia GPU). So it seems that HP has made a mess here by using the same model-name both in marketing and in the DMI data for many different variants. Some of which need acpi_backlight=native for functional backlight control (as the quirk this commit reverts was doing), where as others are broken by it. So lets get back to the old sitation so as to avoid regressing on models which used to work without any kernel cmdline arguments before. Fixes: 6276e53fa8c0 (ACPI / video: Add force_native quirk for HP Pavilion dv6) Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add force_native quirk for HP Pavilion dv6Hans de Goede2016-11-291-0/+11
| | | | | | | | | | | | | | | | | | | The HP Pavilion dv6 has a non-working acpi_video0 backlight interface and an intel_backlight interface which works fine. Add a force_native quirk for it so that the non-working acpi_video0 interface does not get registered. Note that there are quite a few HP Pavilion dv6 variants, some woth ATI and some with NVIDIA hybrid gfx, both seem to need this quirk to have working backlight control. There are also some versions with only Intel integrated gfx, these may not need this quirk, but it should not hurt there. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1204476 Link: https://bugs.launchpad.net/ubuntu/+source/linux-lts-trusty/+bug/1416940 Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add force_native quirk for Dell XPS 17 L702XHans de Goede2016-11-291-0/+9
| | | | | | | | | | | | | | | | The Dell XPS 17 L702X has a non-working acpi_video0 backlight interface and an intel_backlight interface which works fine. Add a force_native quirk for it so that the non-working acpi_video0 interface does not get registered. Note that there also is an issue with the brightnesskeys on this laptop, they do not generate key-press events in anyway. That is not solved by this patch. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1123661 Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Thinkpad X201 Tablet needs video_detect_force_videoRalf Gerbig2016-06-221-0/+8
| | | | | | | | Add Thinkpad X201 Tablet to the video_detect_force_video blacklist. Signed-off-by: Ralf Gerbig <rge@quengel.org> [ rjw : Changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* video / backlight: remove the backlight_device_registered APIAaron Lu2016-05-041-1/+1
| | | | | | | | | | Since we will need the backlight_device_get_by_type API, we can use it instead of the backlight_device_registered API whenever necessary so remove the backlight_device_registered API. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist"Hans de Goede2016-01-231-8/+0
| | | | | | | | | | | | | | | | | | | | | The quirk to get "acpi_backlight=vendor" behavior by default on the Dell Inspiron 5737 was added before we started doing "acpi_backlight=native" by default on Win8 ready machines. Since we now avoid using acpi-video as backlight driver on these machines by default (using the native driver instead) we no longer need this quirk. Moreover the vendor driver does not work after a suspend/resume where as the native driver does. This reverts commit 08a56226d847 (ACPI / video: Add Dell Inspiron 5737 to the blacklist). Link: https://bugzilla.kernel.org/show_bug.cgi?id=111061 Cc: 3.19+ <stable@vger.kernel.org> # 3.19+ Reported-and-tested-by: erusan@gmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add a quirk to force acpi-video backlight on SAMSUNG 530U4E/540U4EAaron Lu2016-01-011-0/+9
| | | | | | | | | | | The native interface on SAMSUNG 530U4E/540U4E doesn't work even though the firmware claims Win8 compatible while the acpi_video interface works, add a quirk for this. Link: https://bugzilla.kernel.org/show_bug.cgi?id=108971 Reported-and-tested-by: adam bk <adamdd55@gmail.com> Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add quirks for the Dell Vostro V131Hans de Goede2016-01-011-0/+8
| | | | | | | | | | | | | | | | | | | | | The Dell Vostro V131 has an especially broken acpi-video implementation. The backlight control bits work, but when the brightness is changed via the acpi-video interface the backlight flickers annoyingly before settling at the new brightness, switching to using the native interface fixes the flickering so add a quirk for this (the vendor interface has the same problem). Brightness keypresses reported through the acpi-video-bus are also broken, they get reported one event delayed, so if you press the brightness-up hotkey on the keyboard nothing happens, then if you press brightness-down, the previous brightness-up event gets reported. Since the keypresses are also reported via wmi (if active) and via atkbd (when wmi is not active) add a quirk to simply filter out the delayed (broken) events. Reported-and-tested-by: Michał Kępień <kernel@kempniu.pl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add a quirk to force acpi-video backlight on Dell XPS L421XHans de Goede2015-11-021-0/+9
| | | | | | | | | | Just like the Dell XPS 15 (L521X) the Dell XPS 14 (L421X) needs to use the acpi-video backlight interface rather then the native one for backlight control to work, add a quirk for this. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1272633 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add a quirk to force native backlight on Lenovo IdeaPad S405Hans de Goede2015-10-261-0/+9
| | | | | | | | | | The Lenovo IdeaPad S405 is a not "Windows8 ready" machine which still has a broken ACPI video backlight implementation. Add a quirk to force use of native backlight on this machine. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1201530 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Fix circular lock dependency issue in the video-detect codeHans de Goede2015-08-141-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the following would happen: a) acpi_video_get_backlight_type() gets called b) acpi_video_get_backlight_type() calls acpi_video_init_backlight_type() c) acpi_video_init_backlight_type() locks its function static init_mutex d) acpi_video_init_backlight_type() calls backlight_register_notifier() e) backlight_register_notifier() takes its notifier-chain lock And when the backlight notifier chain gets called we've: 1) blocking_notifier_call_chain() gets called 2) blocking_notifier_call_chain() takes the notifier-chain lock 3) blocking_notifier_call_chain() calls acpi_video_backlight_notify() 4) acpi_video_backlight_notify() calls acpi_video_get_backlight_type() 5) acpi_video_get_backlight_type() calls acpi_video_init_backlight_type() 6) acpi_video_init_backlight_type() locks its function static init_mutex So in the first call sequence we have: a) init_mutex gets locked b) notifier-chain gets locked and in the second call sequence we have: 1) notifier-chain gets locked 2) init_mutex gets locked And we've a circular locking dependency. This specific locking dependency is fixable without using the big hammer otherwise known as a workqueue, but further analysis shows a similar problem with the backlight notifier chain lock vs register_count_mutex from drivers/acpi/acpi_video.c, and fixing that becomes problematic. So this commit simply fixes this with the big hammer, performance wise this is a non issue as we expect the work to get scheduled exactly zero or one times during normal system use. Fixes: 93a291dfaf9c (ACPI / video: Move backlight notifier to video_detect.c) Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reported-and-tested-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Make acpi_video_unregister_backlight() privateHans de Goede2015-06-191-0/+2
| | | | | | | | | | acpi_video_unregister_backlight() is now only used by video_detect.c which is part of the same acpi_video module as video.c, make acpi_video_unregister_backlight() private to this module. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* acpi-video-detect: Remove old APIHans de Goede2015-06-191-31/+0
| | | | | | | | | Remove the old backlight interface selection API now that all drivers have been ported to the new API. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Move backlight notifier to video_detect.cHans de Goede2015-06-191-0/+27
| | | | | | | | | | | | | Move the unregistering of the acpi backlight interface on registering of a native backlight from video.c to video_detect.c where it belongs. Note this removes support for re-registering the acpi backlight interface when the native interface goes away. In practice this never happens and it needlessly complicates the code. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Port to new backlight interface selection APIHans de Goede2015-06-191-0/+130
| | | | | | | | | | | Most of the patch is moving the dmi quirks for forcing use of the acpi-video / the native backlight interface to video_detect.c. What remains is a nice cleanup. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* acpi-video-detect: Unregister acpi_video backlight when dmi quirks are addedHans de Goede2015-06-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Make acpi_video_set_dmi_backlight_type() call acpi_video_unregister_backlight() when the new dmi quirk results in the desired backlight interface being of a type other then acpi_backlight_video. This avoid the need for the second if in the following construction which is currently found in many platform/x86 drivers: if (prefer_vendor_quirk) acpi_video_dmi_promote_vendor(); if (!acpi_video_backlight_support()) acpi_video_unregister_backlight() This second if-block will be removed from the platform drivers as part of their conversion to the new backlight interface selection API. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* acpi-video-detect: Rewrite backlight interface selection logicHans de Goede2015-06-191-88/+83
| | | | | | | | | | | | | | | | | | | | | Currently we have 2 kernel commandline options + dmi-quirks in 3 places all interacting (in interesting ways) to select which which backlight interface to use. On the commandline we've acpi_backlight=[video|vendor] and video.use_native_backlight=[0|1]. DMI quirks we have in acpi/video-detect.c, acpi/video.c and drivers/platform/x86/*.c . This commit is the first step to cleaning this up, replacing the 2 cmdline options with just acpi_backlight=[video|vendor|native|none], and adds a new API to video_detect.c to reflect this. Follow up commits will also move other related code, like unregistering the acpi_video backlight interface if it was registered before other drivers which take priority over it are loaded, to video_detect.c where this logic really belongs. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* acpi-video-detect: video: Make video_detect code part of the video moduleHans de Goede2015-06-191-23/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation patch for the backlight interface selection logic cleanup, there are 2 reasons to not always build the video_detect code into the kernel: 1) In order for the video_detect.c to also deal with / select native backlight interfaces on win8 systems, instead of doing this in video.c where it does not belong, video_detect.c needs to call into the backlight class code. Which cannot be done if it is builtin and the blacklight class is not. 2) Currently all the platform/x86 drivers which have quirks to prefer the vendor driver over acpi-video call acpi_video_unregister_backlight() to remove the acpi-video backlight interface, this logic really belongs in video_detect.c, which will cause video_detect.c to depend on symbols of video.c and video.c already depends on video_detect.c symbols, so they really need to be a single module. Note that this commits make 2 changes so as to maintain 100% kernel commandline compatibility: 1) The __setup call for the acpi_backlight= handling is moved to acpi/util.c as __setup may only be used by code which is alwasy builtin 2) video.c is renamed to acpi_video.c so that it can be combined with video_detect.c into video.ko This commit also makes changes to drivers/platform/x86/Kconfig to ensure that drivers which use acpi_video_backlight_support() from video_detect.c, will not be built-in when acpi_video is not built in. This also changes some "select" uses to "depends on" to avoid dependency loops. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* acpi-video-detect: Move acpi_osi_is_win8 to osl.cHans de Goede2015-06-191-6/+0
| | | | | | | | | | | | | | acpi_osi_is_win8 needs access to acpi_gbl_osi_data which is not exported, so move it to osl.c. Alternatively we could export acpi_gbl_osi_data but that seems undesirable. This allows video_detect.c to be build as a module, besides that acpi_osi_is_win8() is something which does not really belong in video_detect.c in the first place. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* acpi-video-detect: Move acpi_is_video_device() to acpi/scan.cHans de Goede2015-06-191-60/+0
| | | | | | | | | | | | | This allows video_detect.c to be build as a module, this is a preparation patch for the backlight interface selection logic cleanup. Note this commit also causes acpi_is_video_device() to always be build indepedent of CONFIG_ACPI_VIDEO, as there is no reason to make its building depend on CONFIG_ACPI_VIDEO. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* acpi-video-detect: Make acpi_video_get_capabilities a private functionHans de Goede2015-06-191-2/+1
| | | | | | | | | | acpi_video_get_capabilities() is only used inside video_detect.c so make it static. While at it also remove the prototype for the non existent acpi_video_display_switch_support function from acpi.h Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* acpi-video-detect: Remove the unused acpi_video_dmi_demote_vendor() functionHans de Goede2015-06-191-9/+0
| | | | | | | | | | Remove the now unused acpi_video_dmi_demote_vendor() function, this was never a proper counter part of acpi_video_dmi_promote_vendor() since the calls to acpi_video_dmi_promote_vendor() are not counted. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: constify ACPI and DMI id tablesMathias Krause2015-06-151-2/+2
| | | | | | | | Make the video ACPI device ID array static and constify the DMI system IDs array. Saves us a little bit of code. Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add force native backlight quirk for Lenovo Ideapad Z570Hans de Goede2015-03-221-8/+0
| | | | | | | | | | | | | | | | | | | | | The Lenovo Ideapad Z570 (which is an Acer in disguise like some other Ideapads) has a broken acpi_video interface, this was fixed in commmit a11d342fb8 ("ACPI / video: force vendor backlight on Lenovo Ideapad Z570"). Which stops acpi_video from registering a backlight interface, but this is only a partial fix, because for people who have the ideapad-laptop module installed that module will now register a backlight interface, which also does not work, so we need to use the native intel_backlight interface. The Lenovo Ideapad 570 is a pre-win8 laptop / too old for the acpi-video code to automatically prefer the native backlight interface, so add a quirk for it. This commit also removes the previous incomplete fix. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1187004 Tested-by: Be <be.0@gmx.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: force vendor backlight on Lenovo Ideapad Z570Stepan Bujnak2014-09-241-0/+8
| | | | | | | | Lenovo Ideapad 570 is a pre-win8 laptop where not using vendor backlight causes the backlight controls not to work. Signed-off-by: Stepan Bujnak <stepanbujnak@fastmail.fm> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add Dell Inspiron 5737 to the blacklistEdward Lin2014-07-071-0/+8
| | | | | | | | | | | | | | With win8 capabiltiy, the ACPI backlight control is broken. The system also loses backlight setting when resuming from S3. Add this model to the the ACPI video detect blacklist to make backlight functionality work. Although backlight functionality works via video.use_native_backlight=1, this approach may be safer. Signed-off-by: Edward Lin <yidi.lin@canonical.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI: Remove duplicate definitions of PREFIXHanjun Guo2014-03-191-2/+0
| | | | | | | | | We already have a macro for PREFIX of "ACPI: " in drivers/acpi/internal.h, so remove the duplicate ones in ACPI drivers when internal.h is included. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add systems that should favour native backlight interfaceAaron Lu2014-02-201-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some system's ACPI video backlight control interface is broken and the native backlight control interface should be used by default. This patch sets the use_native_backlight parameter to true for those systems so that video backlight control interface will not be created. For detailed models that are added here, reference the following list. Note that the user specified kernel cmdline option will always have the highest priority, i.e. if use_native_backlight=0 is specified and the system is in the DMI table, the video module will not skip registering backlight interface for it. Thinkpad T430s: Reported-by: Theodore Tso <tytso@mit.edu> Reported-and-tested-by: Peter Weber <bugs@ttyhoney.com> References: https://bugzilla.kernel.org/show_bug.cgi?id=51231 Thinkpad X230: Reported-and-tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> References: https://bugzilla.kernel.org/show_bug.cgi?id=51231 ThinkPad X1 Carbon: Reported-and-tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Lenovo Yoga 13: Reported-by: Lennart Poettering <lennart@poettering.net> Reported-and-tested-by: Kevin Smith <thirdwiggin@gmail.com> References: https://bugzilla.kernel.org/show_bug.cgi?id=63811 Dell Inspiron 7520: Reported-by: Rinat Ibragimov <ibragimovrinat@mail.ru> Acer Aspire 5733Z: Reported-by: <sov.info@mail.ru> References: https://bugzilla.kernel.org/show_bug.cgi?id=62941 Acer Aspire V5-431: Reported-by: Thomas Christensen <christensenthomas@gmail.com> References: https://bugzilla.kernel.org/show_bug.cgi?id=68751 HP ProBook 4340s: Reported-and-tested-by: Vladimir Sherenkov <a_12300@mail.ru> References: http://redmine.russianfedora.pro/issues/1258 HP EliteBook/ProBook 2013 models, ZBook and some others: Provided-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Aaron Lu <aaron.lu@intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Add HP EliteBook Revolve 810 to the blacklistMika Westerberg2014-02-051-0/+8
| | | | | | | | | | | | On HP EliteBook Revolve 810 the ACPI backlight device doesn't work as expected. For example when resuming from system sleep, it seems to lose backlight settings. Forcing Intel driver fixes the problem so add this machine the ACPI video detect blacklist. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* ACPI / video: Fix typo in video_detect.cMasanari Iida2013-12-201-1/+1
| | | | | | | Correct "**retyurn_value" to "**return_value". Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>