summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/atmel_mxt_ts.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Input: atmel_mxt_ts - initialise IRQ before probingNick Dyer2014-07-231-39/+62
| | | | | | | | | | | | | | | | | The maXTouch chips use the CHG line to generate status events in bootloader mode, and during configuration download, before there is enough information to configure the input device. Therefore set up the interrupt handler earlier. However, this introduces states where parts of the interrupt processing must not run. Use data->object_table as a way to tell whether the chip information is valid, and data->input_dev as a way to tell whether it is valid to generate input report. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - fix invalid return from mxt_get_bootloader_versionNick Dyer2014-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch e57a66aa8534: "Input: atmel_mxt_ts - read and report bootloader version" from May 18, 2014, leads to the following static checker warning: drivers/input/touchscreen/atmel_mxt_ts.c:437 mxt_get_bootloader_version() warn: signedness bug returning '(-5)' drivers/input/touchscreen/atmel_mxt_ts.c 429 static u8 mxt_get_bootloader_version(struct mxt_data *data, u8 val) 430 { 431 struct device *dev = &data->client->dev; 432 u8 buf[3]; 433 434 if (val & MXT_BOOT_EXTENDED_ID) { 435 if (mxt_bootloader_read(data, &buf[0], 3) != 0) { 436 dev_err(dev, "%s: i2c failure\n", __func__); 437 return -EIO; ^^^^ This gets truncated into a number from 0-255 and anyway the caller doesn't check for errors. (reported by Dan Carpenter) Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - handle multiple input reports in one messageNick Dyer2014-05-261-8/+28
| | | | | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - rename touchscreen defines to include T9Nick Dyer2014-05-261-23/+23
| | | | | | | | | This avoids confusion with the newer T100 touchscreen object. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - rename pressure to amplitude to match specNick Dyer2014-05-261-4/+4
| | | | | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - read screen config from chipNick Dyer2014-05-261-71/+65
| | | | | | | | | | | | | | By reading the touchscreen configuration from the settings that the maXTouch chip is actually using, we can remove some platform data. The matrix size is not used for anything, and results in some rather confusing code to re-read it because it may change when configuration is downloaded, so don't print it out. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - add check for incorrect firmware file formatNick Dyer2014-05-181-0/+29
| | | | | | | | | | | | Atmel supplies firmware files in ASCII HEX format (.enc) which must be converted before they can be loaded by kernel driver. Try to detect the error and print a friendly error message rather than feeding junk to the bootloader. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - improve bootloader progress outputNick Dyer2014-05-181-1/+7
| | | | | | | | | | By implementing a frame counter, print out fewer debug messages (the firmware may contain hundreds of frames). Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - implement bootloader frame retriesNick Dyer2014-05-181-7/+20
| | | | | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - read and report bootloader versionNick Dyer2014-05-181-0/+26
| | | | | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - add additional bootloader addressesNick Dyer2014-05-181-45/+93
| | | | | | | | | | | Move bootloaders reads/writes into separate functions. Instead of switching client->addr, define new field bootloader_addr in mxt_data. Implement lookup calculation for bootloader addresses. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - implement CRC check for configuration dataNick Dyer2014-05-181-8/+52
| | | | | | | | | | | | The configuration is stored in NVRAM on the maXTouch chip. When the device is reset it reports a CRC of the stored configuration values. Therefore it isn't necessary to send the configuration on each probe - we can check the CRC matches and avoid a timeconsuming backup/reset cycle. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - improve error reporting and debugNick Dyer2014-05-181-10/+23
| | | | | | | | | | | - Add error messages for probe errors - Report type in invalid object type - Tweak some other debug output messages Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - make wait-after-reset period compatible with all chipsIiro Valkonen2014-05-181-22/+87
| | | | | | | | | | | The delay before the chip can be accessed after reset varies between different chips in maXTouch family. Waiting for an interrupt and a T6 status message with the RESET bit set is a better behaviour. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - wait for CHG after bootloader resetsBenson Leung2014-05-181-7/+15
| | | | | | | | | | | | | | | | | | | | | | | Rather than msleep for MXT_RESET_TIME and MXT_FWRESET_TIME during the transition to bootloader mode and the transition back from app, wait for the CHG assert to indicate that the transition is done. This change replaces the msleep with a wait for completion that the mxt_interrupt handler signals. Also add CHG poll after last firmware frame - some bootloader versions will assert the interrupt line after the final frame, in testing this meant that the driver attempts to read the info block too early whilst the chip is still resetting. This improves firmware update time as we no longer wait longer than necessary for each reset. Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - wait for CHG assert in mxt_check_bootloaderBenson Leung2014-05-181-21/+81
| | | | | | | | | | | | | | | The driver should not immediately read bootloader status when in Application Update Mode. The CHG line will assert when the device has made a state transition and is ready to report a new status via i2c. This change adds a wait for completion in mxt_check_bootloader, and changes the mxt_interrupt handler to signal the completion. Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - define helper functions for size and instancesDaniel Kurtz2014-05-181-12/+25
| | | | | | | | | | | | | | | These two object table entry fields are reported 1 less than their value. When used, however, we always want the actual size and instances. To keep the object size and instances 1-byte fields, and thus preserve the object-table struct's 6-byte packed alignment, add some convenient accessor functions that do the +1 every time these fields are accessed. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - return IRQ_NONE when interrupt handler failsNick Dyer2014-05-181-2/+1
| | | | | | | Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - improve T19 GPIO keys handlingNick Dyer2014-05-181-27/+17
| | | | | | | | | | | | | | | | | | * The mapping of the GPIO numbers into the T19 status byte varies between different maXTouch chips. Some have up to 7 GPIOs. Allowing a keycode array of up to 8 items is simpler and more generic. So replace #define with configurable number of keys which also allows the removal of is_tp. * Rename platform data parameters to include "t19" to prevent confusion with T15 key array. * Probe aborts early on when pdata is NULL, so no need to check. * Move "int i" to beginning of function (mixed declarations and code) * Use API calls rather than __set_bit() * Remove unused dev variable. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Yufeng Shen <miletus@chromium.org> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: atmel_mxt_ts - remove unnecessary platform dataNick Dyer2014-05-181-50/+0
| | | | | | | | | | | | | | | | | | | | It is not necessary to download these values to the maXTouch chip on every probe, since they are stored in NVRAM. It makes life difficult when tuning the device to keep them in sync with the config array/file, and requires a new kernel build for minor tweaks. These parameters only represent a tiny subset of the available configuration options, tracking all of these options in platform data would be a endless task. In addition, different versions of maXTouch chips may have these values in different places or may not even have them at all. Having these values also makes life more complex for device tree and other platforms where having to define a static configuration isn't helpful. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: delete non-required instances of include <linux/init.h>Paul Gortmaker2014-01-061-1/+0
| | | | | | | | | | None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: use dev_get_platdata()Jingoo Han2013-12-061-1/+1
| | | | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Atmel MXT touchscreen: increase reset timeoutsLinus Torvalds2013-03-091-2/+2
| | | | | | | | | | | | | There is a more complete atmel patch-series out by Nick Dyer that fixes this and other things, but in the meantime this is the minimal thing to get the touchscreen going on (at least my) Pixel Chromebook. Not that I want my dirty fingers near that beautiful screen, but it seems that a non-initialized touchscreen will also end up being a constant wakeup source, so you have to disable it to go to sleep. And it's easier to just fix the initialization sequence. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Input: atmel_mxt_ts - Support for touchpad variantDaniel Kurtz2013-03-081-2/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | This same driver can be used by atmel based touchscreens and touchpads (buttonpads). Platform data may specify a device is a touchpad using the is_tp flag. This will cause the driver to perform some touchpad specific initializations, such as: * register input device name "Atmel maXTouch Touchpad" instead of Touchscreen. * register BTN_LEFT & BTN_TOOL_* event types. * register axis resolution (as a fixed constant, for now) * register BUTTONPAD property * process GPIO buttons using reportid T19 Input event GPIO mapping is done by the platform data key_map array. key_map[x] should contain the KEY or BTN code to send when processing GPIOx from T19. To specify a GPIO as not an input source, populate with KEY_RESERVED, or 0. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Tested-by: Olof Johansson <olof@lixom.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Input: remove use of __devexitBill Pemberton2012-11-241-1/+1
| | | | | | | | | 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>
* Input: remove use of __devinitBill Pemberton2012-11-241-1/+1
| | | | | | | | | | 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>
* Input: remove use of __devexit_pBill Pemberton2012-11-241-1/+1
| | | | | | | | | 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>
* Input: atmel_mxt_ts - simplify mxt_dump_messageAndy Shevchenko2012-10-041-4/+2
| | | | | | | Use %*ph format specifier to print small buffer. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: MT - Add flags to input_mt_init_slots()Henrik Rydberg2012-09-191-1/+1
| | | | | | | | | | Preparing to move more repeated code into the mt core, add a flags argument to the input_mt_slots_init() function. Reviewed-and-tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Tested-by: Ping Cheng <pingc@wacom.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Pull input changes from Henrik Rydberg, including large update toDmitry Torokhov2012-07-071-222/+241
|\ | | | | | | | | | | | | atmel_mxt_ts driver by Daniel and MT protocol addition for win8 devices. Conflicts: drivers/input/touchscreen/atmel_mxt_ts.c
| * Revert "Input: atmel_mxt_ts - warn if sysfs could not be created"Henrik Rydberg2012-07-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Dmitry: I understand that I am a bit late to the party :) but I do not agree with this change. Failure to create attributes is not sometihng that user could cause (at least not easily) and thus would not be a setup issue but something more severe. I believe we should fail loading the driver so sysfs attribute breakage will be noticed as soon as possible, instead of discovering it much much later in the process. This reverts commit 639900380062ecd78ee8b265ea23929c565469b4. Requested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - parse T6 reportsDaniel Kurtz2012-06-291-4/+19
| | | | | | | | | | | | | | | | | | | | | | The normal messages sent after boot or NVRAM update are T6 reports, containing a status, and the config memory checksum. Parse them and dump a useful info message. This patch tested on an MXT224E. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - send all MT-B slots in one input reportDaniel Kurtz2012-06-291-5/+10
| | | | | | | | | | | | | | | | | | | | | | Each interrupt contains information for all contacts with changing properties. Process all of this information at once, and send it all in a a single input report (ie input events ending in EV_SYN/SYN_REPORT). This patch was tested using an MXT224E. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - use T9 reportid range to init number of mt slotsDaniel Kurtz2012-06-291-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Atmel mxt devices can report one finger for each T9 reportid. Therefore, this range can be used to report the max number of MT-B slots to userspace instead of assuming a fixed 10. Note that mxt_initialized() must complete early, since the input_dev properties now depend on values in the object table. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - refactor reportid checking in mxt_interruptDaniel Kurtz2012-06-291-6/+8
| | | | | | | | | | | | | | | | This small refactor is in preparation for checking more report types in the mxt_interrupt message processing loop. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - cache T9 reportid range when reading object tableDaniel Kurtz2012-06-291-35/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Streamline interrupt processing by caching the T9 reportid range when first reading the object table. In the process, refactor reading the object descriptor table. First, since the object_table entries are now exactly the same layout in device memory and in the driver, allocate an appropriately sized array and fetch the entire table directly into it in a single i2c transaction. Since a 6 byte table object requires 10 bytes to read, doing this dramatically reduces overhead. Note: The cached T9 reportid's are initialized to 0, which is an invalid reportid. Thus, the checks in the interrupt handler will always fail for devices that do not support the T9 object. Therefore, after doing a firmware update, the old object table is destroyed and all cached object values are reset to 0, before reading the new object table, in case the new firmware does not have the old objects. This patch tested on an MXT224E. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - refactor when and how object table is freedDaniel Kurtz2012-06-291-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Object Table is freed in three cases: 1) When the driver is being removed. 2) In the error path of mxt_initialize(). 3) Just after a firmware update, when a new object table is about to be read. For cases 2 & 3, the driver is not immediately unloaded, so this patch refactors these cases to use a common cleanup function. It also refactors the mxt_initialize error paths to ensure that this cleanup happens. Note: mxt_update_fw_store() does not handle errors during mxt_initialize(). A proposed fix for this is in a subsequent patchset. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - add detail to touchevent debug messageDaniel Kurtz2012-06-291-3/+14
| | | | | | | | | | | | | | | | | | | | Update the debug message: * print inidividual status bits * print the pressure value * use '%u' for unsigned quantities Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - simplify event reportingDaniel Kurtz2012-06-291-76/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of carrying around per-finger state in the driver instance, just report each finger as it arrives to the input layer, and let the input layer (evdev) hold the event state (which it does anyway). Note: this driver does not really do MT-B properly. Each input report (a group of input events followed by a SYN_REPORT) only contains data for a single contact. When multiple fingers are present on a device, each is properly reported in its own MT_SLOT. However, there is only ever one MT_SLOT per SYN_REPORT. This is fixed in a subsequent patch. This patch was tested with an mXT224E. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - add sysfs entries to read fw and hw versionDaniel Kurtz2012-06-291-0/+24
| | | | | | | | | | | | | | | | | | | | Make firmware and hardware version strings available to userspace. This is useful, for example, to allow a userspace program to implement a firwmare update policy. Change-Id: I1eddb4bbf5f3f9ae6947a8528598973ddead18cf Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - update driver ID info loggingDaniel Kurtz2012-06-291-4/+4
| | | | | | | | | | | | | | | | | | Print unsigned values as '%u'. Also, parse and print the firmware version in its canonical format, as suggested by Nick Dyer. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - read ID information block in one i2c transactionDaniel Kurtz2012-06-291-23/+3
| | | | | | | | | | | | | | | | Reading the whole info block in one i2c transaction speeds up driver probe significantly, especially on slower i2c busses. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - optimize writing of object table entriesDaniel Kurtz2012-06-291-12/+12
| | | | | | | | | | | | | | | | Write each object using a single bulk i2c write transfer. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - add variable length __mxt_write_regDaniel Kurtz2012-06-291-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The i2c bus requires 4 bytes to do a 1-byte write (1 byte i2c address + 2 byte offset + 1 byte data). By taking a length with writes, the driver can amortize transaction overhead by performing larger transactions where appropriate. This patch just sets up the new API. Later patches refactor writes to take advantage of the larger transactions. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - return errors from i2c layerDaniel Kurtz2012-06-291-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | The i2c layer can report a variety of errors, including -ENXIO for an i2c NAK. Instead of treating them all as -EIO, pass the actual i2c layer error up to the caller. However, still report as -EIO the unlikely case that a transaction was partially completed, and no error message was returned from i2c_*(). Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - print all instances when dumping objectsDaniel Kurtz2012-06-291-10/+26
| | | | | | | | | | | | | | | | | | For objects with multiple instances, dump them all, prepending each with its "Instance #". [rydberg@euromail.se: break out mxt_show_instance()] Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - print less overhead when dumping objectsDaniel Kurtz2012-06-291-8/+4
| | | | | | | | | | | | | | | | | | Conserve limited (PAGE_SIZE) sysfs output buffer space by only showing readable objects and not printing the object's index, which is not useful to userspace. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - optimize reading objects in object sysfs entryDaniel Kurtz2012-06-291-20/+15
| | | | | | | | | | | | | | Read each object in a single i2c transaction instead of byte-by-byte Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - use scnprintf for object sysfs entryDaniel Kurtz2012-06-291-12/+4
| | | | | | | | | | | | | | | | Using scnprintf() is a cleaner way to ensure that we don't overwrite the PAGE_SIZE sysfs output buffer. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
| * Input: atmel_mxt_ts - don't read T5 when dumping objectsDaniel Kurtz2012-06-291-1/+0
| | | | | | | | | | | | | | | | | | | | T5 is the message processor object. Reading it will only have two outcomes, neither of which is particularly useful: 1) the message count decrements, and a valid message will be lost 2) an invalid message will be read (reportid == 0xff) Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>