1
0
Fork 0
Commit Graph

5724 Commits (redonkable)

Author SHA1 Message Date
Michal Koziel 74da8008e5 touch: pt: skipping polling for boot mode exit if already out of boot
Function _pt_poll_for_fw_exit_boot_mode() is not needed to be called if
the controller is already out of boot mode. This function was delaying
resume from wakeup unnecessarly for modes other that boot.
2021-05-05 16:35:10 +02:00
Michal Koziel 683461ccfa touch: pt: skipping polling for boot mode exit for PIP <1.11
PIP <1.11 has no support for polling wait. A hard coded delay was used
instead, but it only delayed wakeup from sleep. The cyttsp5 driver that
was used before introduction of this pt driver did not have any delay.
2021-05-05 16:35:10 +02:00
Michal Koziel d348a9ce8f touch: pt: outputs touch controller HW version known from probing
To obtain the HW version from user space:
cat /sys/devices/soc0/soc/30800000.aips-bus/30a40000.i2c/i2c-2/2-0024/hw_version

HW version obtained from the pt driver through sysfs was each time read
directly from the controller. The version was sometimes reported as
FFFF.FFFF.FF.
The HW version read during probing is now reported.
2021-05-05 12:17:01 +02:00
Michal Koziel 79b264bc2a touch: pt: silencing error messages on boot
A number of error messages where printed to the console on boot. These
are either not errors at all, are not handled as errors or are not severe
enough to be treated as errors. The same messages where printed on every
boot. To avoid cluttering the console and potentially overshadowing
other errors these messages where reduced from errors to warnings.
2021-05-05 09:51:21 +02:00
Michal Koziel 745322b72f touch: pt: resolved 'ISO C90 forbids variable length array data' warnings 2021-05-05 09:51:21 +02:00
Michal Koziel 003f35d627 touch: pt: reduce debug level for PIP < 1.11 not supporting polling wait
Devices implementing PIP < 1.11 do not support polling wait. This is expected, hence the debug warning level has been reduced from DL_ERROR to DL_WARN.
2021-05-05 09:51:21 +02:00
Michal Koziel af49deb502 touch: pt: Error message printed out when supposed to. 2021-05-05 09:51:21 +02:00
Michal Koziel f9a9de0748 touch: pt: support wake-up from 'standby' sleep
To support system wake-up from 'standby' sleep via single tapping with
sensed touch data, we need to distinguish suspend type between 'mem' and
'standby', and only puts touch device into sleep for 'mem' sleep.  It's
basically a rewriting of suspend/resume hooks, including:

 - Drop easy-wake gesture handling, as we do not support it.
 - Deal with pinctrl state, touch sleep and IRQ disabling only in case
   of 'mem' sleep.
 - Enable touch as a system wake-up source in case of 'standby' sleep.
2021-05-05 09:51:21 +02:00
Michal Koziel 6079b29129 touch: pt: select pinctrl state during suspend/resume
To support suspend/resume from LPSR mode, we need to select default
pinctrl state in resume, so that IOMUXC settings can be restored from
power losing.
2021-05-05 09:51:21 +02:00
Michal Koziel 66b869714f touch: pt: Write debug when trk_id is bad
The parade touch controller support people want a
debug dump when the bad trk_id error occurs.
2021-05-05 09:51:21 +02:00
Michal Koziel c799511f3f pt: fb blanking configurable in devtree
Add an optional  device tree parameter
  parade,fb_blanking_disabled

This parameter controls the blanking notifier.
If the parameter is set in the device tree,
the parade device will NOT change its state
according to the state of the framebuffer
device.
2021-05-05 09:51:21 +02:00
Michal Koziel 8749e3f90c touch: pt: Fix getting of GPIO in pt from device tree 2021-05-05 09:51:21 +02:00
Michal Koziel 4fd0a33aa7 touch: pt: use regulator to control power
VDD_3V3_TOUCH power to cyttsp5 touch is controlled by GPIO TOUCH_PWR_EN.
Rather than relying on U-Boot to initialize the power, let's use
regulator to control it.
2021-05-05 09:51:21 +02:00
Michal Koziel 2ac5ccb2db touch: imported pt (Parade TrueTouch Gen5 Touchscreen Driver) 2021-05-05 09:51:21 +02:00
Michal Koziel f6bb4d231b wacom_i2c: added setup of input events per packet explicitly for this driver 2021-03-08 17:42:39 +01:00
Michal Koziel 8f0ceaabd1 wacom_i2c:not disabling i2c interrupt when suspending 2021-03-08 17:42:39 +01:00
Lars Ivar Miljeteig 9b7a56e594 touch: cyttsp5: Write debug when trk_id is bad
The parade touch controller support people want a
debug dump when the bad trk_id error occurs.
2020-10-08 20:41:29 +02:00
Lars Ivar Miljeteig 63408b013c input evdev: Fix ktime_t pointer confusion 2020-10-08 20:41:24 +02:00
Lars Ivar Miljeteig e753c5f29b Revert "touch: put touch into sleep when digitizer is in scanning"
This reverts commit 95f5a6b816857ad5b607a1be25cb41ce7c4ff4b2.

