From 3a9bcb8c25c2fbbea7d254de991eb7c4a0382f01 Mon Sep 17 00:00:00 2001 From: b0hoon Date: Sun, 4 Jul 2010 12:03:38 +0000 Subject: [PATCH] hdd6330: change the synaptics-mep driver in a few places according to the touchpad behavior. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27273 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/synaptics-mep.c | 12 ++++++++++-- firmware/export/synaptics-mep.h | 2 +- firmware/target/arm/pbell/vibe500/backlight-vibe500.c | 6 +++--- firmware/target/arm/pbell/vibe500/power-vibe500.c | 8 ++++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/firmware/drivers/synaptics-mep.c b/firmware/drivers/synaptics-mep.c index d87b828af..f5b619053 100644 --- a/firmware/drivers/synaptics-mep.c +++ b/firmware/drivers/synaptics-mep.c @@ -558,6 +558,10 @@ int touchpad_read_device(char *data, int len) } else if (val == MEP_ABSOLUTE_HEADER) { +/* for HDD6330 an absolute packet will follow for sensor nr 0 which we ignore */ +#if defined(PHILIPS_HDD6330) + if ((data[3]>>6) == 0) syn_read(tmp, 4); +#endif logf(" pos %d", val); logf(" z %d", data[3]); logf(" finger %d", data[1] & 0x1); @@ -583,7 +587,7 @@ int touchpad_read_device(char *data, int len) return val; } -int touchpad_set_parameter(char par_nr, unsigned int param) +int touchpad_set_parameter(char mod_nr, char par_nr, unsigned int param) { char data[4]; int val=0; @@ -592,7 +596,7 @@ int touchpad_set_parameter(char par_nr, unsigned int param) { syn_enable_int(false); - data[0]=0x03; /* header - addr:0,global:0,control:0,len:3 */ + data[0]=0x03 | (mod_nr << 5); /* header - addr=mod_nr,global:0,ctrl:0,len:3 */ data[1]=0x40+par_nr; /* parameter number */ data[2]=(param >> 8) & 0xff; /* param_hi */ data[3]=param & 0xff; /* param_lo */ @@ -614,7 +618,11 @@ int touchpad_set_buttonlights(unsigned int led_mask, char brightness) syn_enable_int(false); /* turn on all touchpad leds */ +#if defined(PHILIPS_HDD6330) + data[0] = 0x25; /* HDD6330: second module */ +#else data[0] = 0x05; +#endif data[1] = 0x31; data[2] = (brightness & 0xf) << 4; data[3] = 0x00; diff --git a/firmware/export/synaptics-mep.h b/firmware/export/synaptics-mep.h index aa45e7047..4eb57382a 100644 --- a/firmware/export/synaptics-mep.h +++ b/firmware/export/synaptics-mep.h @@ -24,6 +24,6 @@ int touchpad_init(void); int touchpad_read_device(char *data, int len); int touchpad_set_buttonlights(unsigned int led_mask, char brightness); -int touchpad_set_parameter(char par_nr, unsigned int param); +int touchpad_set_parameter(char mod_nr, char par_nr, unsigned int param); #endif diff --git a/firmware/target/arm/pbell/vibe500/backlight-vibe500.c b/firmware/target/arm/pbell/vibe500/backlight-vibe500.c index 321484cd9..ab71012bd 100644 --- a/firmware/target/arm/pbell/vibe500/backlight-vibe500.c +++ b/firmware/target/arm/pbell/vibe500/backlight-vibe500.c @@ -64,7 +64,7 @@ void _buttonlight_on(void) { if (!buttonlight_status) { - touchpad_set_parameter(0x22, 0x000f); /* 0x22 - GPO_ENABLE */ + touchpad_set_parameter(0, 0x22, 0x000f); /* 0x22 - GPO_ENABLE */ buttonlight_status = 1; } } @@ -73,7 +73,7 @@ void _buttonlight_off(void) { if (buttonlight_status) { - touchpad_set_parameter(0x22, 0x0000); /* 0x22 - GPO_ENABLE */ + touchpad_set_parameter(0, 0x22, 0x0000); /* 0x22 - GPO_ENABLE */ buttonlight_status = 0; } } @@ -82,7 +82,7 @@ void _buttonlight_set_brightness(int brightness) { /* no brightness control, but lights stays on - for compatibility */ (void)brightness; - touchpad_set_parameter(0x22, 0x000f); /* 0x22 - GPO_ENABLE */ + touchpad_set_parameter(0, 0x22, 0x000f); /* 0x22 - GPO_ENABLE */ buttonlight_status = 1; } #endif diff --git a/firmware/target/arm/pbell/vibe500/power-vibe500.c b/firmware/target/arm/pbell/vibe500/power-vibe500.c index b345a9b5d..a5660d7e7 100644 --- a/firmware/target/arm/pbell/vibe500/power-vibe500.c +++ b/firmware/target/arm/pbell/vibe500/power-vibe500.c @@ -49,14 +49,14 @@ void power_init(void) /* Max touch sensivity = 0x77, Rate=80/s,NoFilter=0, KeyMatrix=0,Buttons=1,Relative=0,Absolute=1. MEP parameter 0x20 - Report Modes */ - touchpad_set_parameter(0x20,0x7785); + touchpad_set_parameter(0,0x20,0x7785); /* MinAbsReporting=0, NotAllCapButtons=0,SingleCapButton=0, 50msDebounce=0,MotionReporting=1 (reduce transmission overhead), ClipZifnoFinger=0,DisableDeceleration=0,Dribble=0. MEP parameter 0x21 - Enhanced Operating Configuration */ - touchpad_set_parameter(0x21,0x0008); + touchpad_set_parameter(0,0x21,0x0008); /* Set the GPO_LEVELS = 0 - for the button lights */ - touchpad_set_parameter(0x23,0x0000); + touchpad_set_parameter(0,0x23,0x0000); /* Sound unmute (on) */ GPIO_CLEAR_BITWISE(GPIOL_OUTPUT_VAL, 0x10); @@ -100,7 +100,7 @@ void power_off(void) /* shutdown bit */ GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x80); /* button lights off */ - touchpad_set_parameter(0x22,0x0000); + touchpad_set_parameter(0,0x22,0x0000); /* ATA power off */ ide_power_enable(false); /* ? - in the OF */ -- 2.11.4.GIT