Commit Graph

650 Commits

Author SHA1 Message Date
Stephen Boyd
533badde3d input: touchscreen: Add MSM legacy touchscreen driver
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:30:54 -08:00
Mohan Pallaka
a3bbf8ce4c input: ft5x06_ts: Add driver for ft5x06 series
Ft5x06 controllers are single chip capacitive
touch panel controller ICs with a built-in 8 bit
Micro Controller Unit. It supports multi-touch
capability and can detect up to five touches.

Change-Id: I39eb1175d473d1f2c463e1c4a0a1606307da9dc0
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2013-02-25 11:30:53 -08:00
Stephen Boyd
8835b4caf2 input: touchscreen: Add msm_ts driver
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:30:52 -08:00
Anirudh Ghayal
b5a1434021 input: tsc2007: Specify max/min coordinates from platform data
Provides flexibility to specify max/min x and y coordinates from
platform data. Useful in cases where the TS controller reports
coordinates at an offset from the predefined min/max values
(0 and 4096 respectively).

Change-Id: Ia93a8940078aa5960d1d900ac56b0b3354c82e40
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:51 -08:00
Anirudh Ghayal
00883c63af input: tsc2007: Remove unnecessary I2C write in the resume path
Across multiple suspend-resume cycles the I2C write failures
locked out the TSC2007 contoller. Remove this I2C operation
as it is not required.

Change-Id: I8fa97f0fc8eb89c1fd4fe1e3269ea050056d6625
CRs-Fixed: 266968
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:50 -08:00
Anirudh Ghayal
a0829cee12 input: tsc2007: Add early suspend support
Change-Id: I3c2722e858726ff6a95c3fc284db97b537dd20ee
CRs-Fixed: 258762
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:49 -08:00
Anirudh Ghayal
6f1bfa9f89 input: tsc2007: Power optimization in suspend/resume for TSC2007
Disable/enable the voltage regulators during suspend/resume operations.

Change-Id: I0d10edc87d07c01327fa2258aae964d430cae7e3
CRs-Fixed: 258762
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:49 -08:00
Anirudh Ghayal
efe979e255 input: tsc2007: Add features to the TSC2007 driver
The following features are now supported -

1. Inverse coordinates
2. Suspend / resume
3. Interrupt flags from platform data

Change-Id: I08adcdf0fd1c983ffaa958bea23e2ed06aa6e086
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:48 -08:00
Stephen Boyd
45a7ba329b Revert "Input: tsc2007 - convert to threaded IRQ"
This reverts commit 377dc5538c.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:30:47 -08:00
Stephen Boyd
e7f3cc5018 Revert "Input: tsc2007 - add open and close methods"
This reverts commit d3654d7ef3.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:30:46 -08:00
Stephen Boyd
88d5a554d4 Revert "Input: tsc2007 - make sure that X plate resistance is specified"
This reverts commit 341deefe8f.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:30:45 -08:00
Anirudh Ghayal
d00232f331 input: touchscreen: Add support for TMG200 touch controller
The TMG200 touch controller supports upto two touches. This
driver supports both TMG200 and TMA300 controllers.

CRs-Fixed: 226967
Change-Id: I32871e76d3dd77fec0a723e1c306492bda2de897
Signed-off-by: Anirudh Ghayal <aghayal@qualcomm.com>
2013-02-25 11:30:44 -08:00
Mohan Pallaka
e501de3c01 input: cyttsp-i2c: Enable firmware loading feature from driver
TTSP firmware can be loaded during driver's probe by updating
the firmware header file. This header file contains the firmware
data as part of an array and it's version number.

Change-Id: Ia80aab77d654d64ab3bb14c9b316bb851b90f241
Signed-off-by: Kevin McNeely <kev@cypress.com>
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2013-02-25 11:30:44 -08:00
Stephen Boyd
caba358c3c input: touchscreen: Add our version of cyttsp-i2c
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:30:43 -08:00
Mohan Pallaka
896c5a0a2b input: synaptics_rmi_ts: Add ABS_MT_PRESSURE event
Use ABS_MT_PRESSURE to report pressure instead of relying
on ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR events.

Change-Id: I3954e729ad48a28970b470df8c86c3a22ea56bd9
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2013-02-25 11:30:42 -08:00
Taniya Das
d079c123d2 input: touchscreen: Add support for synaptics clearpad3000
Change-Id: Ie00815ed507d81c6934ac0d4b1dfa745215ff01a
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2013-02-25 11:30:41 -08:00
Anirudh Ghayal
0f3ae0efe6 input: atmel-mxt-ts: Report the correct pressure value
The contact area was earlier being reported as pressure.
The controller explicitly reports the pressure value, use that.

