aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/goodix.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-12-17Input: goodix - use "inverted_[xy]" flags instead of "rotated_screen"Karsten Merker1-8/+4
The goodix touchscreen driver uses a "rotated_screen" flag for systems on which the touchscreen is mounted rotated by 180 degrees with respect to the display. With the addition of support for the dt properties "touchscreen-inverted-x" and "touchscreen-inverted-y", a separate "rotated_screen" flag is not necessary anymore. This patch replaces it by setting the inverted_x and inverted_y flags instead. Signed-off-by: Karsten Merker <merker@debian.org> Reviewed-by: Irina Tirdea <irina.tirdea@intel.com> Tested-by: Bastien Nocera <hadess@hadess.net> Acked-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: goodix - add axis swapping and axis inversion supportKarsten Merker1-0/+25
Implement support for the following device-tree and ACPI 5.1 DSD properties in the goodix touchscreen driver: - touchscreen-inverted-x: X axis is inverted (boolean) - touchscreen-inverted-y: Y axis is inverted (boolean) - touchscreen-swapped-x-y: X and Y axis are swapped (boolean) These are necessary on tablets which have a display in portrait format while the touchscreen is in landscape format, such as e.g. the MSI Primo 81. Signed-off-by: Karsten Merker <merker@debian.org> Tested-by: Bastien Nocera <hadess@hadess.net> Tested-by: Irina Tirdea <irina.tirdea@intel.com> (with ACPI DSD properties) Tested-by: Aleksei Mamlin <mamlinav@gmail.com> (with device-tree properties) Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: goodix - use goodix_i2c_write_u8 instead of i2c_master_sendIrina Tirdea1-6/+1
Use goodix_i2c_write_u8 instead of i2c_master_send to simplify code. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Tested-by: Bastien Nocera <hadess@hadess.net> Tested-by: Aleksei Mamlin <mamlinav@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: goodix - add power management supportIrina Tirdea1-5/+98
Implement suspend/resume for goodix driver. The suspend and resume process uses the gpio pins. If the device ACPI/DT information does not declare gpio pins, suspend/resume will not be available for these devices. This is based on Goodix datasheets for GT911 and GT9271 and on Goodix driver gt9xx.c for Android (publicly available in Android kernel trees for various devices). Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Tested-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: goodix - write configuration data to deviceIrina Tirdea1-32/+212
Goodix devices can be configured by writing custom data to the device at init. The configuration data is read with request_firmware from "goodix_<id>_cfg.bin", where <id> is the product id read from the device (e.g.: goodix_911_cfg.bin for Goodix GT911, goodix_9271_cfg.bin for GT9271). The configuration information has a specific format described in the Goodix datasheet. It includes X/Y resolution, maximum supported touch points, interrupt flags, various sensitivity factors and settings for advanced features (like gesture recognition). Before writing the firmware, it is necessary to reset the device. If the device ACPI/DT information does not declare gpio pins (needed for reset), writing the firmware will not be available for these devices. This is based on Goodix datasheets for GT911 and GT9271 and on Goodix driver gt9xx.c for Android (publicly available in Android kernel trees for various devices). Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Tested-by: Bastien Nocera <hadess@hadess.net> Tested-by: Aleksei Mamlin <mamlinav@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: goodix - reset device at initIrina Tirdea1-0/+119
After power on, it is recommended that the driver resets the device. The reset procedure timing is described in the datasheet and is used at device init (before writing device configuration) and for power management. It is a sequence of setting the interrupt and reset pins high/low at specific timing intervals. This procedure also includes setting the slave address to the one specified in the ACPI/device tree. This is based on Goodix datasheets for GT911 and GT9271 and on Goodix driver gt9xx.c for Android (publicly available in Android kernel trees for various devices). For reset the driver needs to control the interrupt and reset gpio pins (configured through ACPI/device tree). For devices that do not have the gpio pins properly declared, the functionality depending on these pins will not be available, but the device can still be used with basic functionality. For both device tree and ACPI, the interrupt gpio pin configuration is read from the "irq-gpios" property and the reset pin configuration is read from the "reset-gpios" property. For ACPI 5.1, named properties can be specified using the _DSD section. This functionality will not be available for devices that use indexed gpio pins declared in the _CRS section (we need to provide backward compatibility with devices that do not support using the interrupt gpio pin as output). For ACPI, the pins can be specified using ACPI 5.1: Device (STAC) { Name (_HID, "GDIX1001") ... Method (_CRS, 0, Serialized) { Name (RBUF, ResourceTemplate () { I2cSerialBus (0x0014, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\I2C0", 0x00, ResourceConsumer, , ) GpioInt (Edge, ActiveHigh, Exclusive, PullNone, 0x0000, "\\I2C0", 0x00, ResourceConsumer, , ) { // Pin list 0 } GpioIo (Exclusive, PullDown, 0x0000, 0x0000, IoRestrictionOutputOnly, "\\I2C0", 0x00, ResourceConsumer, , ) { 1 } }) Return (RBUF) } Name (_DSD, Package () { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { Package (2) {"irq-gpios", Package() {^STAC, 0, 0, 0 }}, Package (2) {"reset-gpios", Package() {^STAC, 1, 0, 0 }}, ... } } Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Bastien Nocera <hadess@hadess.net> Tested-by: Bastien Nocera <hadess@hadess.net> Tested-by: Aleksei Mamlin <mamlinav@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: goodix - use actual config length for each device typeIrina Tirdea1-2/+25
Each of the Goodix devices supported by this driver has a fixed size for the configuration information registers. The size varies depending on the device and is specified in the datasheet. Use the proper configuration length as specified in the datasheet for each device model, so we do not read more than the actual size of the configuration registers. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Acked-by: Bastien Nocera <hadess@hadess.net> Tested-by: Bastien Nocera <hadess@hadess.net> Tested-by: Aleksei Mamlin <mamlinav@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-03Merge branch 'next' into for-linusDmitry Torokhov1-1/+1
Prepare first round of input updates for 4.3 merge window.
2015-07-30Input: export I2C module alias information in missing driversJavier Martinez Canillas1-0/+1
The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So the driver needs to export the I2C table and this be built into the module or udev won't have the necessary information to auto load the correct module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-24Input: goodix - fix touch coordinates on WinBook TW100 and TW700Bastien Nocera1-0/+36
The touchscreen on the WinBook TW100 and TW700 don't match the default display, with 0,0 touches being reported when touching at the bottom right of the screen. 1280,800 0,800 +-------------+ | | | | | | +-------------+ 1280,0 0,0 It's unfortunately impossible to detect this problem with data from the DSDT, or other auxiliary metadata, so fallback to quirking this specific model of tablet instead. Signed-off-by: Bastien Nocera <hadess@hadess.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-17Input: drop owner assignment from i2c_driverKrzysztof Kozlowski1-1/+0
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-06-11Input: goodix - do not explicitly set evbits in input deviceDmitry Torokhov1-4/+0
input_mt_init_slots() will do that for us. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-06-09Input: goodix - export id and version read from deviceIrina Tirdea1-12/+21
Goodix touchscreens export through their registers a Product ID and Firmware Version. The Product ID is an ASCII encoding of the product name (e.g.: "911"). Export to sysfs (through the input subsystem) the product id and firmware version read from the device rather than using constant values. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Acked-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-06-09Input: goodix - fix variable length array warningIrina Tirdea1-1/+1
Fix sparse warning: drivers/input/touchscreen/goodix.c:182:26: warning: Variable length array is used. Replace the variable length array with fixed length. Some Goodix devices have maximum 5 touch points, while others have 10 touch points. Using the maximum length (80 bytes) for all devices will lead to wasting 40 bytes on stack when using devices with maximum 5 touch points. However, that is preferable to using kmalloc which will use even more resources. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Acked-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-06-09Input: goodix - fix alignment issuesIrina Tirdea1-8/+8
Fix alignment to match open parenthesis detected by running checkpatch.pl --strict. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Acked-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-05-06Input: goodix - check the 'buffer status' bit before reading dataPaul Cercueil1-0/+3
The MSB of the first byte read via I2C at the coordinates address indicates whether the data is valid or ready (called "buffer status" in the datasheets) when an interrupt is raised. Previously, this bit was ignored, which resulted in a lot of incorrect detections of "finger removed" events. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-06Input: goodix - add device tree supportAleksei Mamlin1-1/+20
This change adds device tree support and binding information for Goodix GT9xx series touchscreen controller. It also adds support for 5-finger chips, like GT911 and GT912, which can be found on ARM tablets, such as Wexler TAB7200 and MSI Primo73. Datasheets can be found here: https://drive.google.com/folderview?id=0BxCVOQS3ZymGfmJyY2RKbE5XbVlKNlktVTlwV0lxNEdxd2dzeWZER094cmJPVnMxN1F0Yzg&usp=sharing Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com> Reviewed-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-06Input: goodix - use max touch number from device configAleksei Mamlin1-6/+9
Use max number of touches from device config instead of hardcoding. Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com> Tested-by: Bastien Nocera <hadess@hadess.net> Acked-by: Bastien Nocera <hadess@hadess.net> Tested-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-10-31Input: add driver for the Goodix touchpanelBastien Nocera1-0/+395
Add a driver for the Goodix touchscreen panel found in Onda v975w tablets. The driver is based off the Android driver gt9xx.c found in some Android code dumps, but now bears no resemblance to the original driver. The driver was tested on the aforementioned tablet. Signed-off-by: Bastien Nocera <hadess@hadess.net> Tested-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>