<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/input/touchscreen/goodix.c, branch v4.17.1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.17.1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.17.1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-01-31T22:44:40+00:00</updated>
<entry>
<title>Input: goodix - use generic touchscreen_properties</title>
<updated>2018-01-31T22:44:40+00:00</updated>
<author>
<name>Marcin Niestroj</name>
<email>m.niestroj@grinn-global.com</email>
</author>
<published>2018-01-26T19:08:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fafef982c7353e8982b951e40573e990ccf0ed00'/>
<id>urn:sha1:fafef982c7353e8982b951e40573e990ccf0ed00</id>
<content type='text'>
Use touchscreen_properties structure instead of implementing all
properties by our own. It allows us to reuse generic code for parsing
device-tree properties (which was implemented manually in the driver for
now). Additionally, it allows us to report events using generic
touchscreen_report_pos(), which automatically handles inverted and
swapped axes.

This fixes the issue with the custom code incorrectly handling case where
ts-&gt;inverted_x and ts-&gt;swapped_x_y were true, but ts-&gt;inverted_y was
false. Assuming we have 720x1280 touch panel, ts-&gt;abs_x_max == 1279 and
ts-&gt;abs_y_max == 719 (because we inverted that in goodix_read_config()).
Now let's assume that we received event from (0:0) position (in touch
panel original coordinates). In function goodix_ts_report_touch() we
calculate input_x as 1279, but after swapping input_y takes that value
(which is more that maximum 719 value reported during initialization).

Note that since touchscreen coordinates are 0-indexed, we now report
touchscreen range as (0:size-1).

Developed and tested on custom DT-based device with gt1151 touch
panel.

Signed-off-by: Marcin Niestroj &lt;m.niestroj@grinn-global.com&gt;
[dtor: fix endianness annotation reported by sparse, handle errors when
 initializing MT slots]
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: goodix - disable IRQs while suspended</title>
<updated>2018-01-12T08:42:47+00:00</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2018-01-12T08:36:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=faec44b6838312484d63e82286087cf2d5ebb891'/>
<id>urn:sha1:faec44b6838312484d63e82286087cf2d5ebb891</id>
<content type='text'>
We should not try to do any i2c transfers before the controller is
resumed (which happens before our resume method gets called).

So we need to disable our IRQ while suspended to enforce this. The
code paths for devices with GPIOs for the int and reset pins already
disable the IRQ the through goodix_free_irq().

This commit also disables the IRQ while suspended for devices without
GPIOs for the int and reset pins.

This fixes the i2c bus sometimes getting stuck after a suspend/resume
causing the touchscreen to sometimes not work after a suspend/resume.
This has been tested on a GPD pocked device.

BugLink: https://github.com/nexus511/gpd-ubuntu-packages/issues/10
BugLink: https://www.reddit.com/r/GPDPocket/comments/7niut2/fix_for_broken_touch_after_resume_all_linux/
Tested-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: goodix - support gt1151 touchpanel</title>
<updated>2017-10-24T18:58:19+00:00</updated>
<author>
<name>Marcin Niestroj</name>
<email>m.niestroj@grinn-global.com</email>
</author>
<published>2017-10-24T18:06:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=25309004c0e761986c9dc23526a03928a85188c0'/>
<id>urn:sha1:25309004c0e761986c9dc23526a03928a85188c0</id>
<content type='text'>
Support was added based on Goodix GitHub repo [1]. There are two major
differences between gt1151 and currently supported devices (gt9x):
 * CONFIG_DATA register has 0x8050 address instead of 0x8047,
 * config data checksum has 16-bit width instead of 8-bit.

Also update goodix_i2c_test() function, so it reads ID register (which
has the same address for all devices) instead of CONFIG_DATA (because
its address is known only after reading ID of the device).

[1] https://github.com/goodix/gt1x_driver_generic

Signed-off-by: Marcin Niestroj &lt;m.niestroj@grinn-global.com&gt;
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: goodix - poll the 'buffer status' bit before reading data</title>
<updated>2017-10-19T23:50:39+00:00</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2017-10-13T18:04:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9b5db7aab4d6b66f84f5e147c87eff4fe8b48651'/>
<id>urn:sha1:9b5db7aab4d6b66f84f5e147c87eff4fe8b48651</id>
<content type='text'>
The Goodix panel triggers an interrupt on touch events. However, its
registers will contain the valid values a short time after the
interrupt, and not when it's raised. At that moment, the 'buffer status'
bit is set.

Previously, if the 'buffer status' bit was not set when the registers
were read, the data was discarded and no input event was emitted,
causing "finger down" or "finger up" events to be missed sometimes.

