aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/elan_i2c_core.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-06-30Input: elan_i2c - export the device id whitelistJeffrey Hugo1-49/+1
Elan_i2c and hid-quirks work in conjunction to decide which devices each driver will handle. Elan_i2c has a whitelist of devices that should be consumed by hid-quirks so that there is one master list of devices to handoff between the drivers. Put the ids in a header file so that hid-quirks can consume it instead of duplicating the list. Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-05-27Input: elan_i2c - handle physical middle buttonBenjamin Tissoires1-4/+12
Some models have a middle button, we should export it as well. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-05-27Input: elan_i2c - do not query the info if they are providedBenjamin Tissoires1-12/+44
See the previous patch for a long explanation. TL;DR: the P52 and the t480s from Lenovo can't rely on I2C to fetch the information, so we need it from PS/2. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-05-15Input: elan_i2c - increment wakeup count if wake sourceRavi Chandra Sadineni1-0/+2
Notify the PM core that this device is the wake source. This helps userspace daemon tracking the wake sources to identify the origin of the wake. Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-03-26Input: elan_i2c - add hardware ID for multiple Lenovo laptopsKT Liao1-0/+25
There are many Lenovo laptops which need elan_i2c support, this patch adds relevant IDs to the Elan driver so that touchpads are recognized. Signed-off-by: KT Liao <kt.liao@emc.com.tw> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-03-09Input: elan_i2c - add id for touchpad found in Lenovo s21e-20Vincent Batts1-0/+1
Lenovo s21e-20 uses ELAN0601 in its ACPI tables for the Elan touchpad. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-02-16Input: elan_i2c - add ACPI ID for touchpad in Lenovo V330-15ISKMauro Ciancio1-0/+1
This adds ELAN0617 to the ACPI table to support Elan touchpad found in Lenovo V330-15ISK. Signed-off-by: Mauro Ciancio <mauro@acadeu.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-02-11Revert "Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G"Dmitry Torokhov1-1/+0
This reverts commit 7db54c89f0b30a101584e09d3729144e6170059d as it breaks Acer Aspire V-371 and other devices. According to Elan: "Acer Aspire F5-573G is MS Precision touchpad which should use hid multitouch driver. ELAN0501 should not be added in elan_i2c." Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202503 Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-12-28Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573GPatrick Dreyer1-0/+1
This adds ELAN0501 to the ACPI table to support Elan touchpad found in ASUS Aspire F5-573G. Signed-off-by: Patrick Dreyer <Patrick.Dreyer@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-12-03Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15ARRNoah Westervelt1-0/+1
Add ELAN061E to the ACPI table to support Elan touchpad found in Lenovo IdeaPad 330-15ARR. Signed-off-by: Noah Westervelt <nwestervelt@outlook.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-12-03Input: elan_i2c - add support for ELAN0621 touchpadAdam Wong1-0/+1
Added the ability to detect the ELAN0621 touchpad found in some Lenovo laptops. Signed-off-by: Adam Wong <adam@adamwong.me> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-11-12Input: elan_i2c - add ELAN0620 to the ACPI tablePatrick Gaskin1-0/+1
Add ELAN0620 to the ACPI table to support the elan touchpad in the Lenovo IdeaPad 130-15IKB. Signed-off-by: Patrick Gaskin <patrick@pgaskin.net> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-10-15Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15IGMMikhail Nikiforov1-0/+1
Add ELAN061C to the ACPI table to support Elan touchpad found in Lenovo IdeaPad 330-15IGM. Signed-off-by: Mikhail Nikiforov <jackxviichaos@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-16Input: elan_i2c - add another ACPI ID for Lenovo Ideapad 330-15ASTKT Liao1-0/+1
Add ELAN0622 to ACPI mapping table to support Elan touchpad found in Ideapad 330-15AST. Signed-off-by: KT Liao <kt.liao@emc.com.tw> Reported-by: Anant Shende <anantshende@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-04Input: elan_i2c - add ACPI ID for lenovo ideapad 330Donald Shanty III1-0/+1
This allows Elan driver to bind to the touchpad found in Lenovo Ideapad 330 series laptops. Signed-off-by: Donald Shanty III <dshanty@protonmail.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-06-21Input: elan_i2c_smbus - fix more potential stack buffer overflowsBen Hutchings1-1/+1
Commit 40f7090bb1b4 ("Input: elan_i2c_smbus - fix corrupted stack") fixed most of the functions using i2c_smbus_read_block_data() to allocate a buffer with the maximum block size. However three functions were left unchanged: * In elan_smbus_initialize(), increase the buffer size in the same way. * In elan_smbus_calibrate_result(), the buffer is provided by the caller (calibrate_store()), so introduce a bounce buffer. Also name the result buffer size. * In elan_smbus_get_report(), the buffer is provided by the caller but happens to be the right length. Add a compile-time assertion to ensure this remains the case. Cc: <stable@vger.kernel.org> # 3.19+ Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-06-21Input: elan_i2c - add ELAN0618 (Lenovo v330 15IKB) ACPI IDAlexandr Savca1-0/+1
Add ELAN0618 to the list of supported touchpads; this ID is used in Lenovo v330 15IKB devices. Signed-off-by: Alexandr Savca <alexandr.savca@saltedge.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-06-04Input: elan_i2c - add ELAN0612 (Lenovo v330 14IKB) ACPI IDJohannes Wienke1-0/+1
Add ELAN0612 to the list of supported touchpads; this ID is used in Lenovo v330 14IKB devices. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199253 Signed-off-by: Johannes Wienke <languitar@semipol.de> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-05-23Input: elan_i2c - add trackstick reportBenjamin Tissoires1-3/+85
The Elan touchpads over I2C/SMBus also can handle a trackstick. Unfortunately, nothing tells us if the device supports trackstick (the information lies in the PS/2 node), so rely on device properties to determine whether to enable the trackstick node. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1313939 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: KT Liao <kt.liao@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-02-01Merge tag 'v4.15' into nextDmitry Torokhov1-0/+1
Sync with mainline to get in trackpoint updates and other changes.
2018-01-16Input: elan_i2c - remove unneeded MODULE_VERSION() usageGreg Kroah-Hartman1-2/+0
MODULE_VERSION is useless for in-kernel drivers, so just remove all usage of it in the elan_i2c mouse driver. Now that this is gone, the ELAN_DRIVER_VERSION define was also removed as it was pointless. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-11-13Merge branch 'next' into for-linusDmitry Torokhov1-4/+7
Prepare input updates for 4.15 merge window.
2017-11-07Merge tag 'v4.14-rc8' into nextDmitry Torokhov1-0/+1
Merge with mainline to bring in SPDX markings to avoid annoying merge problems when some header files get deleted.
2017-11-07Input: elan_i2c - add ELAN060C to the ACPI tableKai-Heng Feng1-0/+1
ELAN060C touchpad uses elan_i2c as its driver. It can be found on Lenovo ideapad 320-14AST. BugLink: https://bugs.launchpad.net/bugs/1727544 Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-24Input: elan_i2c - add ELAN0611 to the ACPI tableKai-Heng Feng1-0/+1
ELAN0611 touchpad uses elan_i2c as its driver. It can be found on Lenovo ideapad 320-15IKB. So add it to ACPI table to enable the touchpad. [Ido Adiv <idoad123@gmail.com> reports that the same ACPI ID is used for Elan touchpad in ideapad 520]. BugLink: https://bugs.launchpad.net/bugs/1723736 Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-09-29Input: elan_i2c - do not clobber interrupt trigger on x86Dmitry Torokhov1-3/+7
On x86 we historically used falling edge interrupts in the driver because that's how first Chrome devices were configured. They also did not use ACPI to enumerate I2C devices (because back then there was no kernel support for that), so trigger was hard-coded in the driver. However the controller behavior is much more reliable if we use level triggers, and that is how we configured ARM devices, and how want to configure newer x86 devices as well. All newer x86 boxes have their I2C devices enumerated in ACPI. Let's see if platform code (ACPI, DT) described interrupt and specified particular trigger type, and if so, let's use it instead of always clobbering trigger with IRQF_TRIGGER_FALLING. We will still use this trigger type as a fallback if platform code left interrupt trigger unconfigured. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196761 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-09-21Input: elan_i2c - remove duplicate ELAN0605 idNik Nyby1-1/+0
ELAN0605 appears twice here. Signed-off-by: Nik Nyby <nikolas@gnu.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-09-21Merge tag 'ib-mfd-many-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into nextDmitry Torokhov1-0/+5
Merge "Immutable branch between MFD and many other subsystems due for the v4.14 merge window" to get the TWL headers moved to the right place.
2017-09-04Merge branch 'next' into for-linusDmitry Torokhov1-2/+7
Prepare input updates for 4.14 merge window.
2017-08-18Input: elan_i2c - support touchpads with two physical buttonsKT Liao1-2/+7
Elan touchpads on Asus ROG G752xx series laptops have 2 physical buttons. Luckily we can query the touchpad to see if it is a clickpad variant and adjust the behavior accordingly. Signed-off-by: KT Liao <kt.liao@emc.com.tw> Tested-by: Maxime Bellengé <maxime.bellenge@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-08-18Input: elan_i2c - add ELAN0602 ACPI ID to support Lenovo Yoga310KT Liao1-0/+1
Add ELAN0602 to the list of known ACPI IDs to enable support for ELAN touchpads found in Lenovo Yoga310. Signed-off-by: KT Liao <kt.liao@emc.com.tw> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-08-14Input: elan_i2c - Add antoher Lenovo ACPI ID for upcoming Lenovo NBKT Liao1-0/+3
Add 2 new IDs (ELAN0609 and ELAN060B) to the list of ACPI IDs that should be handled by the driver. Signed-off-by: KT Liao <kt.liao@emc.com.tw> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-08-14Input: elan_i2c - add ELAN0608 to the ACPI tableKai-Heng Feng1-0/+1
Similar to commit 722c5ac708b4f ("Input: elan_i2c - add ELAN0605 to the ACPI table"), ELAN0608 should be handled by elan_i2c. This touchpad can be found in Lenovo ideapad 320-14IKB. BugLink: https://bugs.launchpad.net/bugs/1708852 Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-05-11Input: elan_i2c - add support for fetching chip type on newer hardwareKT Liao1-8/+25
Newer Elantech hardware requires different way of fetching chip type and version data. Signed-off-by: KT Liao <kt.liao@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-05-11Input: elan_i2c - check if device is there before really probingDmitry Torokhov1-0/+7
Before trying to properly initialize the touchpad and generate bunch of errors, let's first see it there is anything at the given address. If we get error, fail silently with -ENXIO. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-10Input: elan_i2c - add ASUS EeeBook X205TA special touchpad fwMatjaz Hegedic1-9/+11
EeeBook X205TA is yet another ASUS device with a special touchpad firmware that needs to be accounted for during initialization, or else the touchpad will go into an invalid state upon suspend/resume. Adding the appropriate ic_type and product_id check fixes the problem. Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com> Acked-by: KT Liao <kt.liao@emc.com.tw> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-02-20Merge branch 'next' into for-linusDmitry Torokhov1-28/+18
Prepare input updates for 4.11 merge window.
2017-02-12Input: elan_i2c - add ELAN0605 to the ACPI tableIHARA Hiroka1-0/+1
ELAN0605 has been confirmed to be a variant of ELAN0600, which is blacklisted in the hid-core to be managed by elan_i2c. This device can be found in Lenovo ideapad 310s (80U4000). Signed-off-by: Hiroka IHARA <ihara_h@live.jp> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21Input: mouse - use local variables consistentlyGuenter Roeck1-28/+18
If a function declares a variable to access a structure element, use it consistently. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-10-26Input: elan_i2c - always output the device informationBenjamin Tissoires1-9/+8
it's always easier to retrieve these information in bug reports when it is always printed in the dmesg. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-08-02Input: elan_i2c - properly wake up touchpad on ASUS laptopsKT Liao1-16/+63
Some ASUS laptops were shipped with touchpads that require to be woken up first, before trying to switch them into absolute reporting mode, otherwise touchpad would fail to work while flooding the logs with: elan_i2c i2c-ELAN1000:00: invalid report id data (1) Among affected devices are Asus E202SA, N552VW, X456UF, UX305CA, and others. We detect such devices by checking the IC type and product ID numbers and adjusting order of operations accordingly. Signed-off-by: KT Liao <kt.liao@emc.com.tw> Reported-by: Chris Chiu <chiu@endlessm.com> Reported-by: Vlad Glagolev <stealth@vaygr.net> Tested-by: Vlad Glagolev <stealth@vaygr.net> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-15Input: elan_i2c - set input device's vendor and product IDsCharlie Mooney1-0/+3
Previously the "vendor" and "product" IDs for the elan_i2c driver simply reported 0000. This patch modifies the elan_i2c driver to include the Elan vendor ID and the touchpad's product id under input/input*/{vendor,product}. Specifically, this is to allow us to apply a generic Elan gestures config that will apply to all Elan touchpads on ChromeOS. These configs match to input devices in various ways, but one major way is by matching on vendor ID. Adding this patch allows the default Elan touchpad config to be applied to Elan touchpads in this kernel by matching on devices that have vendor ID 04f3. Note that product ID is also available via custom sysfs entry "product_id" as well. Signed-off-by: Charlie Mooney <charliemooney@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-28Input: elan_i2c - add all valid ic type for i2c/smbusduson1-1/+10
Signed-off-by: Duson Lin <dusonlin@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-21Input: elan_i2c - expand maximum product_id form 0xFF to 0xFFFFDuson Lin1-2/+2
In order to support more projects in the future, we expand the maximum product_id value form 0xFF to 0xFFFF. Signed-off by: Duson Lin <dusonlin@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-21Input: elan_i2c - add ic type 0x03Duson Lin1-0/+1
The 0x03 is valid 3000 serial ic type too. Signed-off-by: Duson Lin <dusonlin@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-21Input: elan_i2c - don't require known iap versionDaniel Drake1-5/+7
The Asus X456UA has an ELAN1000 touchpad with IAP version 0xe. This is unknown to elan_get_fwinfo() so driver probe fails and I am left with an unusable touchpad. However, the fwinfo is not required for general driver usage, it is only needed if the user decides to upload new firmware. Adjust the driver so that we do not abort probe when we encounter unexpected IAP version, but rather warn user that firmware update feature of the driver will not work. Signed-off-by: Daniel Drake <drake@endlessm.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-03Input: elan_i2c - add ACPI ID "ELAN1000"João Paulo Rechi Vita1-0/+1
This ACPI ID present in the DSDT of the ASUS E202SA laptop. Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-03Input: elan_i2c - use iap_version to get firmware informationDuson Lin1-6/+6
When driver is in IAP mode ic_type query may return 0xff. However iap_version will always be valid, so let's use it to determine parameters of the firmware that the controller is supposed to accept. Signed-off-by: Duson Lin <dusonlin@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-08-28Input: elan_i2c - fix typos for validpage_countBenson Leung1-9/+9
Search for "vaildpage_count" and replace with "validpage_count". Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-08-24Input: elan_i2c - enable ELAN0100 acpi panelsMichele Curti1-0/+4
Enable ELAN0100 touchpad driver, found on a Asus X205TA laptop, to gai 2,3 fingers tap and 2 fingers scroll. Signed-off-by: Michele Curti <michele.curti@gmail.com> Reviewed-by: Duson Lin <dusonlin@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>