summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/philips/hdd1630/button-hdd1630.c
diff options
context:
space:
mode:
authorMark Arigo <markarigo@gmail.com>2009-02-18 02:19:22 +0000
committerMark Arigo <markarigo@gmail.com>2009-02-18 02:19:22 +0000
commitf34cd80f638a6ca3b336f6ebd14cd958974b2760 (patch)
tree91195848e098a6f0f6372d39424306e32d3df9d2 /firmware/target/arm/philips/hdd1630/button-hdd1630.c
parent42ef5b0c88f92418c79e7414063c808b7c36a9be (diff)
downloadrockbox-f34cd80f638a6ca3b336f6ebd14cd958974b2760.tar.gz
rockbox-f34cd80f638a6ca3b336f6ebd14cd958974b2760.tar.bz2
rockbox-f34cd80f638a6ca3b336f6ebd14cd958974b2760.zip
Backlight brightness and button lights for the Philips HDD1630
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20035 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/philips/hdd1630/button-hdd1630.c')
-rwxr-xr-xfirmware/target/arm/philips/hdd1630/button-hdd1630.c48
1 files changed, 8 insertions, 40 deletions
diff --git a/firmware/target/arm/philips/hdd1630/button-hdd1630.c b/firmware/target/arm/philips/hdd1630/button-hdd1630.c
index c0ac8d7c10..e8214edf91 100755
--- a/firmware/target/arm/philips/hdd1630/button-hdd1630.c
+++ b/firmware/target/arm/philips/hdd1630/button-hdd1630.c
@@ -46,41 +46,11 @@ void button_click(void)
}
#ifndef BOOTLOADER
-static int syn_status = 0;
-
void button_init_device(void)
{
- /* enable touchpad */
- GPO32_ENABLE |= 0x80;
- GPO32_VAL &= ~0x80;
- udelay(1000);
-
- /* enable ACK, CLK, DATA lines */
- GPIOD_ENABLE |= 0x80;
- GPIOA_ENABLE |= (0x10 | 0x20);
-
- GPIOD_OUTPUT_EN |= 0x80; /* ACK */
- GPIOD_OUTPUT_VAL |= 0x80; /* high */
-
- GPIOA_OUTPUT_EN &= ~0x20; /* CLK */
-
- GPIOA_OUTPUT_EN |= 0x10; /* DATA */
- GPIOA_OUTPUT_VAL |= 0x10; /* high */
-
- if (syn_init())
+ if (!syn_get_status())
{
-#ifdef ROCKBOX_HAS_LOGF
- syn_info();
-#endif
- syn_status = 1;
-
- /* enable interrupts */
- GPIOA_INT_LEV &= ~0x20;
- GPIOA_INT_CLR |= 0x20;
- GPIOA_INT_EN |= 0x20;
-
- CPU_INT_EN |= HI_MASK;
- CPU_HI_INT_EN |= GPIO0_MASK;
+ logf("button_init_dev: touchpad not ready");
}
}
@@ -94,19 +64,18 @@ void button_int(void)
int_btn = BUTTON_NONE;
- if (syn_status)
+ if (syn_get_status())
{
/* disable interrupt while we read the touchpad */
- GPIOA_INT_EN &= ~0x20;
- GPIOA_INT_CLR |= 0x20;
+ syn_int_enable(false);
- val = syn_read_device(data, 4);
+ val = syn_read(data, 4);
if (val > 0)
{
val = data[0] & 0xff; /* packet header */
id = (data[1] >> 4) & 0xf; /* packet id */
- logf("button_read_device...");
+ logf("syn_read:");
logf(" data[0] = 0x%08x", data[0]);
logf(" data[1] = 0x%08x", data[1]);
logf(" data[2] = 0x%08x", data[2]);
@@ -121,7 +90,7 @@ void button_int(void)
int_btn |= BUTTON_RIGHT;
/* An Absolute packet should follow which we ignore */
- val = syn_read_device(data, 4);
+ val = syn_read(data, 4);
logf(" int_btn = 0x%04x", int_btn);
}
else if (val == MEP_ABSOLUTE_HEADER)
@@ -149,8 +118,7 @@ void button_int(void)
}
/* re-enable interrupts */
- GPIOA_INT_LEV &= ~0x20;
- GPIOA_INT_EN |= 0x20;
+ syn_int_enable(true);
}
}
#else