This went unnoticed until v4.9, as the DesignWare I2C driver commonly
used with this driver had enough latency for that bug to never trigger
until commit 2702ea7dbec5 ("i2c: designware: wait for disable/enable only
if necessary").

Now, in the IRQ handler we will poll (with a timeout) the 'buffer status'
bit and process the data of the panel as soon as this bit gets set.

Note that the Goodix panel will send a few spurious interrupts after the
'finger up' event, in which the 'buffer status' bit will never be set.

Cc: Bastien Nocera &lt;hadess@hadess.net&gt;
Cc: russianneuromancer@ya.ru
Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
[hdegoede@redhat.com: Change poll loop to use jiffies,
                      add comment about typical poll time]
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
[dtor: rearranged control flow a bit to avoid explicit goto and double
check]
Reviewed-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: goodix - add support for capacitive home button</title>
<updated>2017-09-11T21:23:15+00:00</updated>
<author>
<name>Sergei A. Trusov</name>
<email>sergei.a.trusov@ya.ru</email>
</author>
<published>2017-09-07T00:29:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a54feea1765a79ac8446bd6f5ce163fc94a8a95'/>
<id>urn:sha1:4a54feea1765a79ac8446bd6f5ce163fc94a8a95</id>
<content type='text'>
On some x86 tablets with a Goodix touchscreen, the Windows logo on the
front is a capacitive home button. Touching this button results in a touch
with bit 4 of the first byte set, while only the lower 4 bits (0-3) are
used to indicate the number of touches.

Report a KEY_LEFTMETA press when this happens.

Note that the hardware might support more than one button, in which
case the "id" byte of coor_data would identify the button in question.
This is not implemented as we don't have access to hardware with
multiple buttons.

Signed-off-by: Sergei A. Trusov &lt;sergei.a.trusov@ya.ru&gt;
Acked-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
<entry>
<title>Input: goodix - use "inverted_[xy]" flags instead of "rotated_screen"</title>
<updated>2015-12-18T01:11:56+00:00</updated>
<author>
<name>Karsten Merker</name>
<email>merker@debian.org</email>
</author>
<published>2015-12-18T01:08:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=57c80e8e5d1cddae0651e5314394e6069ebbbe3c'/>
<id>urn:sha1:57c80e8e5d1cddae0651e5314394e6069ebbbe3c</id>
<content type='text'>
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 &lt;merker@debian.org&gt;
Reviewed-by: Irina Tirdea &lt;irina.tirdea@intel.com&gt;
Tested-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Acked-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
<entry>
<title>Input: goodix - add axis swapping and axis inversion support</title>
<updated>2015-12-18T01:11:55+00:00</updated>
<author>
<name>Karsten Merker</name>
<email>merker@debian.org</email>
</author>
<published>2015-12-18T01:02:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad48cf5e9597147bb2bb526a6d379ee88970dec8'/>
<id>urn:sha1:ad48cf5e9597147bb2bb526a6d379ee88970dec8</id>
<content type='text'>
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 &lt;merker@debian.org&gt;
Tested-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Tested-by: Irina Tirdea &lt;irina.tirdea@intel.com&gt; (with ACPI DSD properties)
Tested-by: Aleksei Mamlin &lt;mamlinav@gmail.com&gt; (with device-tree properties)
Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
<entry>
<title>Input: goodix - use goodix_i2c_write_u8 instead of i2c_master_send</title>
<updated>2015-12-18T01:11:54+00:00</updated>
<author>
<name>Irina Tirdea</name>
<email>irina.tirdea@intel.com</email>
</author>
<published>2015-12-18T00:47:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5d655b35466835c6bb8774122db95ecb4e18888d'/>
<id>urn:sha1:5d655b35466835c6bb8774122db95ecb4e18888d</id>
<content type='text'>
Use goodix_i2c_write_u8 instead of i2c_master_send to simplify code.

Signed-off-by: Irina Tirdea &lt;irina.tirdea@intel.com&gt;
Tested-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Tested-by: Aleksei Mamlin &lt;mamlinav@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
<entry>
<title>Input: goodix - add power management support</title>
<updated>2015-12-18T01:11:53+00:00</updated>
<author>
<name>Irina Tirdea</name>
<email>irina.tirdea@intel.com</email>
</author>
<published>2015-12-18T00:43:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ab09d6a8f6406134085fb3f30ab61968c6f1ddf'/>
<id>urn:sha1:5ab09d6a8f6406134085fb3f30ab61968c6f1ddf</id>
<content type='text'>
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 &lt;octavian.purdila@intel.com&gt;
Signed-off-by: Irina Tirdea &lt;irina.tirdea@intel.com&gt;
Tested-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
<entry>
<title>Input: goodix - write configuration data to device</title>
<updated>2015-12-18T01:11:53+00:00</updated>
<author>
<name>Irina Tirdea</name>
<email>irina.tirdea@intel.com</email>
</author>
<published>2015-12-18T00:05:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=68caf85881cd842b59d5e2124a236ecce0389a73'/>
<id>urn:sha1:68caf85881cd842b59d5e2124a236ecce0389a73</id>
<content type='text'>
Goodix devices can be configured by writing custom data to the device at
init. The configuration data is read with request_firmware from
"goodix_&lt;id&gt;_cfg.bin", where &lt;id&gt; 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 &lt;octavian.purdila@intel.com&gt;
Signed-off-by: Irina Tirdea &lt;irina.tirdea@intel.com&gt;
Tested-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Tested-by: Aleksei Mamlin &lt;mamlinav@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
</feed>
