Add Sahara Slate i400 series touchscreen driver.
Subsystems (2)
RFC PATCH 1/1 Add Sahara Slate i400 series touchscreen driver.
Hi all,
Find attached an initial patch to support this PS/2 based touch screen. Sahara claim to support this with a rather ropey xfree86-era driver which talks to serio_raw; I've written this driver to speak the protocol directly.
I think there are potentially a couple of issues here, which I'd appreciate feedback on. The first is that very occasionally, a touch event is reported at the wrong location. I haven't done enough debugging to see what the data is doing, and the input_report_* stuff looks simple enough - but if there are any gotchas I should know about, I'd appreciate a heads-up.
Second, should this be structured as a separate driver like this? I have a feeling that there isn't really any way of detecting this hardware, but this is a lot of lines for maybe ~5 lines of 'real' code...
Thanks
Alex.
--- drivers/input/mouse/Kconfig | 9 ++++ drivers/input/mouse/Makefile | 1 + drivers/input/mouse/psmouse-base.c | 9 ++++ drivers/input/mouse/psmouse.h | 1 + drivers/input/mouse/sahara_slate_ps2.c | 75 ++++++++++++++++++++++++++++++++ drivers/input/mouse/sahara_slate_ps2.h | 23 ++++++++++ 6 files changed, 118 insertions(+), 0 deletions(-) create mode 100644 drivers/input/mouse/sahara_slate_ps2.c create mode 100644 drivers/input/mouse/sahara_slate_ps2.h
drivers/input/mouse/Kconfig +9 -0
@@ -108,6 +108,15 @@ config MOUSE_PS2_ELANTECH entries. For further information, see <file:Documentation/input/elantech.txt>. +config MOUSE_PS2_SAHARASLATE + bool "Sahara Slate i400 series touchscreen PS/2 protocol extension" + depends on MOUSE_PS2 + help + Say Y here if you have a Sahara Slate i400 series with a PS/2 + touchscreen connected. + + If unsure, say N. + config MOUSE_PS2_SENTELIC bool "Sentelic Finger Sensing Pad PS/2 protocol extension" depends on MOUSE_PS2
drivers/input/mouse/Makefile +1 -0
@@ -27,6 +27,7 @@ psmouse-$(CONFIG_MOUSE_PS2_ELANTECH) += elantech.o psmouse-$(CONFIG_MOUSE_PS2_OLPC) += hgpk.o psmouse-$(CONFIG_MOUSE_PS2_LOGIPS2PP) += logips2pp.o psmouse-$(CONFIG_MOUSE_PS2_LIFEBOOK) += lifebook.o +psmouse-$(CONFIG_MOUSE_PS2_SAHARASLATE) += sahara_slate_ps2.o psmouse-$(CONFIG_MOUSE_PS2_SENTELIC) += sentelic.o psmouse-$(CONFIG_MOUSE_PS2_TRACKPOINT) += trackpoint.o psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o
drivers/input/mouse/psmouse-base.c +9 -0
@@ -27,6 +27,7 @@#include "alps.h" #include "hgpk.h" #include "lifebook.h" +#include "sahara_slate_ps2.h" #include "trackpoint.h" #include "touchkit_ps2.h" #include "elantech.h"
@@ -829,6 +830,14 @@ static const struct psmouse_protocol psmouse_protocols[] = { .init = lifebook_init, },#endif +#ifdef CONFIG_MOUSE_PS2_SAHARASLATE + { + .type = PSMOUSE_SAHARA_SLATE_PS2, + .name = "saharaslatePS/2", + .alias = "saharaslate", + .detect = saharaslate_ps2_detect + }, +#endif #ifdef CONFIG_MOUSE_PS2_TRACKPOINT { .type = PSMOUSE_TRACKPOINT,
drivers/input/mouse/psmouse.h +1 -0
@@ -93,6 +93,7 @@ enum psmouse_type {PSMOUSE_HGPK ,PSMOUSE_ELANTECH ,PSMOUSE_FSP , +PSMOUSE_SAHARA_SLATE_PS2 , PSMOUSE_AUTO /* This one should always be last */ };
drivers/input/mouse/sahara_slate_ps2.c new file +75 -0
75 lines not on this page · raw message
drivers/input/mouse/sahara_slate_ps2.h new file +23 -0
@@ -0,0 +1,23 @@ +/* ---------------------------------------------------------------------------- +* sahara_slate_ps2.h -- Driver for Sahara Slate i400 series PS/2 Touchscreens +* +* Copyright (C) 2011 Alex Hudson +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +*/ + +#ifndef _SAHARA_SLATE_PS2_H +#define _SAHARA_SLATE_PS2_H + +#ifdef CONFIG_MOUSE_PS2_SAHARASLATE +int saharaslate_ps2_detect (struct psmouse *psmouse,bool set_properties); +#else +static inline int saharaslate_ps2_detect (struct psmouse *psmouse,bool set_properties) +{ +return -ENOSYS ; +} +#endif /* CONFIG_MOUSE_PS2_SAHARASLATE */ + +#endif
Signature · 1 line
1.7.6