summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorSzymon Dziok <b0hoon@o2.pl>2011-09-11 12:21:01 +0000
committerSzymon Dziok <b0hoon@o2.pl>2011-09-11 12:21:01 +0000
commit201574d689b9144382bf9dfeb8fbce0565391e86 (patch)
tree0a16d6c253eeb86c5171ff4e457eac8d150782e2 /firmware
parent6f00e82512e645627f25263e75e54a61d72f9fb5 (diff)
downloadrockbox-201574d689b9144382bf9dfeb8fbce0565391e86.tar.gz
rockbox-201574d689b9144382bf9dfeb8fbce0565391e86.zip
HDD6330: Fix random issues with the button light (MENU button sometimes does not light up).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30505 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/synaptics-mep.c13
-rw-r--r--firmware/target/arm/philips/hdd6330/backlight-hdd6330.c12
2 files changed, 17 insertions, 8 deletions
diff --git a/firmware/drivers/synaptics-mep.c b/firmware/drivers/synaptics-mep.c
index 98c8829ead..48139534f2 100644
--- a/firmware/drivers/synaptics-mep.c
+++ b/firmware/drivers/synaptics-mep.c
@@ -590,7 +590,7 @@ int touchpad_read_device(char *data, int len)
590int touchpad_set_parameter(char mod_nr, char par_nr, unsigned int param) 590int touchpad_set_parameter(char mod_nr, char par_nr, unsigned int param)
591{ 591{
592 char data[4]; 592 char data[4];
593 int val=0; 593 int i, val=0;
594 594
595 if (syn_status) 595 if (syn_status)
596 { 596 {
@@ -601,7 +601,16 @@ int touchpad_set_parameter(char mod_nr, char par_nr, unsigned int param)
601 data[2]=(param >> 8) & 0xff; /* param_hi */ 601 data[2]=(param >> 8) & 0xff; /* param_hi */
602 data[3]=param & 0xff; /* param_lo */ 602 data[3]=param & 0xff; /* param_lo */
603 syn_send(data,4); 603 syn_send(data,4);
604 val=syn_read(data,1); /* get the simple ACK = 0x18 */ 604 val=syn_read(data,4); /* try to get the simple ACK = 0x18 */
605
606 /* modules > 0 sometimes don't give ACK immediately but other packets like */
607 /* absolute from the scroll strip, so it has to be ignored until we receive ACK */
608 if ((mod_nr > 0) && ((data[0] & 7) != 0))
609 for (i = 0; i < 2; i++)
610 {
611 val=syn_read(data,4);
612 if (data[0] == 0x18) break;
613 }
605 614
606 syn_enable_int(true); 615 syn_enable_int(true);
607 } 616 }
diff --git a/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c b/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c
index 369f3a40f1..ec77e9c828 100644
--- a/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c
+++ b/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c
@@ -55,26 +55,26 @@ void _buttonlight_on(void)
55{ 55{
56 if (!buttonlight_status) 56 if (!buttonlight_status)
57 { 57 {
58 /* enable 1 led (from 2) for MENU - GPO, module 1 */
59 /* no need to enable led for the hidden button */
60 touchpad_set_parameter(0x01,0x21,0x01);
58 /* enable 3 leds (from 5) for PREV, PLAY and NEXT, */ 61 /* enable 3 leds (from 5) for PREV, PLAY and NEXT, */
59 /* skip 2 leds because their light does not pass */ 62 /* skip 2 leds because their light does not pass */
60 /* through the panel anyway - on GPOs, module 0 */ 63 /* through the panel anyway - on GPOs, module 0 */
61 touchpad_set_parameter(0x00,0x22,0x15); 64 touchpad_set_parameter(0x00,0x22,0x15);
62 /* enable 1 led (from 2) for MENU - GPO, module 1 */
63 /* no need to enable led for the hidden button */
64 touchpad_set_parameter(0x01,0x21,0x01);
65 /* left, right and the scrollstrip */ 65 /* left, right and the scrollstrip */
66 touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness); 66 touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness);
67 buttonlight_status = 1; 67 buttonlight_status = 1;
68 } 68 }
69} 69}
70 70
71void _buttonlight_off(void) 71void _buttonlight_off(void)
72{ 72{
73 if (buttonlight_status) 73 if (buttonlight_status)
74 { 74 {
75 /* disable all leds on GPOs for module 0 and 1 */ 75 /* disable all leds on GPOs for module 0 and 1 */
76 touchpad_set_parameter(0x00,0x22,0x00);
77 touchpad_set_parameter(0x01,0x21,0x00); 76 touchpad_set_parameter(0x01,0x21,0x00);
77 touchpad_set_parameter(0x00,0x22,0x00);
78 touchpad_set_buttonlights(BUTTONLIGHT_MASK, 0); 78 touchpad_set_buttonlights(BUTTONLIGHT_MASK, 0);
79 buttonlight_status = 0; 79 buttonlight_status = 0;
80 } 80 }
@@ -82,8 +82,8 @@ void _buttonlight_off(void)
82 82
83void _buttonlight_set_brightness(int brightness) 83void _buttonlight_set_brightness(int brightness)
84{ 84{
85 touchpad_set_parameter(0x00,0x22,0x15);
86 touchpad_set_parameter(0x01,0x21,0x01); 85 touchpad_set_parameter(0x01,0x21,0x01);
86 touchpad_set_parameter(0x00,0x22,0x15);
87 buttonight_brightness = brightness - 1; 87 buttonight_brightness = brightness - 1;
88 touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness); 88 touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness);
89 buttonlight_status = 1; 89 buttonlight_status = 1;