Commit Graph

581 Commits

Author SHA1 Message Date
Jing Lin
8a9472dd94 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>
2012-04-02 10:56:11 -07:00
Jing Lin
412aedc8e1 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>
2012-04-02 10:56:00 -07:00
Jing Lin
8fadad7bf0 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>
2012-04-02 10:55:42 -07:00
Mohan Pallaka
56a1a5dc15 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>
2012-03-30 13:12:34 +05:30
Mohan Pallaka
a2595074a6 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>
2012-03-27 12:16:22 +05:30
Anirudh Ghayal
6c3b37b263 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>
2012-03-03 20:29:51 -08:00
Jing Lin
cc974cb584 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>
2012-03-02 15:08:37 -08:00
Anirudh Ghayal
0bcb5b599a 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>
2012-03-02 15:08:17 -08:00
Nick Dyer
0a4016ce13 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>
2012-03-02 15:07:43 -08:00
Joonyoung Shim
cd47322cbe 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>
2012-02-20 11:35:49 -08:00
Amy Maloche
190c4e0e12 input: cyttsp-i2c: Support fw update based on version
Currently, firmware will not upgrade to a version which doesn't
have the same major number as what is already on the device.
This change will allow the upgrade to happen when the new
firmware matches the version listed in platform data, regardless
of what version is currently on the device.

Change-Id: Ifd1733aab2866ed3fce60a462d1699d2c5cb39b4
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2012-02-15 14:06:18 -08:00
Amy Maloche
c331f8422a 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>
2012-02-03 10:25:44 -08:00
Amy Maloche
83c385a929 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>
2012-02-01 14:41:01 -08:00
Jing Lin
6cfc00e091 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>
2012-01-27 08:44:12 -08:00
Jing Lin
c7fc405613 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>
2012-01-27 08:42:21 -08:00
Jing Lin
dc4413c370 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>
2012-01-27 08:40:53 -08:00
Jeff Ohlstein
5ff17d5dcf input: cyttsp-i2c: Don't set mode on unsettable regulators
Currently during boot, and every suspend and resume, we call
regulator_set_optimum_mode on every touchscreen regulator. However,
some regulators don't support this function, and this will cause
set_optimum_mode to print an error when this occurs. Correct this by
checking if it is valid to call set_optimum_mode on a given regulator
before doing so.

Change-Id: I71f0f14b16d9f333bd409d9d5150f11a7ccd8fdf
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
2012-01-26 11:58:32 -08:00
Anirudh Ghayal
482ccccd1f 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>
2012-01-25 13:48:04 +05:30
Mohan Pallaka
382d3ce841 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>
2012-01-19 12:27:21 +05:30
Mohan Pallaka
bfe8f3025a 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>
2012-01-16 12:20:59 -08:00
Mohan Pallaka
5e7343f28e 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>
2012-01-13 13:59:34 -08:00
Anirudh Ghayal
4e66bb7bce drivers: atmel_maxtouch: Fix IRQ handling in a possible race condition
Possibility of the IRQ being disabled twice if IRQ hander and the
missed interrupt check execute simultaneously. This can case the IRQ
to be disabled forever.

Change-Id: If1d1cac138727c866dcd99b882b778d4b31b1774
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2012-01-03 09:07:02 +05:30
Amy Maloche
380cc0b684 input: atmel_mxt_ts: add mxt224E family reset specifics
Change-Id: Ia07f558a52e1f821da031da7b8f7e6b9afb6bfe9
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2011-12-27 08:17:48 +05:30
Amy Maloche
08266db27b 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>
2011-12-27 08:17:15 +05:30
Linux Build Service Account
5aa13e391c Merge "Input: atmel_mxt_ts - update object list" into msm-3.0 2011-12-26 00:59:33 -08:00
Linux Build Service Account
fe99c760d8 Merge changes I2717fd26,Ib30cca61 into msm-3.0
* changes:
  input: atmel_mxt_ts: modify regulator framework for mxt224E
  Input: atmel_mxt_ts - report pressure information from the driver
2011-12-23 07:37:58 -08:00
Iiro Valkonen
e8645595e7 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>
2011-12-20 18:26:13 -08:00
Amy Maloche
21115ebe19 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>
2011-12-20 18:26:13 -08:00
Yufeng Shen
e6eb36a842 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>
2011-12-20 18:26:13 -08:00
Mohan Pallaka
e2da76d105 input: cyttsp-i2c: Convert mdelay to sleep variant calls
Replace busy waiting mdelay calls with sleep variant calls
like msleep and usleep_range.

