aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/adbhid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/adbhid.c')
-rw-r--r--drivers/macintosh/adbhid.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index 394334ec5765..c26e1236b275 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -503,9 +503,7 @@ adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int auto
503 case 0x1f: /* Powerbook button device */ 503 case 0x1f: /* Powerbook button device */
504 { 504 {
505 int down = (data[1] == (data[1] & 0xf)); 505 int down = (data[1] == (data[1] & 0xf));
506#ifdef CONFIG_PMAC_BACKLIGHT 506
507 int backlight = get_backlight_level();
508#endif
509 /* 507 /*
510 * XXX: Where is the contrast control for the passive? 508 * XXX: Where is the contrast control for the passive?
511 * -- Cort 509 * -- Cort
@@ -530,29 +528,17 @@ adbhid_buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int auto
530 528
531 case 0xa: /* brightness decrease */ 529 case 0xa: /* brightness decrease */
532#ifdef CONFIG_PMAC_BACKLIGHT 530#ifdef CONFIG_PMAC_BACKLIGHT
533 if (!disable_kernel_backlight) { 531 if (!disable_kernel_backlight && down)
534 if (down && backlight >= 0) { 532 pmac_backlight_key_down();
535 if (backlight > BACKLIGHT_OFF) 533#endif
536 set_backlight_level(backlight-1);
537 else
538 set_backlight_level(BACKLIGHT_OFF);
539 }
540 }
541#endif /* CONFIG_PMAC_BACKLIGHT */
542 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSDOWN, down); 534 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSDOWN, down);
543 break; 535 break;
544 536
545 case 0x9: /* brightness increase */ 537 case 0x9: /* brightness increase */
546#ifdef CONFIG_PMAC_BACKLIGHT 538#ifdef CONFIG_PMAC_BACKLIGHT
547 if (!disable_kernel_backlight) { 539 if (!disable_kernel_backlight && down)
548 if (down && backlight >= 0) { 540 pmac_backlight_key_up();
549 if (backlight < BACKLIGHT_MAX) 541#endif
550 set_backlight_level(backlight+1);
551 else
552 set_backlight_level(BACKLIGHT_MAX);
553 }
554 }
555#endif /* CONFIG_PMAC_BACKLIGHT */
556 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSUP, down); 542 input_report_key(adbhid[id]->input, KEY_BRIGHTNESSUP, down);
557 break; 543 break;
558 544