Change-Id: I1548329a676fd9a6e6a8a63ed76244e68a29c282
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:40 -08:00
Stephen Boyd
6defd5bb78 input: atmel_mxt_ts: Fix section mismatch
WARNING: vmlinux.o(.devinit.text+0x4878): Section mismatch in
reference from the function mxt_probe() to the function
.init.text:mxt_debugfs_init()
The function __devinit mxt_probe() references
a function __init mxt_debugfs_init().
If mxt_debugfs_init is only used by mxt_probe then
annotate mxt_debugfs_init with a matching annotation.

Change-Id: Iebb2b174e307d2497297b16396579c7ef3da6721
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:30:39 -08:00
Anirudh Ghayal
b03e34b8ea input: atmel_mxt_ts: Do not disable multi-touch object in suspend
Disabling multi-touch object when touch is operational
may result in improper state of the controller causing it to
report invalid number of touches.

There is no negative impact on power or operation of the
controller after this change.

CRs-Fixed: 351462
Change-Id: I170c094386be415dbc53e15e6e36e2d8de832c5d
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:38 -08:00
Jing Lin
9bb1fdcb91 input: atmel_mxt_ts: Zero out config version after firmware upgrade
When the touch controller firmware is upgraded, the config data on
the controller might require an update too to match the firmware.
Since the driver performs config version checking before updating
config data and only updates to a newer version, we need to zero
out the config version after a firmware upgrade to make sure proper
config data will be programmed to the touch controller.

Change-Id: If3e22948b1f8eea3ccbfcaa979ec6b42f1ac078a
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:38 -08:00
Jing Lin
08172cfa5e input: atmel_mxt_ts: Move the logic to save objects locally to a function
The Atmel touch driver reads information about a few objects at
initialization and saves them locally. Move this logic to its
own function.

Change-Id: I0f584ff5dcba6b713b3ac6b950ed64f3ad46faf1
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:37 -08:00
Jing Lin
7e5b4177b4 Input: atmel_mxt_ts: Update config to newer version only
Add version checking so that config update only occurs when the config
data supplied in the platform data is of newer version. If the
controller is previously programmed with wrong version of config data,
based on controller type and firmware version, the driver will program
the latest config data present in the platform data to the controller.

Change-Id: I286852533aef920accb254ab7259edc144357dd3
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:36 -08:00
Mohan Pallaka
3c93af8b20 input: atmel_mxt_ts: Fix to reject coordinates outside active touch area
Firmware reports minimum/maximum coordinates when touches are
from outside of active area. Generate a release event in this
case to handle touches that are going to inactive area. Add
pdata entries for minimum values and check before reporting
the coordinates to userspace.

CRs-fixed: 326858
Change-Id: I385fb80eb670e539b45d232c04969c4502cdf65a
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2013-02-25 11:30:35 -08:00
Anirudh Ghayal
e8e167997e Input: atmel-mxt_ts: Support firmware upgrade in bootloader mode
If a firmware upgrade fails, on subsequent boot retry a firmware
upgrade based on the bootloader id. This can be initiated through
the userspace program by writing into the update_fw sysfs entry.

Change-Id: I1d428c52f2cbfff8fe572a2bc6f0cd124111b810
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:34 -08:00
Jing Lin
2c82807ae2 input: atmel_mxt_ts: Support hex format firmware upgrade
The firmware file from Atmel is in hex format, while the touch
controller expects binary data. The driver converts the data from
hex to binary before passing them to the controller for upgrade.

Change-Id: Iedccf467f18d3156280396153d7ca7cef1a52afb
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:33 -08:00
Anirudh Ghayal
3890f46e4a input: atmel-mxt-ts: Provide firmware name via platform data
This allows firmware upgrade only when a firmware name is provided.
The platform data (config data) of the latest firmware will point
to a NULL string which prevents auto firmware upgrade at boot
(if enabled by the userspace).

Change-Id: Ifef57a9dab9306cf4f1fe7a6c7e52c5e92a25d4a
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:33 -08:00
Nick Dyer
d5a63b55ea Input: atmel-mxt-ts - Improve bootloader support
Add additional bootloader addresses
     Read and report bootloader version
     Increase fw reset time for greater reliability
     Further bootloader improvements
     Handle APP_CRC_FAIL on startup
     Handle bootloader frame CRC failure
     Recover gracefully from flash aborted halfway through