Change-Id: I516dba3c78fe7e61f6da9340fba16ba1f61c2be4
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2011-12-20 14:56:22 +05:30
Mohan Pallaka
d99a79c3ee 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>
2011-12-08 15:55:48 +05:30
Linux Build Service Account
73341822cc Merge "input: atmel_maxtouch: Rename mxt_platform_data to maxtouch_platform_data" into msm-3.0 2011-11-28 23:16:15 -08:00
Mohan Pallaka
4e9a94e60d input: atmel_maxtouch: Rename mxt_platform_data to maxtouch_platform_data
Opensource driver atmel_mxt_ts has the platform data
structure name as atmel_maxtouch. Avoid name conflict
by renaming atmel_maxtouch driver's platform data to
maxtouch_platform_data.

Change-Id: I4bf3ed83e3eab55c4464de365c6009965da73744
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2011-11-26 23:45:35 -07:00
Bryan Huntsman
849b79e1f0 msm: trivial: 'chmod 644' for non-executable files
Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-11-22 18:44:06 -08:00
Mohan Pallaka
a9df12a301 input: atmel_maxtouch: Report BTN_TOUCH event
Report BTN_TOUCH event along with other input
events.

Change-Id: I1ba414224f978c13e24c382b5c0fd57f82f66577
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2011-11-21 10:30:24 +05:30
Linux Build Service Account
f112ecce60 Merge "input: cyttsp-i2c: Fix a few coding issues" into msm-3.0 2011-11-17 17:48:32 -08:00
Praveena Pachipulusu
0106ea69f7 input: cy8c_ts: use ABS_MT_PRESSURE to report pressure
Change-Id: I271416167fa1800bfbaf05e7269396652b2449bc
Signed-off-by: Praveena Pachipulusu <pveena@codeaurora.org>
2011-11-16 16:11:37 +05:30
Jing Lin
1c46af9fac input: cyttsp-i2c: Fix a few coding issues
Fix issues such as comparing an unsigned integer against 0 and
unnecessary NULL checking.

Change-Id: Ib70b083925229ed9ec5b940e0fb0e80e9b83c960
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2011-11-15 21:47:34 -08:00
Linux Build Service Account
42474690f7 Merge "Input: atmel_mxt_ts: Fix error handling in mxt_probe" into msm-3.0 2011-11-11 16:10:44 -08:00
Jing Lin
32c7253521 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>
2011-11-08 23:22:36 -08:00
Mohan Pallaka
07a0807c3e input: cyttsp-i2c: Move irq handler to threaded context
Change-Id: I60d038fc06c8f040cf2b69d6b65d9b8e210ff08b
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2011-11-09 11:31:57 +05:30
Linux Build Service Account
a67b6d1b5c Merge "Input: atmel_mxt_ts - Use snprintf for sysfs attribute show method" into msm-3.0 2011-11-04 20:59:40 -07:00
Anirudh Ghayal
f9929b1e29 input: cyttsp-i2c: Move regulators to LPM/HPM in suspend/resume
Change-Id: I341f33d2627dc9f3f7c511a69db8a84c4b886841
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2011-11-02 14:49:16 -06:00
Daniel Kurtz
4ef11a8fcb 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>
2011-11-02 10:52:03 -07:00
Taniya Das
6f0884bf86 input: touchscreen: Add support for synaptics clearpad3000
Change-Id: Ie00815ed507d81c6934ac0d4b1dfa745215ff01a
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2011-10-24 12:12:17 +05:30
Jing Lin
bace50b68c input: atmel_mxt_ts: Move regulators to LPM/HPM in suspend/resume
Change-Id: I75900b242a628a3ab024e8489273c4cad185c52b
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
2011-10-21 11:46:20 -07:00
Jing Lin
36aee816a0 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>
2011-10-21 11:46:20 -07:00
Jing Lin
2f863174f9 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>
2011-10-21 11:46:20 -07:00
Amy Maloche
2b59bab63c input: atmel_mxt_ts: remove mt protocol b capability
Change-Id: I3bbb94ff1b2380c85bc960ec79d6c7fcc791cf1f
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
2011-10-18 15:05:39 -06:00
Amy Maloche
f0d7b8d83b 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>
2011-10-17 14:20:29 -07:00