summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
diff options
context:
space:
mode:
authorMark Arigo <markarigo@gmail.com>2009-06-19 02:48:15 +0000
committerMark Arigo <markarigo@gmail.com>2009-06-19 02:48:15 +0000
commit4c58ad26ba462309f95790c32421130a73909f05 (patch)
tree96af9c1cda5f21e5af6443b13171ed66ccb1d9d1 /firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
parent753064fccf270643edc8d60e46886e327b099c49 (diff)
downloadrockbox-4c58ad26ba462309f95790c32421130a73909f05.tar.gz
rockbox-4c58ad26ba462309f95790c32421130a73909f05.tar.bz2
rockbox-4c58ad26ba462309f95790c32421130a73909f05.zip
Clean up the Synaptics touchpad driver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21344 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/philips/hdd1630/backlight-hdd1630.c')
-rwxr-xr-xfirmware/target/arm/philips/hdd1630/backlight-hdd1630.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c b/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
index eafce13759..cc8f04dda9 100755
--- a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
+++ b/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
@@ -47,41 +47,15 @@ void _backlight_off(void)
}
#ifdef HAVE_BUTTON_LIGHT
-
#define BUTTONLIGHT_MASK 0x7f
-
static unsigned short buttonight_brightness = DEFAULT_BRIGHTNESS_SETTING - 1;
static unsigned short buttonlight_status = 0;
-static void set_buttonlight(int brightness)
-{
- int data[6];
-
- if (syn_get_status())
- {
- syn_int_enable(false);
-
- /* turn on all touchpad leds */
- data[0] = 0x05;
- data[1] = 0x31;
- data[2] = (brightness & 0xff) << 4;
- data[3] = 0x00;
- data[4] = 0x00;
- data[5] = BUTTONLIGHT_MASK;
- syn_send(data, 6);
-
- /* device responds with a single-byte ACK packet */
- syn_read(data, 2);
-
- syn_int_enable(true);
- }
-}
-
void _buttonlight_on(void)
{
if (!buttonlight_status)
{
- set_buttonlight(buttonight_brightness);
+ touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness);
buttonlight_status = 1;
}
}
@@ -90,7 +64,7 @@ void _buttonlight_off(void)
{
if (buttonlight_status)
{
- set_buttonlight(0);
+ touchpad_set_buttonlights(BUTTONLIGHT_MASK, 0);
buttonlight_status = 0;
}
}
@@ -98,7 +72,7 @@ void _buttonlight_off(void)
void _buttonlight_set_brightness(int brightness)
{
buttonight_brightness = brightness - 1;
- set_buttonlight(buttonight_brightness);
+ touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness);
buttonlight_status = 1;
}
#endif