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.
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.
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.
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.
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.
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.
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.
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.
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.
This reverts commit 95f5a6b816857ad5b607a1be25cb41ce7c4ff4b2.
Caused a two second delay before the touch screen would
work after using the pen. Disturbed the gestures.
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
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.
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>
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.
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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.
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.
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>