diff options
author | Corentin Chary <corentin.chary@gmail.com> | 2012-06-13 03:32:02 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2012-07-28 00:11:48 -0400 |
commit | a60b21763cce01c64cc537869662b41429c62e5f (patch) | |
tree | ce4f466fd454dcb0cbf0759c9d530c698cf31b71 /drivers/platform | |
parent | f838eb5bd257e8a666aa8c451058fa198df7e299 (diff) |
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/acer-wmi.c | 16 | ||||
-rw-r--r-- | drivers/platform/x86/apple-gmux.c | 6 | ||||
-rw-r--r-- | drivers/platform/x86/samsung-laptop.c | 22 |
3 files changed, 27 insertions, 17 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 175809dd5587..377d92d8d9b1 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
@@ -2191,14 +2191,16 @@ static int __init acer_wmi_init(void) | |||
2191 | 2191 | ||
2192 | set_quirks(); | 2192 | set_quirks(); |
2193 | 2193 | ||
2194 | if (dmi_check_system(video_vendor_dmi_table)) | ||
2195 | acpi_video_dmi_promote_vendor(); | ||
2194 | if (acpi_video_backlight_support()) { | 2196 | if (acpi_video_backlight_support()) { |
2195 | if (dmi_check_system(video_vendor_dmi_table)) { | 2197 | interface->capability &= ~ACER_CAP_BRIGHTNESS; |
2196 | acpi_video_unregister(); | 2198 | pr_info("Brightness must be controlled by acpi video driver\n"); |
2197 | } else { | 2199 | } else { |
2198 | interface->capability &= ~ACER_CAP_BRIGHTNESS; | 2200 | #ifdef CONFIG_ACPI_VIDEO |
2199 | pr_info("Brightness must be controlled by " | 2201 | pr_info("Disabling ACPI video driver\n"); |
2200 | "acpi video driver\n"); | 2202 | acpi_video_unregister(); |
2201 | } | 2203 | #endif |
2202 | } | 2204 | } |
2203 | 2205 | ||
2204 | if (wmi_has_guid(WMID_GUID3)) { | 2206 | if (wmi_has_guid(WMID_GUID3)) { |
diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 694a15a56230..905fa01ac8df 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c | |||
@@ -193,7 +193,10 @@ static int __devinit gmux_probe(struct pnp_dev *pnp, | |||
193 | * backlight control and supports more levels than other options. | 193 | * backlight control and supports more levels than other options. |
194 | * Disable the other backlight choices. | 194 | * Disable the other backlight choices. |
195 | */ | 195 | */ |
196 | acpi_video_dmi_promote_vendor(); | ||
197 | #ifdef CONFIG_ACPI_VIDEO | ||
196 | acpi_video_unregister(); | 198 | acpi_video_unregister(); |
199 | #endif | ||
197 | apple_bl_unregister(); | 200 | apple_bl_unregister(); |
198 | 201 | ||
199 | return 0; | 202 | return 0; |
@@ -213,7 +216,10 @@ static void __devexit gmux_remove(struct pnp_dev *pnp) | |||
213 | release_region(gmux_data->iostart, gmux_data->iolen); | 216 | release_region(gmux_data->iostart, gmux_data->iolen); |
214 | kfree(gmux_data); | 217 | kfree(gmux_data); |
215 | 218 | ||
219 | acpi_video_dmi_demote_vendor(); | ||
220 | #ifdef CONFIG_ACPI_VIDEO | ||
216 | acpi_video_register(); | 221 | acpi_video_register(); |
222 | #endif | ||
217 | apple_bl_register(); | 223 | apple_bl_register(); |
218 | } | 224 | } |
219 | 225 | ||
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index e2a34b42ddc1..2cbccc1b4b68 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/seq_file.h> | 26 | #include <linux/seq_file.h> |
27 | #include <linux/debugfs.h> | 27 | #include <linux/debugfs.h> |
28 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
29 | #if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) | 29 | #ifdef CONFIG_ACPI_VIDEO |
30 | #include <acpi/video.h> | 30 | #include <acpi/video.h> |
31 | #endif | 31 | #endif |
32 | 32 | ||
@@ -1530,15 +1530,18 @@ static int __init samsung_init(void) | |||
1530 | samsung->quirks = quirks; | 1530 | samsung->quirks = quirks; |
1531 | 1531 | ||
1532 | 1532 | ||
1533 | #if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) | 1533 | #ifdef CONFIG_ACPI |
1534 | if (samsung->quirks->broken_acpi_video) | ||
1535 | acpi_video_dmi_promote_vendor(); | ||
1536 | |||
1534 | /* Don't handle backlight here if the acpi video already handle it */ | 1537 | /* Don't handle backlight here if the acpi video already handle it */ |
1535 | if (acpi_video_backlight_support()) { | 1538 | if (acpi_video_backlight_support()) { |
1536 | if (samsung->quirks->broken_acpi_video) { | 1539 | samsung->handle_backlight = false; |
1537 | pr_info("Disabling ACPI video driver\n"); | 1540 | } else if (samsung->quirks->broken_acpi_video) { |
1538 | acpi_video_unregister(); | 1541 | pr_info("Disabling ACPI video driver\n"); |
1539 | } else { | 1542 | #ifdef CONFIG_ACPI_VIDEO |
1540 | samsung->handle_backlight = false; | 1543 | acpi_video_unregister(); |
1541 | } | 1544 | #endif |
1542 | } | 1545 | } |
1543 | #endif | 1546 | #endif |
1544 | 1547 | ||
@@ -1552,8 +1555,7 @@ static int __init samsung_init(void) | |||
1552 | 1555 | ||
1553 | #ifdef CONFIG_ACPI | 1556 | #ifdef CONFIG_ACPI |
1554 | /* Only log that if we are really on a sabi platform */ | 1557 | /* Only log that if we are really on a sabi platform */ |
1555 | if (acpi_video_backlight_support() && | 1558 | if (acpi_video_backlight_support()) |
1556 | !samsung->quirks->broken_acpi_video) | ||
1557 | pr_info("Backlight controlled by ACPI video driver\n"); | 1559 | pr_info("Backlight controlled by ACPI video driver\n"); |
1558 | #endif | 1560 | #endif |
1559 | 1561 | ||