1
0
Fork 0
Commit Graph

35 Commits (f6bb4d231b8d10d4e8736a3eee0bc99a2cb32e84)

Author SHA1 Message Date
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 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
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
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 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 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
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
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
Martin T. H. Sandsmark 0cb4d9ab49 wacom_i2c: Add tilt and distance reporting to Wacom I2C 2020-10-07 11:32:38 +02:00
Martin T. H. Sandsmark 0fbaa312f6 wacom_12c: Port wacom_i2c to device tree 2020-10-07 11:32:38 +02:00
Krzysztof Kozlowski 800e3b9a68 Input: drop owner assignment from i2c_driver
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-07-17 16:57:00 -07:00
Jingoo Han 02b6a58b83 Input: touchscreen - use __maybe_unused instead of ifdef around suspend/resume
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>
2014-11-02 00:10:07 -07:00
Tatsunosuke Tobita 8855f30cd2 Input: wacom_i2c - implement hovering capability
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>
2013-06-18 23:19:00 -07:00
Bill Pemberton e2619cf78e Input: remove use of __devexit
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>
2012-11-24 00:05:38 -08:00
Bill Pemberton 5298cc4cc7 Input: remove use of __devinit
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>
2012-11-24 00:05:19 -08:00
Bill Pemberton 1cb0aa8817 Input: remove use of __devexit_p
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>
2012-11-24 00:03:48 -08:00
Dmitry Torokhov 8830cb88dd Input: wacom_i2c - fix compiler warning
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>
2012-07-07 16:41:12 -07:00
Dmitry Torokhov d568778298 Input: wacom_i2c - do not use irq_to_gpio
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>
2012-04-10 00:42:15 -07:00
Tatsunosuke Tobita 5a966261c0 Input: add support for Wacom Stylus device with I2C interface
This adds support for Wacom Stylus device with I2C interface.

[Dan Carpenter <dan.carpenter@oracle.com>: fix NULL-pointer dereference
 in error handling path.]
Signed-off-by: Tatsunosuke Tobita <tobita.tatsunosuke@wacom.co.jp>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-04-04 09:24:23 -07:00