aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/wacom_wac.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-06-18HID: wacom: Introduce new 'touch_input' deviceJason Gerecke1-3/+6
Instead of having a single 'input_dev' device that will take either pen or touch data depending on the type of the device, create seperate devices devices for each. By splitting things like this, we can support devices (e.g. the I2C "AES" sensors in some newer tablet PCs) that send both pen and touch reports from a single endpoint. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-06-18HID: wacom: Introduce a new WACOM_DEVICETYPE_PAD device_typeJason Gerecke1-0/+1
Historically, both the touch and pad tools would have shared the 'BTN_TOOL_FINGER' type. Any time you needed to distinguish the two, you had to use some other bit of knowledge (e.g. that the pad was on the same interface as the pen, and thus 'touch_max' would be zero). To make these checks more readable, we introduce WACOM_DEVICETYPE_PAD. Although we still have to rely on other bits of knowledge to set this bit on the right interface (since it cannot be detected from the HID descriptor), it can be done just once inside 'wacom_setup_device_quirks'. This patch introduces no functional changes. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-06-18HID: wacom: Treat features->device_type values as flagsJason Gerecke1-0/+5
The USB devices that this driver has historically supported segregate the pen and touch portions of the tablet. Oftentimes the segregation would be done at the interface level, though on occasion (e.g. Cintiq 24HDT) the tablet would combine two totally independent USB devices behind an internal USB hub. Because pen and touch never shared the same interface, it made sense for the 'device_type' to store a single value: "pen" or "touch". Recently, however, some I2C devices have been created which combine the two. A first step to accomodating this is to expand 'device_type' so that it can represent two (or potentially more) types simultaneously. To do this, we treat it as a bitfield and set/check individual bits rather than using the '=' and '==' operators. This should not result in any functional change since no supported devices (that I'm aware of, at least) have HID descriptors that indicate both pen and touch reports on a single interface. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-05-04HID: wacom: Discover device_type from HID descriptor for all devicesJason Gerecke1-1/+5
Currently, we assume a device_type of BTN_TOOL_PEN before scanning the HID descriptor and then change the device_type if what we discover proves that assumption wrong. This way of doing things makes it more difficult to figure out if a device (particularly a HID_GENERIC device) actually does tablet/touch input or is something completley different. This patch leaves device_type at its initial value of 0 and then calls 'wacom_parse_hid' for every device (not just those that have touch). As we map the usages, we can set the device_type as before. After we're finished, we can then check if the value is still zero and do whatever is most appropriate. Detecting the pen can be a little tricky on most Wacom devices because the descriptors describe opaque blobs. Fortunately, older Wacom tablets have the HID_DG_DIGITIZER usage on the pen's application collection and newer tablets seem to have a similar vendor-defined usage that we can trigger on. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-23HID: wacom: remove unused packet lengthsPing Cheng1-6/+0
We use generic hid_report_len() to get individual packet length now. Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-04-02HID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUTPing Cheng1-5/+4
The quirk was added for devices that support both pen and touch. It decides if a device supports multiple inputs by hardcoded feature type. However, for some devices, we do not know if they support both before accessing their HID descriptors. This patch relies on dynamically assigned device_type to make the decision. Also, we make it certain that wacom_wac->shared is always created. That is, the driver will not be loaded if it fails to create wacom_wac->shared. Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-03-11HID: wacom: Add battery presence indicator to wireless tabletsJason Gerecke1-0/+1
Declare the POWER_SUPPLY_PROP_PRESENT property to provide userspace with a way to determine if the battery on a wireless tablet is plugged in. Although current wireless tablets do not explicitly report this information, it can be inferred from other state information. In particular, a battery is assumed to be present if any of the following are true: a non-zero battery level reported, the battery is reported as charging, or the tablet is operating wirelessly. Note: The last condition above may not strictly hold for the Graphire Wireless (it charges from a DC barrel jack instead of a USB port), but I do not know what is reported in the no-battery condition. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-03-11HID: wacom: drop WACOM_PKGLEN_STATUSJiri Kosina1-1/+0
The constant is not used (leftover from previous patch versions that never got merged). Reported-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-03-11HID: wacom: Move handling of Intuos status packets to seperate functionJason Gerecke1-0/+1
In addition to the touchswitch state for "Intuos", these packets are also sent by the Intuos Pro, Intuos5, and last-generation Bamboo tablets when using a wired connection. They contain, among other things, information about the optional wireless module and battery charge state (to be supported in subsuquent patches). Signed-off-by: Jason Gerecke <killertofu@gmail.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-02-27HID: wacom: add full support of the Wacom Bamboo PADBenjamin Tissoires1-0/+5
The stylus of this device works just fine out of the box. The touch is seen by default as a mouse with relative events and some gestures. The wireless and the wired version have slightly different firmwares, but the debug mode 2 on the feature 2 is common to the 2 devices. In this mode, all the reports are emitted through the debug interface (pen, raw touch and mouse emulation), so we have to re-route manually the events. We keep the Pen interface as a HID_GENERIC one because it works, and only parse the raw touches while discarding the mouse emulation & gestures. Switching the default in raw mode allows us to have a consistent user experience accross all the multitouch touchpads (and enable the touch part of the devices). Note that the buttons of this devices are reported through the touch interface. There is no 'Pad' interface. It seemed more natural to have the BTN_LEFT and BTN_RIGHT reported with the touch because they are placed under the touch interface and it looks like they belong to the touch part. Tested-by: Josep Sanchez Ferreres <josep.sanchez.ferreres@est.fib.upc.edu> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-02-27HID: wacom: store the hid_device pointers of the sibling devicesBenjamin Tissoires1-0/+2
The Bamboo PAD in debug mode needs to re-route events from the debug interface to the Pen interface. This can be easily done with hid_input_report(), but that means that we need to keep a reference to the various hid_devices. There should be only one touch and one pen interface per physical tablet, so there is no need to keep a list of hid-devices, plain pointers are sufficient. Tested-by: Josep Sanchez Ferreres <josep.sanchez.ferreres@est.fib.upc.edu> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-01-29HID: wacom: add support for Cintiq 27QHD and 27QHD touchPing Cheng1-1/+6
These devices have accelerometers. To report accelerometer coordinates, a new property, INPUT_PROP_ACCELEROMETER, is added. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-01-12HID: wacom: peport In Range event according to the specPing Cheng1-0/+1
Some Cintiq and Intuos tablets report In Range event. This event is sent before valid data is reported when tool enters proximity; or before out of proximity event is reported when tool exits. While entering proximity, In Range means a pen is detected. This information can be used for palm/touch rejection on both pen and touch enabled devices. While exiting, it means the tool has reached its maximum detectable distance. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-01-06HID: wacom: add support of the Pen of the Bamboo PadBenjamin Tissoires1-0/+1
Bamboo Pads are using the generic processing but their report descriptors differ from the ISDv* line. The pen fields are marked with the .physical as Digitizer_Pen, which makes also sense. Add this field to the checks and enable for free Bamboo Pads. Reported-by: Josep Sanchez Ferreres <josep.sanchez.ferreres@est.fib.upc.edu> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-01-06HID: wacom: use WACOM_*_FIELD macros in wacom_usage_mapping()Benjamin Tissoires1-0/+8
We introduced nice macros in wacom_wac.c to check whether a field is a pen or a touch one. wacom_usage_mapping() still uses it's own tests, which are not in sync with the wacom_wac tests (.application is not checked). That means that some legitimate fields might be filtered out from the usage mapping, and thus will not be used properly while receiving the events. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-12-11HID: wacom: Report input events for each finger on generic devicesJason Gerecke1-0/+1
The existing generic touch code only reports events after reading an entire HID report, which practically means that only data about the last contact in a report will ever be provided to userspace. This patch uses a trick from hid-multitouch.c to discover what type of field is at the end of each contact; when such a field is encountered all the stored contact data will be reported. Signed-off-by: Jason Gerecke <killertofu@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-12-05HID: wacom: Add support for DTU-1031XPing Cheng1-0/+1
Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-11-26HID: wacom: PAD is independent with pen/touchPing Cheng1-0/+1
PAD can be on pen interface (Intuos Pro and Cintiq series) or touch interface (Bamboo PT and Intuos PT series) or its own interface (Bamboo pen-only and Intuos Pen M/S). We need to mark it independently. Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-10-01HID: wacom: implement the finger part of the HID generic handlingBenjamin Tissoires1-0/+8
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-10-01HID: wacom: implement generic HID handling for pen generic devicesBenjamin Tissoires1-0/+8
ISDv4 and v5 are plain HID devices. We can directly implement a generic HID parsing/handling and remove the need to manually add those PID in the list of supported devices. This patch implements the pen support only. The finger part will come in a later patch. To be properly notified of an .event() and a .report(), we need to force hid-core to go through the HID parsing. By default, wacom.ko binds only hidraw, so the hid parsing is not done by hid-core. When a true HID device is there, we add the flag HID_CLAIMED_DRIVER to hid->claimed which will force hid-core to parse the incoming reports. (Note that this can be easily backported by directly setting the .claimed flag to HID_CLAIMED_DRIVER even if hid-core does not support HID_CONNECT_DRIVER) Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-10-01HID: wacom: split out input allocation and registrationBenjamin Tissoires1-0/+1
If the input can be created earlier during probe, we can already populate them while reading the report descriptor. This way, we can rely on the hid subsystem directly for tablets which already provide a meaningful report descriptor (like ISDv4-5). This patch only splits the allocation and registration, but do not change where we allocate the input. This will come in a later patch. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-08-06Input: wacom - handle Intuos 4 BT in wacom.koBenjamin Tissoires1-0/+1
A good point of this change is that now, the Intuos4 bluetooth can handle the different tools (artpen, airbrush, mice), and we get a common interface between USB and BT for accessing the LEDs/OLEDs. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Input: wacom - handle Graphire BT tablets in wacom.koBenjamin Tissoires1-0/+2
First, merge the Graphire BT tablet. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-08-06Input: wacom - prepare the driver to include BT devicesBenjamin Tissoires1-0/+2
Now that wacom is a hid driver, there is no point in having a separate driver for bluetooth devices. This patch prepares the common paths of Bluetooth devices in the common wacom driver. It also adds the sysfs file "speed" used by Bluetooth devices. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Tested-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - register an ac power supply for wireless devicesBenjamin Tissoires1-0/+1
This is used by HID Bluetooth devices but also add some more information to the USB Wireless Receiver. We are just porting the bits from hid-wacom.c to the common driver here. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Przemo Firszt <przemo@firszt.eu> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - use a uniq name for the battery deviceBenjamin Tissoires1-0/+1
The current implementation uses "wacom_battery" as a generic name for batteries. This prevents us to have two Wacom devices with a battery attached as the power system will complain about the name which is already registered. Use an incremental name for each battery attached. Related bug: https://sourceforge.net/p/linuxwacom/bugs/248/ Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Przemo Firszt <przemo@firszt.eu> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - enhance Wireless Receiver battery reportingBenjamin Tissoires1-0/+3
- Reports the current status of the battery (discharging, charging, full). - Also notify the upower daemon when there is a change in the battery value. - keep the battery value as a percentage, not the raw value - add WACOM_QUIRK_BATTERY to easily add a battery to a device (required for Bluetooth devices) Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Przemo Firszt <przemo@firszt.eu> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-25Input: wacom - move the USB (now hid) Wacom driver in drivers/hidBenjamin Tissoires1-0/+169
wacom.ko is now a full HID driver, we have to move it into the proper subdirectory: drivers/hid. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>