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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Support mxt224E controller which requires both digital and analog
regulator power.
Change-Id: I2717fd26b4790cf1b6160f09e71611537b47ea3c
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
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>
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>
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>
Report BTN_TOUCH event along with other input
events.
Change-Id: I1ba414224f978c13e24c382b5c0fd57f82f66577
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
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>
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>
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>
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>
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>