Caused a two second delay before the touch screen would
work after using the pen. Disturbed the gestures.
2020-10-08 20:41:24 +02:00
Lars Ivar Miljeteig 6e3da14a60 Revert "snvs_pwrkey: shorten ON_TIME to get a faster reaction on wake-up"
This reverts commit cc7fffa6e20c6b90568f745c51e6f33e0b91c694.

Code is moved to pm-imx7.

We want to have 500ms ON_TIME for power on, and
50ms ON_TIME from LPSR sleep
2020-10-08 20:41:23 +02:00
Lars Ivar Miljeteig a6387eca21 Revert "touchscreen: cyttsp5: Do FW update as delayed work"
This reverts commit a5410575ebbde14b55f66af5782779f31e14efe7.

Caused some partial updates, and touch didn't work for a couple of
seconds after boot when waiting for firmware update.
2020-10-08 20:41:23 +02:00
Thomas Ingebretsen 6118256eba wacom_i2c: use BARREL_SWITCH_2 as BTN_STYLUS2 instead of INVERT. 2020-10-08 20:41:23 +02:00
Shawn Guo 91c7b32118 wacom: fix ghost power on VDD_3V3_DIGITIZER
It operates on GPIO DIGITIZER_PWR_EN via regulator API to turn off
VDD_3V3_DIGITIZER for 'mem' sleep.  While at it, let's call pinctrl
functions and wacom_setup_device() for 'mem' sleep only, as they are not
required for 'standby' sleep.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:41:22 +02:00
Thomas Ingebretsen eb72f683b5 wacom_i2c: Set custom timestamp to get better accuracy. The timestamp is sampled before i2c data transfer. 2020-10-08 20:41:20 +02:00
Thomas Ingebretsen 3b3aa48d1a evdev: Applied patch https://patchwork.kernel.org/patch/11049457/ to be able to set custom timestamps for input events. 2020-10-08 20:41:19 +02:00
Lars Ivar Miljeteig 871b0416e2 touchscreen: cyttsp5: Do FW update as delayed work
The touchscreen firmware is not loaded when the
file system is not ready. This patch will make
the cyttsp5 driver wait 8 seconds before looking
for the firmware file.
2020-10-08 20:41:19 +02:00
Shawn Guo d9d1fda08d touch: put touch into sleep when digitizer is in scanning
When digitizer is in scanning (pen is on screen), touch can be put into
sleep state to save power, and then be waken up when pen leaves screen.

The implementation is to have digitizer interrupt handler actively
notifies touch driver that digitizer is in scanning.  The notifier
callback in touch driver will detect the first call which indicates the
begin of digitizer scanning, and then it puts touch into sleep.  And
every time the callback gets invoked, it resets a timer until notifier
stops calling.  In that case, the timer will timeout, and it indicates
that digitizer stops scanning and touch will be woken up and back to
work.

As the procedure of putting touch device into sleep and waking-up
involves I2C data transfer which can sleep, it cannot be done in an
interrupt context, so a work is created for that.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:41:19 +02:00
Shawn Guo 434f5cf892 touch: cyttsp5: support wake-up from 'standby' sleep
To support system wake-up from 'standby' sleep via single tapping with
sensed touch data, we need to distinguish suspend type between 'mem' and
'standby', and only puts touch device into sleep for 'mem' sleep.  It's
basically a rewriting of suspend/resume hooks, including:

 - Drop easy-wake gesture handling, as we do not support it.
 - Deal with pinctrl state, touch sleep and IRQ disabling only in case
   of 'mem' sleep.
 - Enable touch as a system wake-up source in case of 'standby' sleep.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:41:19 +02:00
