summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/wacom_w8001.c
Commit message (Collapse)AuthorAgeFilesLines
* Input: wacom_w8001 - handle errors from input_mt_init_slots()Ping Cheng2016-07-191-1/+7
| | | | | | | input_mt_init_slots() may fail and we should be handling failures properly. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: wacom_w8001 - resolution wasn't set for ABS_MT_POSITION_X/YPing Cheng2016-07-191-0/+2
| | | | | Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Revert "Input: wacom_w8001 - drop use of ABS_MT_TOOL_TYPE"Dmitry Torokhov2016-07-141-0/+3
| | | | | | | | | | This reverts commit 5f7e5445a2de848c66d2d80ba5479197e8287c33 because removal of input_mt_report_slot_state() means we no longer generate tracking IDs for the reported contacts. Cc: stable@vger.kernel.org Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Ping Cheng <pinglinux@gmail.com>
* Input: wacom_w8001 - ignore invalid pen data packetsPing Cheng2016-06-231-0/+9
| | | | | | | | | | | ThinkPad X60 Tablet PC (pen only device) sometime posts packets that are larger than W8001_PKTLEN_TPCPEN. Reported-by: Chris J Arges <christopherarges@gmail.com> Tested-by: Chris J Arges <christopherarges@gmail.com> Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: wacom_w8001 - w8001_MAX_LENGTH should be 13Ping Cheng2016-06-231-1/+1
| | | | | | | | | Somehow the patch that added two-finger touch support forgot to update W8001_MAX_LENGTH from 11 to 13. Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: wacom_w8001 - drop use of ABS_MT_TOOL_TYPEPeter Hutterer2016-01-111-3/+0
| | | | | | | | | As of e0361b70175 ("Input: wacom_w8001 - split the touch and pen devices into two devices") the touch events aren't multiplexed over the same device anymore, the use of ABS_MT_TOOL_TYPE is superfluous. And even before then it only ever sent MT_TOOL_TYPE_FINGER anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: wacom_w8001 - split the touch and pen devices into two devicesPeter Hutterer2015-12-031-51/+116
| | | | | | | | | | | | | | | | | | These devices have a pen device and a touch device through the same serial protocol, split it up into two separate devices like we do for USB Wacom tablets too. Userspace already matches on the device name so we can't drop it completely. Compose the same basename based on capabilities and append the tool type, leading to a name like "Wacom Serial Penabled 2FG Touchscreen Pen". Note that this drops BTN_TOOL_FINGER, it is not needed once the tools are split out (and a touch device with BTN_TOOL_FINGER is interpreted as touchpad by most of userspace). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: wacom_w8001 - split pen and touch initialization upPeter Hutterer2015-12-031-83/+111
| | | | | | | This is preparation work for splitting it up for two event nodes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: wacom_w8001 - handle touch error case correctlyPeter Hutterer2015-12-031-10/+9
| | | | | | | | | If a device failed at the pen setup and gets a zero reply from the touch device, we need to return an error. Otherwise we have a device with nothing but a name and the EV_KEY and EV_ABS bits. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: wacom_w8001 - set BTN_TOOL_DOUBLETAP if we have 2fg supportPeter Hutterer2015-12-031-0/+1
| | | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: wacom_w8001 - use __set_bit for evbitsPeter Hutterer2015-12-031-1/+2
| | | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: delete non-required instances of include <linux/init.h>Paul Gortmaker2014-01-061-1/+0
| | | | | | | | | | None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: MT - Add flags to input_mt_init_slots()Henrik Rydberg2012-09-191-1/+1
| | | | | | | | | | Preparing to move more repeated code into the mt core, add a flags argument to the input_mt_slots_init() function. Reviewed-and-tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Input: serio - use module_serio_driverAxel Lin2012-04-041-12/+1
| | | | | | | | | This patch converts the drivers in drivers/input/* to use module_serio_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Merge branch 'next' into for-linusDmitry Torokhov2011-10-261-5/+24
|\
| * Input: wacom_w8001 - simplify w8001_removeDmitry Torokhov2011-08-231-4/+4
| | | | | | | | | | | | | | | | Since touchscreen driver does not handle any events to be sent to the device we can close serio port first and then unregister the input device. Tested-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
| * Input: wacom_w8001 - implement open and closeDmitry Torokhov2011-08-231-1/+20
| | | | | | | | | | | | | | | | | | Implement open() and close() methods for the input device so that we do not start the device unless there are users listening to the events. Acked-by: Chris Bagwell <chris@cnpbagwell.com> Tested-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* | Input: wacom - add POINTER and DIRECT device propertiesJason Gerecke2011-09-081-0/+2
|/ | | | | | | | | | | | Adds INPUT_PROP_POINTER or INPUT_PROP_DIRECT as necessary to the hardware supported by the Wacom driver. The DIRECT property is assigned to devices with an embedded screen (i.e. touchscreens and display tablets). The POINTER property is assigned to those without embedded screens. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wacom_w8001 - report resolution to userlandPing Cheng2011-01-311-2/+11
| | | | | | | | | | | | | | | | | | | Serial devices send both pen and touch data through the same logical port. Since we scaled touch to pen maximum, we use pen resolution for touch as well here. This is under the assumption that pen and touch share the same physical surface. In the case when a small physical dimensional difference occurs between pen and touch, we assume the tolerance for touch point precision is higher than pen and the difference is within touch point tolerance. A per-MT tool based resolution mechanism should be introduced if the above assumption does not hold true for the pen and touch devices any more. Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wacom_w8001 - add single-touch supportPing Cheng2011-01-111-33/+149
| | | | | | | | | | | | | Emulate single-touch compatible events for the 2-finger panels so that they can be used with single-touch legacy clients. Assign device ids as Wacom USB vendor ID and product ID. Name the device to reflect its specific features. Scale touch coordinates to pen maximum if pen supported. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wacom_w8001 - support pen or touch only devicesPing Cheng2010-12-301-12/+32
| | | | | | | | | Not all penabled devices support touch. The same holds true for touch devices, so we should be setting up devices according to the results returned when we query the hardware. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wacom_w8001 - use __set_bit to set keybitsPing Cheng2010-12-271-5/+5
| | | | | | | This makes code safer and easier to read. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* input: mt: Move tracking and pointer emulation to input-mtHenrik Rydberg2010-12-161-16/+5
| | | | | | | | | | | | | | | The drivers using the type B protocol all report tracking information the same way. The contact id is semantically equivalent to ABS_MT_SLOT, and the handling of ABS_MT_TRACKING_ID only complicates the driver. The situation can be improved upon by providing a common pointer emulation code, thereby removing the need for the tracking id in the driver. This patch moves all tracking event handling over to the input core, simplifying both the existing drivers and the ones currently in preparation. Acked-by: Ping Cheng <pingc@wacom.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* input: mt: Collect slots initialization codeHenrik Rydberg2010-12-161-1/+1
| | | | | | | | | The MT slots devices all follow the same initialization pattern of creating slots and hinting about buffer size. Let drivers call an initialization function instead, and make sure it can be called repeatedly without side effects. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* input: mt: Break out slots handlingHenrik Rydberg2010-12-161-1/+1
| | | | | | | In preparation for common code to handle a larger set of MT slots devices, move the slots handling over to a separate file. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Input: wacom_w8001 - add multitouch slot supportPeter Hutterer2010-08-281-3/+46
| | | | | | | | | | | | | | Some serial wacom devices support two-finger touch. Test for this during init and parse the touch packets accordingly. Touch packets are processed using Protocol B (MT Slots). Note: there are several wacom versions that do touch but not two-finger touch. These are not catered for here, touch events for these are simply discarded. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wacom_w8001 - support (and ignore) touch tabletsPeter Hutterer2010-08-281-2/+86
| | | | | | | | | Tablets that support touch input may report different sized packages, depending on the touch sensor in the tablet. For now, discard the packages until we report them as touch input proper. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wacom_w8001 - send BTN_TOOL_PEN/RUBBER and BTN_STYLUS eventsPeter Hutterer2010-08-281-6/+48
| | | | | | | | | | | | | | | The protocol used by the w8001 supports status fields for tip, side switch and eraser as well as a RDY field for proximity. The protocol has a double usage for the f2 bit in the packet. If set, the data is either pen + side2 button or eraser. Assume eraser if the device comes into proximity with the f2 bit set, otherwise trigger the side2 button. If the device comes into proximity with the f2 bit and that bit disappears afterwards, fake proximity out for the eraser and proximity in for the pen. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wacom_w8001 - simplify querying logicDmitry Torokhov2009-09-031-81/+40
| | | | | | | There is no need for locking when we send query and start commands to the touchscreen since there is no concurrency. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: add support for Wacom W8001 penabled serial touchscreenJaya Kumar2008-11-241-0/+325
The Wacom W8001 sensor is a sensor device (uses electromagnetic resonance) and it is interfaced via its serial microcontroller to the host. Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
OpenPOWER on IntegriCloud