Commit 325fb8e9 authored by Alan Jenkins's avatar Alan Jenkins Committed by Len Brown

eeepc-laptop: re-add check for eeepc->backlight == NULL

As Corentin points out, we do not create a backlight device if the ACPI
video driver is able to provide equivalent functionality. So we do need
to check before we try to update the backlight device.

We now ignore brightness events completely if we have not created a
backlight device.  This is slightly more cautious than the original
check.
Signed-off-by: default avatarAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent f90be874
...@@ -1230,13 +1230,17 @@ static void eeepc_acpi_notify(struct acpi_device *device, u32 event) ...@@ -1230,13 +1230,17 @@ static void eeepc_acpi_notify(struct acpi_device *device, u32 event)
dev_name(&device->dev), event, dev_name(&device->dev), event,
count); count);
/* Brightness events are special */
if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX) { if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX) {
/* Ignore them completely if the acpi video driver is used */
if (eeepc->backlight_device != NULL) {
int old_brightness, new_brightness; int old_brightness, new_brightness;
/* Update backlight device. */ /* Update the backlight device. */
old_brightness = eeepc_backlight_notify(eeepc); old_brightness = eeepc_backlight_notify(eeepc);
/* Convert brightness event to keypress (obsolescent hack). */ /* Convert event to keypress (obsolescent hack) */
new_brightness = event - NOTIFY_BRN_MIN; new_brightness = event - NOTIFY_BRN_MIN;
if (new_brightness < old_brightness) { if (new_brightness < old_brightness) {
...@@ -1246,11 +1250,15 @@ static void eeepc_acpi_notify(struct acpi_device *device, u32 event) ...@@ -1246,11 +1250,15 @@ static void eeepc_acpi_notify(struct acpi_device *device, u32 event)
} else { } else {
/* /*
* no change in brightness - already at min/max, * no change in brightness - already at min/max,
* event will be desired value (or else ignored). * event will be desired value (or else ignored)
*/ */
} }
eeepc_input_notify(eeepc, event);
} }
} else {
/* Everything else is a bona-fide keypress event */
eeepc_input_notify(eeepc, event); eeepc_input_notify(eeepc, event);
}
} }
static void cmsg_quirk(struct eeepc_laptop *eeepc, int cm, const char *name) static void cmsg_quirk(struct eeepc_laptop *eeepc, int cm, const char *name)
......
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