aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/platform/x86/eeepc-laptop.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 8f9dc9cf5994..e4094b40a282 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -1234,7 +1234,7 @@ static void eeepc_input_exit(struct eeepc_laptop *eeepc)
1234static void eeepc_input_notify(struct eeepc_laptop *eeepc, int event) 1234static void eeepc_input_notify(struct eeepc_laptop *eeepc, int event)
1235{ 1235{
1236 if (!eeepc->inputdev) 1236 if (!eeepc->inputdev)
1237 return ; 1237 return;
1238 if (!sparse_keymap_report_event(eeepc->inputdev, event, 1, true)) 1238 if (!sparse_keymap_report_event(eeepc->inputdev, event, 1, true))
1239 pr_info("Unknown key %x pressed\n", event); 1239 pr_info("Unknown key %x pressed\n", event);
1240} 1240}
@@ -1242,6 +1242,7 @@ static void eeepc_input_notify(struct eeepc_laptop *eeepc, int event)
1242static void eeepc_acpi_notify(struct acpi_device *device, u32 event) 1242static void eeepc_acpi_notify(struct acpi_device *device, u32 event)
1243{ 1243{
1244 struct eeepc_laptop *eeepc = acpi_driver_data(device); 1244 struct eeepc_laptop *eeepc = acpi_driver_data(device);
1245 int old_brightness, new_brightness;
1245 u16 count; 1246 u16 count;
1246 1247
1247 if (event > ACPI_MAX_SYS_NOTIFY) 1248 if (event > ACPI_MAX_SYS_NOTIFY)
@@ -1252,34 +1253,32 @@ static void eeepc_acpi_notify(struct acpi_device *device, u32 event)
1252 count); 1253 count);
1253 1254
1254 /* Brightness events are special */ 1255 /* Brightness events are special */
1255 if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX) { 1256 if (event < NOTIFY_BRN_MIN || event > NOTIFY_BRN_MAX) {
1256
1257 /* Ignore them completely if the acpi video driver is used */
1258 if (eeepc->backlight_device != NULL) {
1259 int old_brightness, new_brightness;
1260
1261 /* Update the backlight device. */
1262 old_brightness = eeepc_backlight_notify(eeepc);
1263
1264 /* Convert event to keypress (obsolescent hack) */
1265 new_brightness = event - NOTIFY_BRN_MIN;
1266
1267 if (new_brightness < old_brightness) {
1268 event = NOTIFY_BRN_MIN; /* brightness down */
1269 } else if (new_brightness > old_brightness) {
1270 event = NOTIFY_BRN_MAX; /* brightness up */
1271 } else {
1272 /*
1273 * no change in brightness - already at min/max,
1274 * event will be desired value (or else ignored)
1275 */
1276 }
1277 eeepc_input_notify(eeepc, event);
1278 }
1279 } else {
1280 /* Everything else is a bona-fide keypress event */
1281 eeepc_input_notify(eeepc, event); 1257 eeepc_input_notify(eeepc, event);
1258 return;
1259 }
1260
1261 /* Ignore them completely if the acpi video driver is used */
1262 if (!eeepc->backlight_device)
1263 return;
1264
1265 /* Update the backlight device. */
1266 old_brightness = eeepc_backlight_notify(eeepc);
1267
1268 /* Convert event to keypress (obsolescent hack) */
1269 new_brightness = event - NOTIFY_BRN_MIN;
1270
1271 if (new_brightness < old_brightness) {
1272 event = NOTIFY_BRN_MIN; /* brightness down */
1273 } else if (new_brightness > old_brightness) {
1274 event = NOTIFY_BRN_MAX; /* brightness up */
1275 } else {
1276 /*
1277 * no change in brightness - already at min/max,
1278 * event will be desired value (or else ignored)
1279 */
1282 } 1280 }
1281 eeepc_input_notify(eeepc, event);
1283} 1282}
1284 1283
1285static void eeepc_dmi_check(struct eeepc_laptop *eeepc) 1284static void eeepc_dmi_check(struct eeepc_laptop *eeepc)