drivers-platform-x86: use acpi_video_dmi_promote_vendor()
Instead of using directly acpi_video_unregister(), use acpi_video_dmi_promote_vendor() (and make it call acpi_video_unregister() if needed) Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
This commit is contained in:
parent
f838eb5bd2
commit
a60b21763c
3 changed files with 27 additions and 17 deletions
|
@ -2191,14 +2191,16 @@ static int __init acer_wmi_init(void)
|
||||||
|
|
||||||
set_quirks();
|
set_quirks();
|
||||||
|
|
||||||
|
if (dmi_check_system(video_vendor_dmi_table))
|
||||||
|
acpi_video_dmi_promote_vendor();
|
||||||
if (acpi_video_backlight_support()) {
|
if (acpi_video_backlight_support()) {
|
||||||
if (dmi_check_system(video_vendor_dmi_table)) {
|
interface->capability &= ~ACER_CAP_BRIGHTNESS;
|
||||||
acpi_video_unregister();
|
pr_info("Brightness must be controlled by acpi video driver\n");
|
||||||
} else {
|
} else {
|
||||||
interface->capability &= ~ACER_CAP_BRIGHTNESS;
|
#ifdef CONFIG_ACPI_VIDEO
|
||||||
pr_info("Brightness must be controlled by "
|
pr_info("Disabling ACPI video driver\n");
|
||||||
"acpi video driver\n");
|
acpi_video_unregister();
|
||||||
}
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wmi_has_guid(WMID_GUID3)) {
|
if (wmi_has_guid(WMID_GUID3)) {
|
||||||
|
|
|
@ -193,7 +193,10 @@ static int __devinit gmux_probe(struct pnp_dev *pnp,
|
||||||
* backlight control and supports more levels than other options.
|
* backlight control and supports more levels than other options.
|
||||||
* Disable the other backlight choices.
|
* Disable the other backlight choices.
|
||||||
*/
|
*/
|
||||||
|
acpi_video_dmi_promote_vendor();
|
||||||
|
#ifdef CONFIG_ACPI_VIDEO
|
||||||
acpi_video_unregister();
|
acpi_video_unregister();
|
||||||
|
#endif
|
||||||
apple_bl_unregister();
|
apple_bl_unregister();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -213,7 +216,10 @@ static void __devexit gmux_remove(struct pnp_dev *pnp)
|
||||||
release_region(gmux_data->iostart, gmux_data->iolen);
|
release_region(gmux_data->iostart, gmux_data->iolen);
|
||||||
kfree(gmux_data);
|
kfree(gmux_data);
|
||||||
|
|
||||||
|
acpi_video_dmi_demote_vendor();
|
||||||
|
#ifdef CONFIG_ACPI_VIDEO
|
||||||
acpi_video_register();
|
acpi_video_register();
|
||||||
|
#endif
|
||||||
apple_bl_register();
|
apple_bl_register();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)
|
#ifdef CONFIG_ACPI_VIDEO
|
||||||
#include <acpi/video.h>
|
#include <acpi/video.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1530,15 +1530,18 @@ static int __init samsung_init(void)
|
||||||
samsung->quirks = quirks;
|
samsung->quirks = quirks;
|
||||||
|
|
||||||
|
|
||||||
#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)
|
#ifdef CONFIG_ACPI
|
||||||
|
if (samsung->quirks->broken_acpi_video)
|
||||||
|
acpi_video_dmi_promote_vendor();
|
||||||
|
|
||||||
/* Don't handle backlight here if the acpi video already handle it */
|
/* Don't handle backlight here if the acpi video already handle it */
|
||||||
if (acpi_video_backlight_support()) {
|
if (acpi_video_backlight_support()) {
|
||||||
if (samsung->quirks->broken_acpi_video) {
|
samsung->handle_backlight = false;
|
||||||
pr_info("Disabling ACPI video driver\n");
|
} else if (samsung->quirks->broken_acpi_video) {
|
||||||
acpi_video_unregister();
|
pr_info("Disabling ACPI video driver\n");
|
||||||
} else {
|
#ifdef CONFIG_ACPI_VIDEO
|
||||||
samsung->handle_backlight = false;
|
acpi_video_unregister();
|
||||||
}
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1552,8 +1555,7 @@ static int __init samsung_init(void)
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI
|
#ifdef CONFIG_ACPI
|
||||||
/* Only log that if we are really on a sabi platform */
|
/* Only log that if we are really on a sabi platform */
|
||||||
if (acpi_video_backlight_support() &&
|
if (acpi_video_backlight_support())
|
||||||
!samsung->quirks->broken_acpi_video)
|
|
||||||
pr_info("Backlight controlled by ACPI video driver\n");
|
pr_info("Backlight controlled by ACPI video driver\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue