diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-06-16 10:28:08 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-06-18 19:12:25 -0400 |
commit | 6c072299b6253d0737db87c7c18328cb376d96bb (patch) | |
tree | 43e0bd3a8321df50f4a2403d16d223f000c5cfbd | |
parent | 33a4edfba6bcc0482bf9013352c371816c6437c2 (diff) |
samsung-laptop: Port to new backlight interface selection API
Port the backlight selection logic to the new backlight interface
selection API.
This commit also removes various obsolete pr_xxx messages related to
backlight interface selection. These are obsolete because they assume
there is only a vendor or acpi backlight driver and no other choice.
Also they are not necessary, if the user wants to know which backlight
interfaces are registered a simple "ls /sys/class/backlight" suffices.
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>
-rw-r--r-- | drivers/platform/x86/samsung-laptop.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index 0df03e2c1e91..8c146e2b6727 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c | |||
@@ -1720,27 +1720,14 @@ static int __init samsung_init(void) | |||
1720 | samsung->handle_backlight = true; | 1720 | samsung->handle_backlight = true; |
1721 | samsung->quirks = quirks; | 1721 | samsung->quirks = quirks; |
1722 | 1722 | ||
1723 | |||
1724 | #ifdef CONFIG_ACPI | 1723 | #ifdef CONFIG_ACPI |
1725 | if (samsung->quirks->broken_acpi_video) | 1724 | if (samsung->quirks->broken_acpi_video) |
1726 | acpi_video_dmi_promote_vendor(); | 1725 | acpi_video_set_dmi_backlight_type(acpi_backlight_vendor); |
1727 | 1726 | if (samsung->quirks->use_native_backlight) | |
1728 | /* Don't handle backlight here if the acpi video already handle it */ | 1727 | acpi_video_set_dmi_backlight_type(acpi_backlight_native); |
1729 | if (acpi_video_backlight_support()) { | ||
1730 | samsung->handle_backlight = false; | ||
1731 | } else if (samsung->quirks->broken_acpi_video) { | ||
1732 | pr_info("Disabling ACPI video driver\n"); | ||
1733 | acpi_video_unregister_backlight(); | ||
1734 | } | ||
1735 | 1728 | ||
1736 | if (samsung->quirks->use_native_backlight) { | 1729 | if (acpi_video_get_backlight_type() != acpi_backlight_vendor) |
1737 | pr_info("Using native backlight driver\n"); | ||
1738 | /* Tell acpi-video to not handle the backlight */ | ||
1739 | acpi_video_dmi_promote_vendor(); | ||
1740 | acpi_video_unregister_backlight(); | ||
1741 | /* And also do not handle it ourselves */ | ||
1742 | samsung->handle_backlight = false; | 1730 | samsung->handle_backlight = false; |
1743 | } | ||
1744 | #endif | 1731 | #endif |
1745 | 1732 | ||
1746 | ret = samsung_platform_init(samsung); | 1733 | ret = samsung_platform_init(samsung); |
@@ -1751,12 +1738,6 @@ static int __init samsung_init(void) | |||
1751 | if (ret) | 1738 | if (ret) |
1752 | goto error_sabi; | 1739 | goto error_sabi; |
1753 | 1740 | ||
1754 | #ifdef CONFIG_ACPI | ||
1755 | /* Only log that if we are really on a sabi platform */ | ||
1756 | if (acpi_video_backlight_support()) | ||
1757 | pr_info("Backlight controlled by ACPI video driver\n"); | ||
1758 | #endif | ||
1759 | |||
1760 | ret = samsung_sysfs_init(samsung); | 1741 | ret = samsung_sysfs_init(samsung); |
1761 | if (ret) | 1742 | if (ret) |
1762 | goto error_sysfs; | 1743 | goto error_sysfs; |