* [RFC PATCH 0/2] Input: psmouse - new mechanism for bad packet handling
@ 2011-12-07 11:38 JJ Ding
2011-12-07 11:38 ` [RFC PATCH 1/2] Input: psmouse - work around EC buffer JJ Ding
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: JJ Ding @ 2011-12-07 11:38 UTC (permalink / raw)
To: linux-input; +Cc: Dmitry Torokhov, JJ Ding
Hi list,
The first patch adds a new way to deal with bad packets. This mechanism is
used in our original driver. When I first sent the patches to support elan's
v3 and v4 hardware, Dmitry suggested this should be done in psmouse core, so
here is another try.
I am not sure if this is the prefered way to handle bad packets, so I introduce
PSMOUSE_SHIFT_PACKET for psmouse_ret_t, and convert elan driver to use this.
These patches are sent to gather feedback and comments, please take a look, and
let me know if this new mechanism is OK. Thank you very much.
P.S. patches are against Dmitry's -next tree.
Best regards,
-JJ
JJ Ding (2):
Input: psmouse - work around EC buffer
Input: elantech - convert v1 ~ v3 hardware to use
PSMOUSE_SHIFT_PACKET
drivers/input/mouse/elantech.c | 6 +++---
drivers/input/mouse/psmouse-base.c | 5 +++++
drivers/input/mouse/psmouse.h | 3 ++-
3 files changed, 10 insertions(+), 4 deletions(-)
--
1.7.8
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC PATCH 1/2] Input: psmouse - work around EC buffer
2011-12-07 11:38 [RFC PATCH 0/2] Input: psmouse - new mechanism for bad packet handling JJ Ding
@ 2011-12-07 11:38 ` JJ Ding
2011-12-07 11:38 ` [RFC PATCH 2/2] Input: elantech - convert v1 ~ v3 hardware to use PSMOUSE_SHIFT_PACKET JJ Ding
2012-01-29 11:11 ` [RFC PATCH 0/2] Input: psmouse - new mechanism for bad packet handling Marc Dietrich
2 siblings, 0 replies; 4+ messages in thread
From: JJ Ding @ 2011-12-07 11:38 UTC (permalink / raw)
To: linux-input; +Cc: Dmitry Torokhov, JJ Ding, JJ Ding
From: JJ Ding <dgdunix@gmail.com>
With some EC chips, when we resync due to bad packets, those bad bytes would
still remain in EC's buffer area. That makes us always get bad data back,
no matter what.
So shift packet for 1 byte when encounter bad packet, until we get rid of
those bytes.
Signed-off-by: JJ Ding <dgdunix@gmail.com>
---
drivers/input/mouse/psmouse-base.c | 5 +++++
drivers/input/mouse/psmouse.h | 3 ++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 200be9c..b849cec 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -279,6 +279,11 @@ static int psmouse_handle_byte(struct psmouse *psmouse)
}
break;
+ case PSMOUSE_SHIFT_PACKET:
+ memmove(psmouse->packet, psmouse->packet + 1, psmouse->pktsize - 1);
+ psmouse->pktcnt--;
+ break;
+
case PSMOUSE_GOOD_DATA:
break;
}
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
index 6a41709..1742c1b 100644
--- a/drivers/input/mouse/psmouse.h
+++ b/drivers/input/mouse/psmouse.h
@@ -33,7 +33,8 @@ enum psmouse_state {
typedef enum {
PSMOUSE_BAD_DATA,
PSMOUSE_GOOD_DATA,
- PSMOUSE_FULL_PACKET
+ PSMOUSE_FULL_PACKET,
+ PSMOUSE_SHIFT_PACKET
} psmouse_ret_t;
struct psmouse {
--
1.7.8
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC PATCH 2/2] Input: elantech - convert v1 ~ v3 hardware to use PSMOUSE_SHIFT_PACKET
2011-12-07 11:38 [RFC PATCH 0/2] Input: psmouse - new mechanism for bad packet handling JJ Ding
2011-12-07 11:38 ` [RFC PATCH 1/2] Input: psmouse - work around EC buffer JJ Ding
@ 2011-12-07 11:38 ` JJ Ding
2012-01-29 11:11 ` [RFC PATCH 0/2] Input: psmouse - new mechanism for bad packet handling Marc Dietrich
2 siblings, 0 replies; 4+ messages in thread
From: JJ Ding @ 2011-12-07 11:38 UTC (permalink / raw)
To: linux-input; +Cc: Dmitry Torokhov, JJ Ding, JJ Ding
From: JJ Ding <dgdunix@gmail.com>
This makes the driver resemble the bebavior documented in
Documentation/input/elantech.txt
Signed-off-by: JJ Ding <dgdunix@gmail.com>
---
drivers/input/mouse/elantech.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index d2c0db1..674cd78 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -728,7 +728,7 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
switch (etd->hw_version) {
case 1:
if (etd->paritycheck && !elantech_packet_check_v1(psmouse))
- return PSMOUSE_BAD_DATA;
+ return PSMOUSE_SHIFT_PACKET;
elantech_report_absolute_v1(psmouse);
break;
@@ -739,7 +739,7 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
return PSMOUSE_FULL_PACKET;
if (etd->paritycheck && !elantech_packet_check_v2(psmouse))
- return PSMOUSE_BAD_DATA;
+ return PSMOUSE_SHIFT_PACKET;
elantech_report_absolute_v2(psmouse);
break;
@@ -751,7 +751,7 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
return PSMOUSE_FULL_PACKET;
if (packet_type == PACKET_UNKNOWN)
- return PSMOUSE_BAD_DATA;
+ return PSMOUSE_SHIFT_PACKET;
elantech_report_absolute_v3(psmouse, packet_type);
break;
--
1.7.8
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [RFC PATCH 0/2] Input: psmouse - new mechanism for bad packet handling
2011-12-07 11:38 [RFC PATCH 0/2] Input: psmouse - new mechanism for bad packet handling JJ Ding
2011-12-07 11:38 ` [RFC PATCH 1/2] Input: psmouse - work around EC buffer JJ Ding
2011-12-07 11:38 ` [RFC PATCH 2/2] Input: elantech - convert v1 ~ v3 hardware to use PSMOUSE_SHIFT_PACKET JJ Ding
@ 2012-01-29 11:11 ` Marc Dietrich
2 siblings, 0 replies; 4+ messages in thread
From: Marc Dietrich @ 2012-01-29 11:11 UTC (permalink / raw)
To: JJ Ding; +Cc: linux-input, Dmitry Torokhov
Hi,
On Wednesday 07 December 2011 19:38:42 JJ Ding wrote:
> Hi list,
>
> The first patch adds a new way to deal with bad packets. This mechanism is
> used in our original driver. When I first sent the patches to support elan's
> v3 and v4 hardware, Dmitry suggested this should be done in psmouse core,
> so here is another try.
>
> I am not sure if this is the prefered way to handle bad packets, so I
> introduce PSMOUSE_SHIFT_PACKET for psmouse_ret_t, and convert elan driver
> to use this.
>
> These patches are sent to gather feedback and comments, please take a look,
> and let me know if this new mechanism is OK. Thank you very much.
what is the status of these patches? They are not it the input tree AFAICS.
Marc
> P.S. patches are against Dmitry's -next tree.
>
> Best regards,
> -JJ
>
> JJ Ding (2):
> Input: psmouse - work around EC buffer
> Input: elantech - convert v1 ~ v3 hardware to use
> PSMOUSE_SHIFT_PACKET
>
> drivers/input/mouse/elantech.c | 6 +++---
> drivers/input/mouse/psmouse-base.c | 5 +++++
> drivers/input/mouse/psmouse.h | 3 ++-
> 3 files changed, 10 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-01-29 11:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-07 11:38 [RFC PATCH 0/2] Input: psmouse - new mechanism for bad packet handling JJ Ding
2011-12-07 11:38 ` [RFC PATCH 1/2] Input: psmouse - work around EC buffer JJ Ding
2011-12-07 11:38 ` [RFC PATCH 2/2] Input: elantech - convert v1 ~ v3 hardware to use PSMOUSE_SHIFT_PACKET JJ Ding
2012-01-29 11:11 ` [RFC PATCH 0/2] Input: psmouse - new mechanism for bad packet handling Marc Dietrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).