Change-Id: I4beaceb85a6dc52370457a9ab453cccd87f2c2b7
Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:32 -08:00
Joonyoung Shim
3a736da6c2 Input: atmel_mxt_ts - convert to MT protocol B
Atmel touchscreen chips can use MT protocol B because they can assign
unique id to ABS_MT_TRACKING_ID from finger id provided by hardware.

Change-Id: Ia37e7d993380b28599b09aed9075c91ce4259f88
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2013-02-25 11:30:31 -08:00
Amy Maloche
79c0b2dcb6 input: atmel_mxt_ts: Don't set mode on unsettable regulators
Currently during boot, and every suspend/resume, we call
regulator_set_optimum_mode on every touchsdcreen regulator. However,
some regulators don't support this function, and this will cause
set_optimum_mode to print an error when this occures.  Correct this by
checking if it is valid to call set_optimum_mode on a given regulator
before doing so.

Change-Id: I8dbd9d8281cb144b31c59d86fcf4e8a8133cd6a7
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:30 -08:00
Amy Maloche
55ac8f9124 input: atmel-mxt-ts: Provide max touch coordinates via platform data
The atmel_mxt_ts driver manipulates the touch coordinates
if they are < 1024. In cases when the display < 1024 and
virtual key area > 1024, there is a problem in reporting
the coordinates for the virtual key area. Add new pdata
variables which can handle this.

Change-Id: Ic31db032a1598c60c01bff31c7b36042f42c9817
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:29 -08:00
Jing Lin
f91cb66b8e Input: atmel_mxt_ts: Add a debugfs attribute to show all objects
The sysfs attribute show method (mxt_object_show) is limited to show
object information up to (PAGE_SIZE - 1) bytes. We need a way to get
the complete information of all objects. The object information can
be obtained from <debugfs-mount>/atmel_mxt_ts/object.

Change-Id: I92fff75b37ba0cba19b137460c2144fe847c6343
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:28 -08:00
Jing Lin
80a0439c94 input: atmel_mxt_ts: Add support for object PROCI_SHIELDLESS_T56
The mXT1386E touch controller supports a new signal processing object
PROCI_SHIELDLESS_T56. This object is both readable and writable.

Change-Id: I418df8c3f05dc5265a1e7581d9c7e654a9fd3c4c
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:27 -08:00
Jing Lin
b921d6a574 input: atmel_mxt_ts: Support runtime selection of config data
Add support for dynamic configuration data update if the target can
support more than one Atmel chip. Platform data contains an array of
supported config data along with family ID, variant ID and firmware
version. Driver searches for matching family ID, variant ID and
firmware version, and uses the corresponding config data to program.

Change-Id: I684da4bdef56a3445acab3bb8fe47dd5279bebe5
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:27 -08:00
Mohan Pallaka
14a433081d input: atmel_mxt_ts: Add support for keyarray object
Keyarray(T15) object is used for handling capactive keys.
It can handle 32 keys and the keys supported are passed
from platform data as key_codes.

Change-Id: Iac589afb59e8ff69b6e1eb86bafdc0b5382c3edd
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2013-02-25 11:30:26 -08:00
Mohan Pallaka
c10ad9b97a input: atmel_mxt_ts: Release irq and reset gpios
Cleanup and release the gpio pins for irq and reset
when the module is removed.

Change-Id: Id264411a786c7490506271bef2d6f7e55e7d07fb
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2013-02-25 11:30:25 -08:00
Mohan Pallaka
fe578a6e6a input: atmel_mxt_ts: Report pressure as 0 upon MXT release event
Correct event where touch is released but nonzero pressure is
reported by controller.  If there is no touch, pressure should
be reported to Android as zero.

Change-Id: I1865e69faa57bf5cf34325622c3b7170ceaf4654
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2013-02-25 11:30:24 -08:00
Amy Maloche
59a43c5e92 input: atmel_mxt_ts: add mxt224E family reset specifics
Change-Id: Ia07f558a52e1f821da031da7b8f7e6b9afb6bfe9
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:23 -08:00
Amy Maloche
c6f1384ad2 input: atmel_mxt_ts: add gpio framework to driver
Move irq and reset gpios to driver