Shawn Guo aa13419a71 touch: wacom: enable device as a wakeup source
To support system suspend during idle, we need to wake up system via
digitizer.  With this change, we can disable/enable the wakeup at
run-time as below.

 $ echo disabled >| /sys/bus/i2c/devices/0-0009/power/wakeup
 $ echo enabled >| /sys/bus/i2c/devices/0-0009/power/wakeup

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:41:19 +02:00
Thomas Ingebretsen 85e7f75ffd wacom_i2c: return wacom_setup_device return code. 2020-10-08 20:41:19 +02:00
Thomas Ingebretsen 07e01e13f0 wacom_i2c: call wacom_setup_device() after resume to setup sample rate after returning from sleep. 2020-10-08 20:41:19 +02:00
Shawn Guo af6f07c690 touch: cyttsp5: increase CY_HID_OUTPUT_TIMEOUT to 1000ms
The firmware upgrade testing discovers that 200ms CY_HID_OUTPUT_TIMEOUT
is not good enough, and causes suspend scanning call in
cyttsp5_get_ic_crc_() fail.  Let's increase it to 1000ms as per vendor's
suggestion.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:41:18 +02:00
Shawn Guo 1adec42136 snvs_pwrkey: shorten ON_TIME to get a faster reaction on wake-up
The default 500ms ON_TIME is too long, and thus causes a slow reaction
on power key wake-up.  Let's change it to 50ms to get a faster reaction.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:41:18 +02:00
Shawn Guo 069e8a2682 touch: cyttsp5: use regulator to control power
VDD_3V3_TOUCH power to cyttsp5 touch is controlled by GPIO TOUCH_PWR_EN.
Rather than relying on U-Boot to initialize the power, let's use
regulator to control it.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:07:15 +02:00
Shawn Guo 192cf86226 touch: wacom: use regulator to control power
VDD_3V3_DIGITIZER power to digitizer is controlled by GPIO
DIGITIZER_PWR_EN.  Rather than relying on U-Boot to initialize the
power, let's use regulator to control it.

While at it, fix the memory leak on wac_i2c allocation in failure of
wacom_query_device() and other calls.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:07:15 +02:00
Lars Ivar Miljeteig bd16c306a1 cyttsp5: fb blanking configurable in devtree
Add an optional  device tree parameter
  cy,fb_blanking_disabled

This parameter controls the blanking notifier.
If the parameter is set in the device tree,
the cyttsp5 device will NOT change its state
according to the state of the framebuffer
device.
2020-10-08 20:07:15 +02:00
Shawn Guo f23c92f91c touch: wacom: select pinctrl state during suspend/resume
To support suspend/resume from LPSR mode, we need to select default
pinctrl state in resume, so that IOMUXC settings can be restored from
power losing.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:07:14 +02:00
Shawn Guo 42829d020a touch: cyttsp5: select pinctrl state during suspend/resume
To support suspend/resume from LPSR mode, we need to select default
pinctrl state in resume, so that IOMUXC settings can be restored from
power losing.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 20:07:14 +02:00
Lars Ivar Miljeteig 112de94c68 wacom_i2c: Add dev-tree support to invert values
Reads
 * flip-tilt-x
 * flip-tilt-y
 * flip-pos-x
 * flip-pos-y
 * flip-distance
 * flip-pressure
from the device tree, and acts accordingly.

Also cleans up memory management in probe, and stores
the features information for later usage.
2020-10-08 20:07:12 +02:00
Lars Ivar Miljeteig ce15e28ef5 wacom_i2c: Read distance as short integer
The 16bit distance value was read into an
unsigned char, stripping away 8bits and
wrapping negative values. This patch
reads the distance (hover) value as an
16-bit integer.
2020-10-08 20:07:11 +02:00
Lars Ivar Miljeteig 043f1efbd7 wacom_i2c: Clean-up code
- Use bitmasks
- Don't assign bool prox = 0x03, as bool can be 0 or 1
- Remove unused read_bytes variable
2020-10-08 20:07:11 +02:00
Lars Ivar Miljeteig f8351fdd9d wacom_i2c: Clean-up logging, whitespace, deadcode
Removed SBA printk messages
Removed deadcode for test LED etc
Cleaned up whitespace (tabs, not spaces in kernel)
2020-10-08 01:38:39 +02:00
Shawn Guo 8fc85322fb input: wacom_i2c: drop reset sequence on GPIO
The reset sequence via GPIO makes digitizer non-functional. This was not
an issue when we have GPIO1_0 pad configured as WDOG function, because
the reset sequence setting on the GPIO doesn't take any effect.  But now
pad configuration is gone and the pad works in GPIO mode by default, so
the reset sequence is taking effect.  Let drop this problematic reset
and get digitizer back to work.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2020-10-08 01:38:34 +02:00
Thomas Ingebretsen 3fc278d53c wacom_i2c: setting sample rate to 540pps. More readable command-structures. 2020-10-08 01:37:04 +02:00
Thomas Ingebretsen 130bf89b14 Setting up sample rate by writing position rate report. 2020-10-08 01:37:04 +02:00
Thomas Ingebretsen 676f0a2e29 Wacom INT pullup. Wacom 400kHz i2c. Some changes to wacom driver. 2020-10-08 01:37:04 +02:00
Steinar Bakkemo 6838f4357c wacom: add manual GPIO based reset code in wacom driver probe 2020-10-08 01:26:36 +02:00
Lars Ivar Miljeteig 4ea51503a2 Wacom driver: Add lots of ugly logging 2020-10-07 11:32:39 +02:00
Martin T. H. Sandsmark 641e063fd5 wacom_i2c: the new wacom firmware reports tilt with 2 bytes 2020-10-07 11:32:39 +02:00
Martin T. H. Sandsmark e2a5886d7c wacom_i2c: Remove some useless debug output from wacom_i2c driver 2020-10-07 11:32:38 +02:00