This reverts commit 95f5a6b816857ad5b607a1be25cb41ce7c4ff4b2.
Caused a two second delay before the touch screen would
work after using the pen. Disturbed the gestures.
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>
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 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>
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>
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>
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>
Use __maybe_unused instead of ifdef guards around suspend/resume
functions, in order to increase build coverage and fix build warnings.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Although BTN_TOOL_PEN and BTN_TOOL_RUBBER functioned properly, the driver
didn't have hover functionality, so it's been added.
Also, "WACOM_RETRY_CNT" was not used, so it was removed.
Signed-off-by: Tatsunosuke Tobita <tobita.tatsunosuke@wacom.co.jp>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Apparently GCC can't figure out that we bail if we fail to query device
and will not try to use 'features':
drivers/input/touchscreen/wacom_i2c.c: In function ‘wacom_i2c_probe’:
drivers/input/touchscreen/wacom_i2c.c:177:20: warning: ‘features.fw_version’
may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Because irq_to_gpio() is not available on many platforms let's switch
to level-triggered one-shot IRQs that will stay active as long as
there is data to be read.
Tested-by: Tobita Tatsunosuke <tobita.tatsunosuke@wacom.co.jp>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>