Change-Id: I386cfdb142cefe6ad7021a67d7d277dc0447411a
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:22 -08:00
Iiro Valkonen
0cbf373101 Input: atmel_mxt_ts - update object list
Update the object list to include new objects, add unique identifiers
so we can distinguish between old & new generation of the same object.

Change-Id: I6e0336e3db1deed1072b5d0c7ba944659ad85b5a
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:22 -08:00
Amy Maloche
fa1997e2af input: atmel_mxt_ts: modify regulator framework for mxt224E
Support mxt224E controller which requires both digital and analog
regulator power.

Change-Id: I2717fd26b4790cf1b6160f09e71611537b47ea3c
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:21 -08:00
Yufeng Shen
9a38a679d1 Input: atmel_mxt_ts - report pressure information from the driver
Atmel mxt1386 touch controller has the touch pressure information but
the current driver atmel_mxt_ts does not expose it to the user space.
This patch makes the driver report the touch pressure information to
user space.

ChangeLog:
v2: fixed indentation as commented by Wanlong Gao
v3: added signed-off-by

Change-Id: Ib30cca618d964793e026a675823d9ed8d4e912b9
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:20 -08:00
Jing Lin
6b228961b0 Input: atmel_mxt_ts: Fix error handling in mxt_probe
Fix out-of-order error handling of several error cases in mxt_probe.
Make sure allocated memory is freed in mxt_initialize when an error
occurs.

Change-Id: I4331a71263b62ff6bdeaafbe6881e591b09d2ffc
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:19 -08:00
Daniel Kurtz
39a97643af Input: atmel_mxt_ts - Use snprintf for sysfs attribute show method
Sysfs attribute show methods are always passed a buffer of length
PAGE_SIZE.  To keep from overwriting this buffer and causing havoc, use
snprintf() to guarantee we never write more than the buffer can hold.

In addition, at least for my touchscreen, the number and size of objects
was far too big to fit in a single 4K page.  Therefore, this patch also
trims some redundant framing text to leave more room for actual data.

Change-Id: If771d66940d9948618b419ff7f0e510a07821274
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:18 -08:00
Jing Lin
9c24377aa8 input: atmel_mxt_ts: Move regulators to LPM/HPM in suspend/resume
Change-Id: I75900b242a628a3ab024e8489273c4cad185c52b
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:18 -08:00
Jing Lin
3fbbdc0d50 input: atmel_mxt_ts: Add retry mechanism for I2C read/write
Try up to 3 times for each I2C read/write with 25ms delay between retries.
This is especially needed when writing to T7 to wake up the controller
from deep sleep mode.
Read/write T7 object in block, instead of one byte at a time.

Change-Id: Ibca9cdbf38c5726af5ff4ee9f0ce9ea6f0d183ee
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:17 -08:00
Jing Lin
f38d36be12 input: atmel_mxt_ts: Clean up pdata and update config array
Remove blen, tchthr, x_line, y_line, orient and voltage from platform
data to not to overwrite the config data with these values. Update
config array to have the proper values.
Turn on i2c_pull_up in platform data.

Change-Id: Ic926e96886f52cea3dad29e9a44559b26c717259
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2013-02-25 11:30:16 -08:00
Amy Maloche
d30d368f74 Input: atmel_mxt_ts: increase delay required for power stabilization
Logging removed which threw previous delay off

Change-Id: I476f584755f676bb80be5b278a60e20f0a4cbb8a
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:15 -08:00
Amy Maloche
33f1771e6d input: atmel_mxt_ts: put device in LPM from T7 and T9
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:14 -08:00
Amy Maloche
95b98f25a8 input: atmel_mxt_ts: Update proper reset time for mxt1386
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:13 -08:00
Iiro Valkonen
2c79cea873 Input: atmel_mxt_ts - Make wait-after-reset peroid compatible with all chips
The delay before the chip can be accessed after reset varies between different
chips in maXTouch family. Waiting for 200ms and then monitoring the CHG (chip
is ready when the line is low) is guaranteed to work with all chips.

v4: Adjust delay depending on the family ID of the chip. Also add a readback
    of command register after backup is issued, to make sure we are not
proceeding
    too fast there.
v3: Add a check for NULL read_chg() function, and add the read_chg() to platform
    files using this driver (currently only mach-goni.c)
v2: At Dmitry's suggestion, add a timeout so we are not stuck looping
    endlessly in case the CHG is not going low.

Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2013-02-25 11:30:13 -08:00