summaryrefslogtreecommitdiff
path: root/driver/touchpad_elan.c
Commit message (Collapse)AuthorAgeFilesLines
* task_set_event: remove the wait argumentDawid Niedzwiecki2020-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | There is an option in the task_set_event function which force the calling task to wait for an event. However, the option is never used thus remove it. This also will help in the Zephyr migration process. BUG=b:172360521 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* touchpad_elan: add support for CoachZ touchpadTing Shen2020-11-181-34/+113
| | | | | | | | | | | | | | | | Port probe / update logic from linux driver code (drivers/input/mouse/elan_i2c_i2c.c), and support different page size. BUG=b:169651794 TEST=flash fw successfully on Zed. BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I2aa7316219d235e28e446de13b0d24fe3c6dac15 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2537415 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* ec: change usage of "sane" per inclusive languagePaul Fagerburg2020-07-221-1/+1
| | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the terms "sane", "sanity check", and similar with inclusive/non-stigmatizing alternatives. BUG=b:161832469 BRANCH=None TEST=`make buildall -j` succeeds. `grep -Eir "sane|sanity" .` shows results only in third-party code or documentation. Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Change-Id: I29e78ab27f84f17b1ded75cfa10868fa4e5ae88c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2311169 Reviewed-by: Jett Rink <jettrink@chromium.org>
* board/hammer: Fix masterball touchpad settingsNicolas Boichat2019-10-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the dimensions, and also the size, and make sure that updating the FW actually works (it seems like increasing the timeout to 2000ms is needed). BRANCH=kukui BUG=b:140596094 TEST=Flash masterball, no warning in console on start TEST= Host: make TOUCHPAD_FW=S8648A-15H0_FW01.bin BOARD=masterball -j USE=updater_utils emerge-kukui -av ec-utils cros deploy $IP ec-utils DUT: usb_updater2 -d 18d1:503c -r; sleep 0.5; \ usb_updater2 -d 18d1:503c -s; usb_updater2 -d 18d1:503c ec.bin usb_updater2 -d 18d1:503c -p S8648A-15H0_FW01.bin Change-Id: Ia473ac420b42f52ad1639f950a3f08ff5d32df09 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1847512 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* touchpad_elan: Add missing tablet_mode.h includeNicolas Boichat2019-08-071-0/+1
| | | | | | | | | | | BRANCH=none BUG=b:138968914 TEST=make buildall -j Change-Id: Ia753d1a089a326eb15a28528f0ff0cfa320b4e1d Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741588 Reviewed-by: Yilun Lin <yllin@chromium.org>
* Remove __7b, __8b and __7bfDenis Brockus2019-07-201-12/+12
| | | | | | | | | | | | | | | | | | | The extentions were added to make the compiler perform most of the verification that the conversion was being done correctly to remove 8bit addressing as the standard I2C/SPI address type. Now that the compiler has verified the code, the extra extentions are being removed BUG=chromium:971296 BRANCH=none TEST=make buildall -j TEST=verify sensor functionality on arcada_ish Change-Id: I36894f8bb9daefb5b31b5e91577708f6f9af2a4f Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704792 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Use 7bit I2C/SPI slave addresses in ECDenis Brockus2019-07-191-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt for 7bit slave addresses in EC code. If 8bit is expected by a driver, make it local and show this in the naming. Use __7b, __7bf and __8b as name extensions for i2c/spi addresses used in the EC codebase. __7b indicates a 7bit address by itself. __7bf indicates a 7bit address with optional flags attached. __8b indicates a 8bit address by itself. Allow space for 10bit addresses, even though this is not currently being used by any of our attached devices. These extensions are for verification purposes only and will be removed in the last pass of this ticket. I want to make sure the variable names reflect the type to help eliminate future 7/8/7-flags confusion. BUG=chromium:971296 BRANCH=none TEST=make buildall -j Change-Id: I2fc3d1b52ce76184492b2aaff3060f486ca45f45 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1699893 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tasks: convert TASK_EVENT_CUSTOM macro to bitJett Rink2019-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | We should ensure that all custom task definition are non-zero and fit with the globally defined events. Add compile time check and change semantics to specify bit number (instead of making all callers use the BIT macro). This also fixes an error with TASK_EVENT_PHY_TX_DONE for ITE being 0. The bug that made that happen hasn't landed on any firmware branches that use it though. BRANCH=none BUG=none TEST=builds Cq-Depend:chrome-internal:1178968,chrome-internal:1178952 Change-Id: I5e1d1312382d200280c548e9128e53f4eddd3e61 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1570607 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* common: replace 1 << digits, with BIT(digits)Gwendal Grignou2019-03-261-3/+3
| | | | | | | | | | | | | | | | Requested for linux integration, use BIT instead of 1 << First step replace bit operation with operand containing only digits. Fix an error in motion_lid try to set bit 31 of a signed integer. BUG=None BRANCH=None TEST=compile Change-Id: Ie843611f2f68e241f0f40d4067f7ade726951d29 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1518659 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* usb_hid_touchpad: set confidence bit on finger leaveWei-Han Chen2018-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | When finger is leaving, the confidence should be '1', since it is not a plam. Some background: Since CL:617811, Linux kernel treats a finger whose confidence equal to 0 as a "palm", and override its width and height with max value. Therefore, when we are reporting a finger leaving event, if the confidence is 0, the finger will quickly become a fat finger (max width and heigh, locates at top-left corner), and then leave. This will confuse gesture library, and might cause unintended behaviors. BRANCH=nocturne BUG=b:116321493 TEST=manually on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I30be0e5efeb6c2215795565dce8c2da23892939f Reviewed-on: https://chromium-review.googlesource.com/1250584 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
* whiskers: Disable keyboard scanning and touchpad in tablet modeNicolas Boichat2018-09-031-17/+40
| | | | | | | | | | | | | | | | | | | | When in tablet mode, disable keyboard scanning and touchpad. Refactor touchpad_*.c power management to take both into account (there is some duplicated code here, that we may want to merge in the future). This will also prevent magic keyboard from working, but we are ok with this, at least for now. BRANCH=none BUG=b:73133611 TEST=In tablet mode, keyboard scanning and touchpad are both disabled. Change-Id: I51b7c50b90cca9b9f574c5c611daa89fe8a480bb Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1180639 Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Wei-Han Chen <stimim@chromium.org>
* stm32: usb_hid_touchpad: add confidenceWei-Han Chen2018-08-311-0/+1
| | | | | | | | | | | | | | | | `confidence` is expected from a PTP-compliant touchpad BRANCH=none BUG=b:70482333 TEST=manual Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: Ibe7166f43cae5fb36bbcc4e6dfd9ae6525a7225e Reviewed-on: https://chromium-review.googlesource.com/1188170 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* touchpad_elan: Fix the trace number accessing for width/hight propertyKT Liao2018-08-211-2/+2
| | | | | | | | | | | | | | | | | | | Base on Elan I2C driver and Elan touchpad spec, the x trace number of touching object is in the low nibble of byte. And y trace number is in the high nibble. This is a minor bug and difficult to find in operation. I fix the byte accessing to make it right in palm detection Signed-off-by: KT Liao <kt.liao@emc.com.tw> BRANCH=poppy BUG=None TEST=Test hammer in EVTEST and check MAJOR/MINOR Change-Id: I83e5e1f224eaf815914e7001234cdc1b1af22660 Reviewed-on: https://chromium-review.googlesource.com/659478 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* i2c: Split i2c_xfer into locked/unlocked versions.Jonathan Brandmeyer2018-08-161-28/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename i2c_xfer to i2c_xfer_unlocked. Audit all users of i2c_xfer to see if they can use simple locking semantics or require their own locking. Since locked accesses are only safe for I2C_XFER_SINGLE transactions, remove the flags parameter from i2c_xfer. This also makes the audit a bit easier. Some remaining applications hold the bus locked across several transactions that would otherwise be atomic, and a few others implement complex I2C transactions in multiple commands. Add a (nondeterministic) verification on the I2C port locking correctness. This will catch all statically incorrect locking patterns, although dynamically incorrect locking patterns may not be caught. Related: Revise the i2c_port_active_count to be a bitmap of the active ports instead of a count of the active ports. The EC's mutex does not provide an is_locked() primitive, and we would prefer not to have one. - board/glados: Custom locking for battery reset - board/mchpevb1: Custom locking for battery reset - board/oak: Custom locking for battery reset - board/samus: Custom locking for lightbar reset - board/sweetberry: simple locking - board/servo_micro: Custom locking for funky i2c transfers - capsense: simple locking - host_command_master: multi-command transactions - lb_common: manual locking to support samus power sequence - smbus: multi-command transactions - usb_i2c: simple locking - driver/tcpm/fusb302: simple locking and multi-command transactions - driver/tcpm/tcpi: Forward _unlocked and implicitly locked interface to fusb302 - driver/touchpad_elan: simple locking BUG=chromium:871851 BRANCH=none TEST=buildall; very careful audit TEST=grunt clamshell and Coral clamshell, test boot, battery charging, PD communication, and TCPC port low-power mode. Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Change-Id: Ieabf22bcab42780bdb994fca3ced5d8c62519d56 Reviewed-on: https://chromium-review.googlesource.com/1169913 Commit-Ready: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* touchpad_elan: Ensure we at least have 1k of shared memoryNicolas Boichat2018-05-241-0/+3
| | | | | | | | | | | | | Debugging commands may request buffers up to that size. BRANCH=poppy BUG=b:63993891 TEST=make buildall -j Change-Id: I6dedfafc4e36d311026f9678e2cac99c85036ce0 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1071311 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* touchpad_elan: Reload watchdog when programmingNicolas Boichat2018-05-241-0/+2
| | | | | | | | | | | | | | | | | | When using larger block sizes (e.g. 4096 bytes), the write operations take too long, which often causes a watchdog reset. Fix this by reloading the watchdog after programming every 64 bytes page. BRANCH=poppy BUG=b:80167548 TEST=Copy old touchpad FW to soraka, build staff, make sure FW can be updated. Change-Id: Ic6e7a3e3ef63877a4f2d5011e1fb0d49c04177a6 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1070952 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* touchpad_elan: Power off when USB is suspended without wakeNicolas Boichat2018-02-051-2/+61
| | | | | | | | | | | | | | | | touchpad can be powered off when the USB interface is disabled without setting the remote wake feature (USB_REQ_FEATURE_DEVICE_REMOTE_WAKEUP), as events would be ignored anyway. BRANCH=none BUG=b:72683995 TEST=touchpad is disabled when lid is closed. Change-Id: I688fce16ab8c75330e588ec130fb2aa499fc0ed1 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/897069 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* touchpad_elan: Add retry logic if the touchpad does not respondNicolas Boichat2018-01-211-2/+33
| | | | | | | | | | | | | | | After 3 tries, the touchpad is reset by power-cycling it. BRANCH=none BUG=b:71688150 TEST=Short SDA/SCL lines, press on touchpad, see that touchpad tasks retries transaction, and then resets the touchpad power. TEST=Do ESD discharge, and see that touchpad always recovers. Change-Id: If0b5eb936d4d2feb3d34a7ec8748869a1b915c34 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/872131 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* touchpad_elan: Add support for debugging modeNicolas Boichat2017-12-141-2/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We add 2 hashes that each map to a list of allowed commands (command list is secret, and provided by Elan). UPDATE_EXTRA_CMD_TOUCHPAD_DEBUG on the USB interface have the following format for the parameter: - param[0]: must be 0xff - param[1]: offset of the I2C command in data - param[2]: command length - param[3-4]: read-back length (MSB first) over I2C, can be 0 - param[5-49]: data, is verified using SHA-256 hash. The I2C command pointed at by param[1-2] is then sent over I2C, and the data is read back into a shared buffer of size param[3-4]. The data can be fetched over USB by a single byte USB update touchpad debug command (indicating an offset in 64-bytes unit), fetching data from the shared buffer in blocks of 64 bytes. BRANCH=none BUG=b:63993891 TEST=Elan can run debugging commands using their proprietary tool. Change-Id: Idb19bcb940b7f030c3b3aeaf39d6b725fcb9ef34 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/763576 Reviewed-by: Chun-ta Lin <itspeter@chromium.org>
* touchpad_elan: Rename task/interrupts functionsNicolas Boichat2017-11-201-3/+3
| | | | | | | | | | | | | | | | | | Change the names to generic touchpad_* functions, instead of vendor-specific names. Makes it a little easier to add drivers for other touchpads. Also fix console_channel.inc to add the channel whenever any touchpad is used. BRANCH=none BUG=b:68934906 TEST=make buildall -j Change-Id: I6d268db5ebd53db272fb2ee7bbf06bbe80845734 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/778750 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* usb_update: Add support for touchpad debugging featureNicolas Boichat2017-11-141-0/+7
| | | | | | | | | | | | | | | | We support touchpad-specific debugging feature over the USB update protocol. This will be used to fetch raw data from the sensor, without requiring to remove the write-protect screw. BRANCH=none BUG=b:63993891 TEST=./usb_updater2 -g 00 -d 18d1:502b Change-Id: I46dfd97aaa17b73a5893fe1e8c62327a302f829b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/763574 Reviewed-by: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* hammer: Support different IC types in touchpad FW updateChun-Ta Lin2017-09-141-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | Some Elan touchpad ICs have a different firmware sizes (48, 56, or 64 KB). We use CONFIG_TOUCHPAD_VIRTUAL_SIZE, set in the board file, to determine the appropriate size, and, at runtime, we sanity check the firmware size according to the IC type reported by the touchpad. BRANCH=none BUG=b:65188846 TEST=Manually modify the CONFIG_TOUCHPAD_VIRTUAL_SIZE in hammer, executed and verified both (1) "EC_ERROR_UNKNOWN" returned (2) ic_type shows 0x09 on EC console TEST=Successfully flashing 48k firmware using CL:658920 on hammer and 56k firmware on staff. With success here, we specifically test with different firmware version and make sure it reflected in hammerd's touchpad info. Change-Id: Ib30917d8376d4a2e8b6137daabad2341ac48d1f8 Signed-off-by: Chun-Ta Lin <itspeter@google.com> Reviewed-on: https://chromium-review.googlesource.com/664937 Commit-Ready: Chun-ta Lin <itspeter@chromium.org> Tested-by: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* driver/touchpad_elan: Add support for FW updatingChun-Ta Lin2017-09-121-5/+157
| | | | | | | | | | | | | | | | | Provides touchpad_update_write functions that fw_update.c uses to update the FW over the USB updater interface. BRANCH=none BUG=b:63993173, b:65188846 TEST=./usb_updater2 -t touchpad.bin CQ-DEPEND=CL:593373 Change-Id: I5246cbfa65311cd6f0b1872f9bbc164f3a972153 Signed-off-by: Chun-Ta Lin <itspeter@google.com> Reviewed-on: https://chromium-review.googlesource.com/601814 Commit-Ready: Chun-ta Lin <itspeter@chromium.org> Tested-by: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* touchpad_elan: Discard zero finger clicksNicolas Boichat2017-09-011-7/+11
| | | | | | | | | | | | | Do not report click events when no finger is present on the touchpad. BRANCH=none BUG=b:65098167 TEST=Bend case, hear click, but no event reported in evtest. Change-Id: I0385213102dab0775e1b6906cb3a45933deac757 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/637288 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* usb_hid_touchpad: Add timestamp field to touch eventsNicolas Boichat2017-08-161-0/+14
| | | | | | | | | | | | | | | | | | | | | | We use the unofficial, Windows 8, Relative Scan time HID usage (Digitizer page, 0x56) to add timestamps to our HID touchpad events. The timestamps is a rolling, unsigned, 16-bit integer, with a resolution of 100us (so it wraps around every 6.5s). The host will be able to synchronize to that timestamp, resetting an offset every time the touchpad is quiet a certain amount of time (e.g. 1 second). BRANCH=none BUG=b:63685117 TEST=Flash hammer, timestamps are reported in HID descriptor. Change-Id: Ie5d56a9df14e464d2cdcd559f550d6e3cc81961f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/603041 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Fix inconsistent task function declarationsStefan Reinauer2017-08-081-1/+1
| | | | | | | | | | | | | | | Tasks are defined inconsistently across the code base. Signed-off-by: Stefan Reinauer <reinauer@google.com> BRANCH=none TEST=make buildall -j, also verify kevin boots to OS BUG=none Change-Id: I19a076395a9a8ee1e457e67a89d80d2f70277c97 Reviewed-on: https://chromium-review.googlesource.com/602739 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* usb_update: Add a way to fetch touchpad informationNicolas Boichat2017-08-031-0/+35
| | | | | | | | | | | | | | | | | | | | | We'd like to know touchpad vendor/product id, as well as currently running FW version. This CL does that by adding a new UPDATE_EXTRA_CMD_TOUCHPAD_INFO command. We also make the interface more generic by adding a CONFIG_TOUCHPAD configuration option, even though we only support Elan touchpads currently. BRANCH=none BUG=b:63418037 TEST=Flash hammer, ./usb_updater -t Change-Id: Icce3c785eb3235bcc50b2ae7c0227ce11cbc9f2b Signed-off-by: Nicolas Boichat <drinkcat@google.com> Reviewed-on: https://chromium-review.googlesource.com/593000 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Chun-ta Lin <itspeter@chromium.org>
* chip/stm32/usb_hid_touchpad: Widen pressure field to 10 bitsNicolas Boichat2017-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | id only really needs 4 bits (16 touch events should be more than enough), so we can steal 2 bits from that field. We also reorder the fields to make sure that width/x are aligned on 8-bit boundary. BRANCH=none BUG=b:63936194 TEST=Flash hammer, touchpad works, ABS_PRESSURE > 255 is reported when a palm is pressed on the touchpad. Change-Id: I1abf1bf53cc9dd998082cea5dc7cd3be17f99ec6 Reviewed-on: https://chromium-review.googlesource.com/583297 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: KT Liao <kt.liao@emc.com.tw>
* touchpad_elan: Read resolution and validate against build-time valuesNicolas Boichat2017-05-181-2/+27
| | | | | | | | | | | | | | | | | At init time, read resolution/dpi from trackpad, and check that logical/physical dimensions match the expected values, provided at build-time. BRANCH=none BUG=b:38277869 TEST=Flash staff, no error message at boot time. Flash hammer image onto staff, a warning is shown at boot time. Change-Id: I5ef7d25b6e6525c2bd6fc023f58f3a242134d962 Reviewed-on: https://chromium-review.googlesource.com/505857 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* driver/touchpad_elan: Use slightly more precise pressure adjustmentNicolas Boichat2017-03-081-3/+6
| | | | | | | | | | | | | | | | Matches the pressure multiplier used with elan trackpad on Chrome OS (3.1416). We do fixed point arithmetic to avoid the need for floating point or non-power of 2 division. BRANCH=none BUG=chrome-os-partner:59083 TEST=make BOARD=hammer -j && util/flash_ec --board=hammer Change-Id: Ic3daad2645839955734eb7cbd9a60bbdf2520ce8 Reviewed-on: https://chromium-review.googlesource.com/450994 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* driver/touchpad_elan: Report events to USB HID touchpadNicolas Boichat2016-11-221-24/+47
| | | | | | | | | | | | | | Pass reported events to the USB HID touchpad driver. BRANCH=none BUG=chrome-os-partner:59083 TEST=make BOARD=hammer -j && util/flash_ec --board=hammer Change-Id: I234be1a1db8526e615acdd13c5d4dae40be5bdff Reviewed-on: https://chromium-review.googlesource.com/410960 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* driver/touchpad_elan: Basic elan touchpad driverNicolas Boichat2016-11-081-0/+245
BRANCH=none BUG=chrome-os-partner:59083 TEST=make BOARD=hammer -j && bash flash_hammer Change-Id: I0ff4f48ff1399e054f745ac13ffacf81dffedeab Reviewed-on: https://chromium-review.googlesource.com/407740 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>