Commit 61679c72 authored by Hans de Goede's avatar Hans de Goede Committed by Rafael J. Wysocki

dell-wmi: Use acpi_video_handles_brightness_key_presses()

Use the new acpi_video_handles_brightness_key_presses function to check
if we should report brightness key-presses.

This makes the code both easier to read and makes it properly report
key-presses when acpi-video is not reporting them for reasons other
then the backlight type being vendor.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarPali Rohár <pali.rohar@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 90b066b1
...@@ -43,8 +43,6 @@ MODULE_LICENSE("GPL"); ...@@ -43,8 +43,6 @@ MODULE_LICENSE("GPL");
#define DELL_EVENT_GUID "9DBB5994-A997-11DA-B012-B622A1EF5492" #define DELL_EVENT_GUID "9DBB5994-A997-11DA-B012-B622A1EF5492"
static int acpi_video;
MODULE_ALIAS("wmi:"DELL_EVENT_GUID); MODULE_ALIAS("wmi:"DELL_EVENT_GUID);
/* /*
...@@ -159,7 +157,8 @@ static void dell_wmi_process_key(int reported_key) ...@@ -159,7 +157,8 @@ static void dell_wmi_process_key(int reported_key)
/* Don't report brightness notifications that will also come via ACPI */ /* Don't report brightness notifications that will also come via ACPI */
if ((key->keycode == KEY_BRIGHTNESSUP || if ((key->keycode == KEY_BRIGHTNESSUP ||
key->keycode == KEY_BRIGHTNESSDOWN) && acpi_video) key->keycode == KEY_BRIGHTNESSDOWN) &&
acpi_video_handles_brightness_key_presses())
return; return;
sparse_keymap_report_entry(dell_wmi_input_dev, key, 1, true); sparse_keymap_report_entry(dell_wmi_input_dev, key, 1, true);
...@@ -398,7 +397,6 @@ static int __init dell_wmi_init(void) ...@@ -398,7 +397,6 @@ static int __init dell_wmi_init(void)
} }
dmi_walk(find_hk_type, NULL); dmi_walk(find_hk_type, NULL);
acpi_video = acpi_video_get_backlight_type() != acpi_backlight_vendor;
err = dell_wmi_input_setup(); err = dell_wmi_input_setup();
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment