1
0
Fork 0
Commit Graph

5724 Commits (redonkable)

Author SHA1 Message Date
Martin T. H. Sandsmark 0cb4d9ab49 wacom_i2c: Add tilt and distance reporting to Wacom I2C 2020-10-07 11:32:38 +02:00
Martin T. H. Sandsmark 0fbaa312f6 wacom_12c: Port wacom_i2c to device tree 2020-10-07 11:32:38 +02:00
Martin T. H. Sandsmark ffe4c756db touch: Fix getting of GPIO in cyttsp5 from device tree 2020-10-07 11:32:38 +02:00
Martin T. H. Sandsmark d7340a200f touch: Import cyttsp5 driver from Parade 2020-10-07 11:32:38 +02:00
Haibo Chen 5a8fdd5d16 MLK-20207-3 input: synaptics_dsx_i2c: fix coverity resource leak issue.
CID 3869707: Resource leak (RESOURCE_LEAK)
13. leaked_storage: Variable fhandler going out of scope leaks
the storage it points to

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit ddf57217892e9fefc4f04a09988f4b0ed3bf0f07)
2018-11-22 14:35:42 +08:00
Haibo Chen fd6faa8221 MLK-20207-2: input: synaptics_dsx_i2c: fix coverity Unsigned compared against 0 issue.
CID 3869705: Unsigned compared against 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero comparison of an
unsigned value is always true. attr_count >= 0.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 7380600ba0d0763b6081c07f5ddcb018a54314ca)
2018-11-22 14:35:42 +08:00
Haibo Chen e8b0fe7d95 MLK-20207-1: input: synaptics_dsx_i2c: fix coverity wrong sizeof argument issue
CID 3869704: Wrong sizeof argument (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument f1a->button_control.txrx_map of
type unsigned char * and argument 8 /* sizeof (f1a->button_control.txrx_map) */
to function synaptics_rmi4_i2c_read is suspicious.

Passing argument should be sizeof(unsigned char) rather than
sizeof(unsigned char *).

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 4583a0bc1ff6684e1d850eb50308ad8ae2fea627)
2018-11-22 14:35:42 +08:00
Ranjani Vaidyanathan f20ad72e8f MLK-20222-3 drivers⌨️ Update SCFW API
Update SCFW API to the following commit:
"
    ("430d1e3646fbe75e339e18abf2330565eac906e0")
    Author: Chuck Cannon <chuck.cannon@nxp.com>
    Date:   Fri Nov 2 15:25:45 2018 -0500

    SCF-105: RN updates.
"

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
2018-11-02 17:21:17 -05:00
Haibo Chen ee475245cd MLK-20184 input: focaltech_touch: use disable_irq_nosync() in spin lock context
according to the function disable_irq() description, use disable_irq() in
spin lock context may cause deadlock. So change to use disable_irq_nosync().

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2018-11-02 18:44:36 +08:00
Haibo Chen 5377147371 MLK-14801 input: touch: ads7846: fix the pressure_max setting
For the touch pressure_max, if dts has no property "ti,pressure-max"
or this property is config to value 0, then default use 65535 as
the max pressure value. otherwise, in the latest xwayland rootfs,
will meet the following issue:

[21:44:34.302] input device 'ADS7846 Touchscreen', /dev/input/event3 is tagged by udev as: Touchscreen
[21:44:34.302] kernel bug: Device 'ADS7846 Touchscreen' has min == max on ABS_PRESSURE
[21:44:34.302] input device 'ADS7846 Touchscreen', /dev/input/event3 was rejected.
[21:44:34.302] failed to create input device '/dev/input/event3'

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Haibo Chen 0797ecb62c MLK-19751 input: synaptics_dsx: free touch irq when touch suspend
On the imx8 MIPI DSI oled board, MIPI panel and touch share one RST
pin. when suspend the whole system, touch will suspend first, it
disable touch irq, and let touch work in sleep mode. Then MIPI panel
suspend, it will give a reset signal on the RST pin. Due to this reset
signal, touch will trigger two interrupt on GPIO1_9. Because touch
suspend code already disable touch irq, so these two new touch interrupt
will be pending there, and pending there in GPIO forever.

When system resume, GPIO will restore registers in runtime resume before
synaptics_dsx_i2c touch driver resume, so the GPIO1_9 IRQ will be unmasked
and since its IRQ is pending there so IRQ keeps coming without touch
driver to handle it, since it is NOT resume yet, make the system can't
resueme back normally.

Due to this is the hardware limitation which cause this issue, I format this
patch to workaround this issue.
This patch free touch irq in the touch driver suspend procedure, rather than
just disable the touch irq.

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Haibo Chen a2f2ac513e MLK-18721-1: input: touch: Synaptics: add x/y diagonal rotation support
Add x/y coordinate diagonal rotation support, user can use this feature
by add "synaptics,diagonal-rotation" in dts.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 10c98865e5d1f0b7938523c793165e72add39f10)
2018-10-29 11:10:38 +08:00
Haibo Chen 1102c98ca1 MLK-18816-2 input/touch: do not clear touch interrupt when enable irq
On imx8mscale-evk baord, if I2C bus is configed pull-up, then once send
the i2c command to clear touch interrupt during the touch initialization,
touch will keep SDA line in low level, block the i2c bus. If config the
I2C bus pull-down, then this issue gone. Due to it is not reasonable to
set the I2c bus to pull-down for other i2c slave device, this patch work
as a workaround, just remove this i2c command, do not clear the touch
interrupt, test that touch can also work well after the initialization.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez b6f37f7179 MLK-18636 Input: egalax_ts: Restore call to i2c_set_clientdata
Upstream dropped the call to i2c_set_client_data as "unneeded" in commit
8300445cc7 ("Input: touchscreen - drop calls to platform_set_drvdata and i2c_set_clientdata")

The client_data pointer is used on suspend/resume by downstream commit
76a621ae711b ("MLK-17779 input: egalax_ts: free irq resource before request the line as GPIO")

This causes suspend/resume to crash (and apparently hang) on
imx6qdl-sabresd with LVDS display connected. Fix by adding back the
i2c_set_clientdata call.

Fixes: 76a621ae711b ("MLK-17779 input: egalax_ts: free irq resource before request the line as GPIO")

This could be squashed into MLK-17779

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Fugang Duan 7fc2832fee MLK-17779 input: egalax_ts: free irq resource before request the line as GPIO
If GPIO is connected to an IRQ then it should not request it as
GPIO function only when free its IRQ resouce.

Tested-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Robin Gong <yibin.gong@nxp.com
2018-10-29 11:10:38 +08:00
Fugang Duan 14eecf0006 MLK-17837-01 input: misc: rpmsg_input: add rpmsg virtual sensor driver
NXP i.MX7ULP EVK boards all sensors connect with M4 core, A core
has to conmunicate with sensors by virtual io bus like rpmsg bus.
The driver implement the virtual sensor input driver to configure
sensors active/idle/delay actions and report the sensors' event to
user space.

Supply below sysfs for user to enable/disable detector and counter,
set poll delay:
	/sys/class/misc/step_counter/enable
	/sys/class/misc/step_detector/enable
	/sys/class/misc/step_counter/poll_delay

Reviewed-by: Elven Wang <elven.wang@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Haibo Chen 37b3099468 MLK-17829 touchscreen: Add synaptics_dsx S3508 i2c touch driver
Add S3508 touch driver support.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Gao Pan 3c20f4d10c MLK-17061-1 sensor: set sensor interrupt pins as open-drain
The sensors share an interrupt pin on imx8qm/imx8qxp mek.
As a result, the interrupt signals will be interfered by
each other in default push-pull status.

This patch sets sensor interrupt pins as open-drain when
necessary.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
(cherry-picked from 48bcb7aafa2a3ced923d1a1753bb19d89a9fc273)
2018-10-29 11:10:38 +08:00
Robin Gong b62821254f MLK-16765-4 input: keyboard: imx_sc_pwrkey: add powerkey driver on i.mx8QM/QXP
This powerkey driver is a virtual driver based on scfw which control
SNVS ON/OFF in SCU side. The key interrupt triggered by MU notfication

BuildInfo:
   - SCFW e7d95e1e, IMX-MKIMAGE 05d3d4a7, ATF 93dd1cc
   - U-Boot 2017.03-00684-g28c5243

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2018-10-29 11:10:38 +08:00
Fugang Duan 32ac7e6673 MLK-15348-01 input: touch: focaltech: add more property to support multiple panel
Add device node more property to support multiple panel.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit: 8e85cfa29f)
2018-10-29 11:10:38 +08:00
Shenwei Wang da5c8adfe1 MLK-16262: Input: snvs_pwrkey - move devm_request_irq to the end of probe function
A pending interrupt may cause a kernel panic at system
startup. It is because the necessary data have not been
initialized completely before the interrupt handler is
called.

[    1.141547] Unable to handle kernel NULL pointer dereference at virtual address 00000048
[    1.149642] pgd = ffff000009275000
[    1.153048] [00000048] *pgd=00000000ffffe003[    1.157148] , *pud=00000000ffffd003
, *pmd=0000000000000000[    1.162660]
[    1.164164] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[    1.169740] Modules linked in:
[    1.172818] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.11-03067-g40eb128-dirty #112
[    1.180738] Hardware name: Freescale i.MX8MQ EVK (DT)
[    1.185794] task: ffff8000ba0e0000 task.stack: ffff8000ba0e8000
[    1.191725] PC is at imx_snvs_pwrkey_interrupt+0x14/0x70
[    1.197046] LR is at __handle_irq_event_percpu+0x9c/0x128
[    1.202450] pc : [<ffff000008849524>] lr : [<ffff000008101d4c>] pstate: 000001c5
[    1.209848] sp : ffff8000bff79ed0
[    1.213166] x29: ffff8000bff79ed0 x28: ffff8000ba0e8000
[    1.218514] x27: 0000000000000001 x26: ffff000008e582b8
[    1.223862] x25: ffff000009113eaf x24: ffff8000ba480200
[    1.229210] x23: 0000000000000021 x22: ffff8000bff79f8c
[    1.234557] x21: 0000000000000000 x20: ffff8000ba480200
[    1.239906] x19: 0000000000000000 x18: 0000000000000000
[    1.245253] x17: 0000000000000000 x16: 0000000000000000
[    1.250600] x15: 0000000000000000 x14: 0000000000000000
[    1.255947] x13: 0000000000000000 x12: 0000000000000000
[    1.261293] x11: 0000000000000040 x10: ffff8000b8000028
[    1.266642] x9 : ffff8000b8000130 x8 : 0000000000000000
[    1.271989] x7 : ffff8000ba480200 x6 : ffff8000ba480200
[    1.277336] x5 : ffff8000b8000000 x4 : 00008000b6eca000
[    1.282684] x3 : 0000000000000000 x2 : ffff000008849510
[    1.288030] x1 : 0000000000000000 x0 : 0000000000000021
[    1.293378]
[    1.294875] Process swapper/0 (pid: 1, stack limit = 0xffff8000ba0e8020)
[    1.301581] Stack: (0xffff8000bff79ed0 to 0xffff8000ba0ec000)
[    1.307330] Call trace:
[    1.309782] Exception stack(0xffff8000bff79d00 to 0xffff8000bff79e30)
[    1.316229] 9d00: 0000000000000000 0001000000000000 ffff8000bff79ed0 ffff000008849524
[    1.324065] 9d20: ffff8000bff79d40 ffff0000080e0830 ffff8000bffaa980 0000000000000000
[    1.331901] 9d40: ffff8000bff79d60 ffff0000080e0898 ffff8000bff79d70 ffff0000080f83d8
[    1.339736] 9d60: 0000000000554179 ffff0000080e097c ffff8000bff79da0 ffff0000080e7ff0
[    1.347572] 9d80: ffff8000ba0e0000 0000000000554179 ffff8000bff79dc0 ffff0000080eb20c
[    1.355408] 9da0: 0000000000000021 0000000000000000 ffff000008849510 0000000000000000
[    1.363243] 9dc0: 00008000b6eca000 ffff8000b8000000 ffff8000ba480200 ffff8000ba480200
[    1.371079] 9de0: 0000000000000000 ffff8000b8000130 ffff8000b8000028 0000000000000040
[    1.378914] 9e00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.386748] 9e20: 0000000000000000 0000000000000000
[    1.391633] [<ffff000008849524>] imx_snvs_pwrkey_interrupt+0x14/0x70
[    1.397994] [<ffff000008101d4c>] __handle_irq_event_percpu+0x9c/0x128
[    1.404440] [<ffff000008101df4>] handle_irq_event_percpu+0x1c/0x58
[    1.410626] [<ffff000008101e78>] handle_irq_event+0x48/0x78
[    1.416206] [<ffff0000081057c0>] handle_fasteoi_irq+0xb8/0x1b0
[    1.422045] [<ffff000008100e4c>] generic_handle_irq+0x24/0x38
[    1.427797] [<ffff0000081014b4>] __handle_domain_irq+0x5c/0xb8
[    1.433637] [<ffff00000808163c>] gic_handle_irq+0xbc/0x168
[    1.439127] Exception stack(0xffff8000ba0eb9e0 to 0xffff8000ba0ebb10)
[    1.445574] b9e0: ffff8000ba48029c 0000000000000040 0000000000000005 0000000000000000
[    1.453409] ba00: 0000000000000004 000000000000000f ffff8000ba480220 0000000000000000
[    1.461244] ba20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.469080] ba40: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    1.476915] ba60: 0000000000000000 0000000000000000 0000000000000000 ffff8000ba837f00
[    1.484751] ba80: ffff8000ba480200 0000000000000021 ffff8000ba48029c ffff8000ba480268
[    1.492586] baa0: 0000000000000000 0000000000000040 ffff8000ba480220 ffff8000ba480220
[    1.500422] bac0: 0000000000000000 ffff8000ba0ebb10 ffff000008103cb8 ffff8000ba0ebb10
[    1.508258] bae0: ffff000008b2b868 0000000040000045 ffff8000ba837f00 ffff8000ba480200
[    1.516092] bb00: ffffffffffffffff ffff000008103e18
[    1.520975] [<ffff0000080827b0>] el1_irq+0xb0/0x124
[    1.525863] [<ffff000008b2b868>] _raw_spin_unlock_irqrestore+0x10/0x48
[    1.532397] [<ffff000008104124>] request_threaded_irq+0xec/0x1c0
[    1.538410] [<ffff00000810689c>] devm_request_threaded_irq+0x74/0xe0
[    1.544770] [<ffff0000088497a8>] imx_snvs_pwrkey_probe+0x178/0x2a8
[    1.550958] [<ffff0000085ccaa0>] platform_drv_probe+0x58/0xc0
[    1.556713] [<ffff0000085caf54>] driver_probe_device+0x1fc/0x2a8
[    1.562727] [<ffff0000085cb0ac>] __driver_attach+0xac/0xb0
[    1.568220] [<ffff0000085c8fa4>] bus_for_each_dev+0x64/0xa0
[    1.573800] [<ffff0000085ca740>] driver_attach+0x20/0x28
[    1.579119] [<ffff0000085ca290>] bus_add_driver+0x110/0x230
[    1.584698] [<ffff0000085cb880>] driver_register+0x60/0xf8
[    1.590190] [<ffff0000085cc9d8>] __platform_driver_register+0x40/0x48
[    1.596640] [<ffff000009027a24>] imx_snvs_pwrkey_driver_init+0x18/0x20
[    1.603174] [<ffff0000080830b8>] do_one_initcall+0x38/0x128
[    1.608754] [<ffff000008fe0cec>] kernel_init_freeable+0x1a4/0x248
[    1.614853] [<ffff000008b26230>] kernel_init+0x10/0x100
[    1.620084] [<ffff000008082e80>] ret_from_fork+0x10/0x50
[    1.625403] Code: 910003fd f9000bf3 f9405833 52800001 (f9402660)
[    1.631518] ---[ end trace 7bb9749c5dc6e8f9 ]---
[    1.636148] Kernel panic - not syncing: Fatal exception in interrupt

Review-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Haibo Chen 607c2c5eb5 MLK-15950 input: egalax_ts: switch to i2c interface before wake up
For HannStar (HSD100PXN1 Rev: 1-A00C11 F/W:0634) LVDS touch screen,
it has a special request for the EETI touch controller. The host
needs to trigger I2C event to device FW at booting first, and then
the FW can switch to I2C interface. Otherwise, the FW can’t  work
with I2C interface, and can't generate any interrupt when touch
the screen.

This patch send an I2C command before the device wake up, make sure
the device switch to I2C interface first.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Julien Olivain 1f9ee26696 MLK-13471: fxls8471: add a symbol export to fix module build
When CONFIG_SENSOR_FXLS8471=m build was failing due to missing
exported symbol. This patch export the missing symbol.

Signed-off-by: Julien Olivain <julien.olivain@nxp.com>
2018-10-29 11:10:38 +08:00
Anson Huang 8dedcbfcbb MLK-15328-1 input: keyboard: add i.mx8mq snvs onoff button support
i.MX8MQ use SNVS ONOFF button, add support for it.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 64a1bb9125 MLK-14619 input: keyboard: rpmsg-keys: add rpmsg-keys driver
Add rpmsg-keys driver on i.mx7ulp-evk board since vol+/vol- keys
are connected on m4 side and have to get the status of keys by
rpmsg.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
[Irina: updated for 4.9 APIs]
Signed-off-by: Irina Tirdea <irina.tirdea@nxp.com>
2018-10-29 11:10:38 +08:00
Gao Pan d04dd17d73 MLK-14671 input: touch: focaltech: disable debug information
disable debug information for focaltech touch.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
(cherry picked from commit b88a0ed7837ab964253f710da03fdab481592350)
2018-10-29 11:10:38 +08:00
Robert Chiras ee6600e9d8 MLK-14473: touchscreen: Fix return type
The touchscreen driver, max11801, which is on 12c2 bus, won't be probed
when using the hdcp specific DTS (this is disabling 12c2, since it
will acquire it for DDC communications). Since this driver won't be
probed, it will spam the dmesg with the pr_err from max11801_read_adc()
function. This function is periodically called by the battery driver. For
this reason, I removed the pr_err() call.
Also, to be noticed that the function signature is u32, but in case of an
error it will return a negative integer. In order to correctly propagate
errors, I changed the function signature to int. This is safe, since the
read value from i2c is on 16 bits (MSB and LSB on 8 bits).

Also, the function calibration_voltage is calling max11801_read_adc from
touchscreen driverm which can return negative values in case of an
error. I case of an error, just stop reading ADC data and return 0 as
voltage_data.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2018-10-29 11:10:38 +08:00
Gao Pan c56cad80d0 MLK-14392-1 input: touch: add focaltech touch screen support
add focaltech touch screen support

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
(cherry-pick from 595cefbee5586e77ceb9ad900c256177a98367c7)
2018-10-29 11:10:38 +08:00
Anson Huang 15eb2c7c42 MLK-13614 input: keyboard: imx: make sure keypad interrupts are enabled in suspend
Change the suspend/resume callback to suspend_noirq/resume_noirq
callback to make sure keypad interrupts are enabled during suspend,
as when there is keypad interrupt coming after suspend callback
is called, the interrupt handler will still be called and it will
disable keypad interrupts, it will cause keypad can NOT generate
interrupts to wake up system from suspend.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
2018-10-29 11:10:38 +08:00
Fabio Estevam d43c7a6a91 MLK-9987: Input: imx_keypad: Fix suspend/resume while keypad is pressed
Since commit commit 560a64749d1dd0ff ("ENGR00318936-2 input: keyboard: imx:
remove usless release interrupt enabled) the following problem happens:

- Keep any keypad key pressed
- Enter low power mode via "echo mem > /sys/power/state"
- Then we are no longer able to wake-up the system via the keypad

The reason for this behaviour is that the KRIE (Release Interrupt) is not
enabled.

In order to fix this problem, we should enable KRIE when a key is pressed
(KPKD bit is set) or enable KDIE when no key is pressed (KPKR is set).

This way we will always have a valid source of keypad interrupt no matter if
the system entered low power mode while a keypad key was pressed or not.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
(cherry picked from commit 5a7ab47e67d1045cb2f5d408c112617dff48dee2)
(cherry picked from commit f75c35512bd3df7dbb26f4a35cf17dcbb6ffb724)
2018-10-29 11:10:38 +08:00
Robin Gong 483dcd919c ENGR00318936-2 input: keyboard: imx: remove usless release interrupt enabled code
Remove useless code for release interrupt enabled, because we check status by
timer rather than release interrupt. Remove the code which may disable depress
interrupt. Also make sure enable depress interrupt in suspend function.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 806ed5b9769efff2c9d8c66ed19315b48ec6fd57)
(cherry picked from commit 307d613b1f363f802433cd2debbb2b28ddc17a06)
2018-10-29 11:10:38 +08:00
Robin Gong e74c5a8105 ENGR00318936-1 input: keyboard: imx: add pm_stay_awake and pm_relax
There is a small window after system suspend but timer scan function
didn't finish timely, in this case,  system enter suspend without kpp
interrupt enabled and failed to resume back if key depressed.We add
pm_stay_awake and pm_relax to make sure system suspend flow abort in
this case.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 3868f06af8f39673f270643ada63dd88e2f5699e)
(cherry picked from commit 529dee44f7da0ad6d57a3e8ccd942af944f6723b)
2018-10-29 11:10:38 +08:00
Alejandro Lozano d4b27fb4e6 MLK-13244 input: touchscreen: add support for vtl touchscreen
Add the support for a CT36X based touchscreens using
the CT36X controller and i2c touchscreen interface.

Signed-off-by: Alejandro Lozano <alejandro.lozano@nxp.com>
Signed-off-by: Juan Gutierrez <juan.gutierrez@nxp.com>
Signed-off-by: Alejandro Sierra <alejandro.sierra@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 03cb430a3b MLK-12928-12 input: keyboard: pf1550: enable ONKEY wakeup interrupt before suspend
Enable ONKEY wakeup interrupt before suspend, and remove usless marocs.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 49e774e493 MLK-12928-5 input: keyboard: pf1550_onkey: add onkey driver for pf1550
Add pf1550_onkey driver, so that POWERON key can link to pf1550 instead of
i.mx6ul.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2018-10-29 11:10:38 +08:00
Fugang Duan 212edc5e5f MLK-12271 Input: atkbd: add return value check after calling .dmi_check_system()
Add return value check after calling .dmi_check_system().
Reported by Coverity: CID18431

Signed-off-by: Fugang Duan <B38611@freescale.com>
2018-10-29 11:10:38 +08:00
Fugang Duan 8161c16d00 MLK-12176 Input: ads7846: add return value check after calling .of_property_read_u32()
Add return value check after calling .of_property_read_u32().
The issue was reported by coverity.

Signed-off-by: Fugang Duan <B38611@freescale.com>
2018-10-29 11:10:38 +08:00
Haibo Chen 48a37b5c27 MLK-10142-1 touchscreen: elan: add elan touch screen driver support
Add elan touch screen driver in linux kernel.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
(cherry picked from commit 20180719c54760359d78544d55e4ac1fabaf6e8b)
2018-10-29 11:10:38 +08:00
Fugang Duan 21e40304c6 MLK-11957 input: misc: fxls8471: remove unnecessary .kfree()
The driver kfree the global memory that is not correct. The patch
remove them.

Signed-off-by: Fugang Duan <B38611@freescale.com>
2018-10-29 11:10:38 +08:00
Robin Gong 83c0e6f235 MLK-11703-1: input: touchscreen: max11801_ts: Add DCM mode for max11801 ADC
We need add DCM mode/AUX mode for ADC converter function of max11801, so that
it can be used to read voltage of battery. Meanwhile, let the driver based on
device tree. The patchset is based on below patch (V3.5.7):

commit 4001774cf51f0140ae7e4e8e0ec1d86475790682
Author: Rong Dian <b38775@freescale.com>
Date:   Fri Jan 18 14:24:28 2013 +0800

    Engr00240284-1 MAX11801: Add DCM aux adc sample function

        1.Add direct conversion mode operations
	2.Add aux adc sample function

Signed-off-by: Robin Gong <b38343@freescale.com>
2018-10-29 11:10:38 +08:00
Robin Gong f91ea61167 MLK-11281-1: input: keyboard: gpio_keys: add pinctl set in suspend and resume
Add pinctrl restore to support LPSR.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit f7d40aa30ca2fe337ba9bb8f7eaca4393db900be)
2018-10-29 11:10:38 +08:00
Anson Huang b7caa9e2ca MLK-11566-3 input: keyboard: add i.mx6ul support for snvs power key
i.MX6UL has SNVS power key, add support for it.

Signed-off-by: Anson Huang <b20788@freescale.com>
(cherry picked from commit 095c876a12e27220cb91cb9dc376a20b6bf259e4)
2018-10-29 11:10:38 +08:00
Luwei Zhou 5d4ec0af8f MLK-11471-01 input: misc: isl29023: Add isl29023 driver support on i.MX6Q/DL/SX platform.
Add isl29023 driver support for i.MX6Q/DL/SX platform. The code derives from 3.10.y branch.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: b0134420bba0022151499f1bb15e0d5daba970fa)
2018-10-29 11:10:38 +08:00
Fugang Duan 923f803908 MLK-11468 input: mma8450: evbug module will keep print message.
evbug will open the mma8450 on i.MX6SL_EVK and mma8450 will work in 2G mode by default.
That is the reason why mma8450 logs will be printed out. The main changes is below:

 * Remove the open(), close() hook out of the drivers. The open() and close()
   hook in input framwork is defined as void type. It isn't strictly safe in
   logic when some error happends. So remove them out.
 * Modify the mma8450 to standby mode by default. It will be more power saving
   and there would be no log printing out after booting up.
 * Provide the sys interface to modify the mma8450 work modes. Then the higher
   layer can modify the the mma8450 work mode via the interface. It would be
   much safer.There would be a sclaemode interface in the folder of
   /sys/devices/soc0/soc.1/2100000.aips-bus/21a0000.i2c/i2c-0/0-001c/scalemode
   User can use cat to read the current scalemode and echo to write. The mode
   is defined as: MODE_STANDBY: 0  MODE_2G:1  MODE_4G:2  MODE_8G:3
 * Add mutex to protect and some error handling.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit c51a786078fd569ce95eb6dcf09c76d1b3c0f172)
2018-10-29 11:10:38 +08:00
Luwei Zhou bc2c2fc0e1 MLK-11467 input: mma8450: Add chip id check in probe
Add chip ID check in probe function. The mma8450 is
on the E-INK daughter board. When the daughter board
is not pluged, there would be polling error log
continuously. Add the check to avoid this.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit e9f2c4cf673dee1527925f30a9f3fd137d9799ad)
2018-10-29 11:10:38 +08:00
Gao Pan 12874c311c MLK-11206: input: misc: fxls8471: support ±2g/±4g/±8g dynamically selection
Support ±2g/±4g/±8g dynamically selection for motion sensor fxls8471.

Set the sensor mode to standby mode before changing the scale range
with the command "echo 0 > enable". The scale range can be changed
with the command "echo 0/1/2 > range".

Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 6824cff93d368eafbf96c71fad541f9bc2502e3a)
2018-10-29 11:10:38 +08:00
gaopan 88ee020fe5 MLK-10948 input: misc: fxls8471: add motion sensor fxls8471
Add Freescale fxls8471 motion sensor.

Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 20cfe2d9d9305559e35fe2e508d5a70b057ffc70)
2018-10-29 11:10:38 +08:00
Fugang Duan c59d5c333a MLK-10835-3 input: misc: mpl3115: add Freescale MPL3115 pressure temperature sensor
Add Freescale MPL3115 pressure temperature sensor.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: a8c2904a442e1aa163b8562e1a940c8755ab3898)
2018-10-29 11:10:38 +08:00
Michael Schmitz 1c22d2cbd9 Input: atakbd - fix Atari CapsLock behaviour
[ Upstream commit 52d2c7bf7c ]

The CapsLock key on Atari keyboards is not a toggle, it does send the
normal make and break scancodes.

Drop the CapsLock toggle handling code, which did cause the CapsLock
key to merely act as a Shift key.

Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:48:50 +02:00
Andreas Schwab 8b8ab47a09 Input: atakbd - fix Atari keymap
[ Upstream commit 9e62df51be ]

Fix errors in Atari keymap (mostly in keypad, help and undo keys).

Patch provided on debian-68k ML by Andreas Schwab <schwab@linux-m68k.org>,
keymap array size and unhandled scancode limit adjusted to 0x73 by me.

Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20 09:48:50 +02:00
Aaron Ma 3011b91478 Input: elantech - enable middle button of touchpad on ThinkPad P72
commit 91a9750732 upstream.

Adding 2 new touchpad IDs to support middle button support.

Cc: stable@vger.kernel.org
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-03 17:00:56 -07:00
Oleksandr Andrushchenko a82a772da7 Input: xen-kbdfront - fix multi-touch XenStore node's locations
[ Upstream commit ce6f7d087e ]

kbdif protocol describes multi-touch device parameters as a
part of frontend's XenBus configuration nodes while they
belong to backend's configuration. Fix this by reading the
parameters as defined by the protocol.

Fixes: 49aac8204d ("Input: xen-kbdfront - add multi-touch support")

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-03 17:00:53 -07:00
Peter Rosin bb9dcbf97a input: rohm_bu21023: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)
[ Upstream commit 193c2a07cf ]

Locking the root adapter for __i2c_transfer will deadlock if the
device sits behind a mux-locked I2C mux. Switch to the finer-grained
i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not
sit behind a mux-locked mux, the two locking variants are equivalent.

Signed-off-by: Peter Rosin <peda@axentia.se>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26 08:38:12 +02:00
Nick Dyer b0a6faaa60 Input: atmel_mxt_ts - only use first T9 instance
[ Upstream commit 36f5d9ef26 ]

The driver only registers one input device, which uses the screen
parameters from the first T9 instance. The first T63 instance also uses
those parameters.

It is incorrect to send input reports from the second instances of these
objects if they are enabled: the input scaling will be wrong and the
positions will be mashed together.

This also causes problems on Android if the number of slots exceeds 32.

In the future, this could be handled by looking for enabled touch object
instances and creating an input device for each one.

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-19 22:43:43 +02:00
Dmitry Torokhov a333f3f2a2 Input: do not use WARN() in input_alloc_absinfo()
[ Upstream commit 100294cee9 ]

Some of fuzzers set panic_on_warn=1 so that they can handle WARN()ings
the same way they handle full-blown kernel crashes. We used WARN() in
input_alloc_absinfo() to get a better idea where memory allocation
failed, but since then kmalloc() and friends started dumping call stack on
memory allocation failures anyway, so we are not getting anything extra
from WARN().

Because of the above, let's replace WARN with dev_err(). We use dev_err()
instead of simply removing message and relying on kcalloc() to give us
stack dump so that we'd know the instance of hardware device to which we
were trying to attach input device.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-15 09:45:30 +02:00
Lucas Stach 048f62f372 Input: synaptics-rmi4 - fix axis-swap behavior
[ Upstream commit 645a397d32 ]

The documentation for the touchscreen-swapped-x-y property states that
swapping is done after inverting if both are used. RMI4 did it the other
way around, leading to inconsistent behavior with regard to other
touchscreens.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Nick Dyer <nick@shmanahar.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:08:56 +02:00
KT Liao ca6427facd Input: elan_i2c - add another ACPI ID for Lenovo Ideapad 330-15AST
commit 6f88a6439d upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-03 07:50:21 +02:00
Chen-Yu Tsai e0e385e212 Input: i8042 - add Lenovo LaVie Z to the i8042 reset list
commit 384cf4285b upstream.

The Lenovo LaVie Z laptop requires i8042 to be reset in order to
consistently detect its Elantech touchpad. The nomux and kbdreset
quirks are not sufficient.

It's possible the other LaVie Z models from NEC require this as well.

Cc: stable@vger.kernel.org
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-03 07:50:20 +02:00
Donald Shanty III b4667635de Input: elan_i2c - add ACPI ID for lenovo ideapad 330
commit 938f45008d upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-03 07:50:20 +02:00
??? 3d1de95138 Input: elantech - fix V4 report decoding for module with middle key
commit e0ae2519ca upstream.

Some touchpad has middle key and it will be indicated in bit 2 of packet[0].
We need to fix V4 formation's byte mask to prevent error decoding.

Signed-off-by: KT Liao <kt.liao@emc.com.tw>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03 11:25:04 +02:00
Aaron Ma 524a0c6f2e Input: elantech - enable middle button of touchpads on ThinkPad P52
commit 24bb555e6e upstream.

PNPID is better way to identify the type of touchpads.
Enable middle button support on 2 types of touchpads on Lenovo P52.

Cc: stable@vger.kernel.org
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03 11:25:04 +02:00
Ben Hutchings ade767642c Input: elan_i2c_smbus - fix more potential stack buffer overflows
commit 50fc7b6195 upstream.

Commit 40f7090bb1 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03 11:25:04 +02:00
Enno Boland 8fa052853d Input: xpad - fix GPD Win 2 controller name
commit dd6bee81c9 upstream.

This fixes using the controller with SDL2.

SDL2 has a naive algorithm to apply the correct settings to a controller.
For X-Box compatible controllers it expects that the controller name
contains a variation of a 'XBOX'-string.

This patch changes the identifier to contain "X-Box" as substring.  Tested
with Steam and C-Dogs-SDL which both detect the controller properly after
adding this patch.

Fixes: c1ba08390a ("Input: xpad - add GPD Win 2 Controller USB IDs")
Cc: stable@vger.kernel.org
Signed-off-by: Enno Boland <gottox@voidlinux.eu>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03 11:25:03 +02:00
Alexandr Savca 24ab6e6858 Input: elan_i2c - add ELAN0618 (Lenovo v330 15IKB) ACPI ID
commit 8938fc7b8f upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03 11:25:03 +02:00
Nick Dyer 960fe000b1 Input: atmel_mxt_ts - fix the firmware update
[ Upstream commit 068bdb67ef ]

The automatic update mechanism will trigger an update if the
info block CRCs are different between maxtouch configuration
file (maxtouch.cfg) and chip.

The driver compared the CRCs without retrieving the chip CRC,
resulting always in a failure and firmware flashing action
triggered. Fix this issue by retrieving the chip info block
CRC before the check.

Note that this solution has the benefit that by reading the
information block and the object table into a contiguous region
of memory, we can verify the checksum at probe time. This means
we make sure that we are indeed talking to a chip that supports
object protocol correctly.

Using this patch on a kevin chromebook, the touchscreen and
touchpad drivers are able to match the CRC:

  atmel_mxt_ts 3-004b: Family: 164 Variant: 14 Firmware V2.3.AA Objects: 40
  atmel_mxt_ts 5-004a: Family: 164 Variant: 17 Firmware V2.0.AA Objects: 31
  atmel_mxt_ts 3-004b: Resetting device
  atmel_mxt_ts 5-004a: Resetting device
  atmel_mxt_ts 3-004b: Config CRC 0x573E89: OK
  atmel_mxt_ts 3-004b: Touchscreen size X4095Y2729
  input: Atmel maXTouch Touchscreen as /devices/platform/ff130000.i2c/i2c-3/3-004b/input/input5
  atmel_mxt_ts 5-004a: Config CRC 0x0AF6BA: OK
  atmel_mxt_ts 5-004a: Touchscreen size X1920Y1080
  input: Atmel maXTouch Touchpad as /devices/platform/ff140000.i2c/i2c-5/5-004a/input/input6

Signed-off-by: Nick Dyer <nick.dyer@shmanahar.org>
Acked-by: Benson Leung <bleung@chromium.org>
[Ezequiel: minor patch massage]
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-21 04:02:52 +09:00
Christophe JAILLET 176ebf4df9 Input: synaptics-rmi4 - fix an unchecked out of memory error path
[ Upstream commit 839c422736 ]

When extending the rmi_spi buffers, we must check that no out of memory
error occurs, otherwise we may access data above the currently allocated
memory.

Propagate the error code returned by 'rmi_spi_manage_pools()' instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andrew Duggan <aduggan@synaptics.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-21 04:02:40 +09:00
Johannes Wienke 3c42aa03cd Input: elan_i2c - add ELAN0612 (Lenovo v330 14IKB) ACPI ID
commit e6e7e9cd8e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-16 09:45:17 +02:00
Ethan Lee c4168f1920 Input: goodix - add new ACPI id for GPD Win 2 touch screen
commit 5ca4d1ae9b upstream.

GPD Win 2 Website: http://www.gpd.hk/gpdwin2.asp

Tested on a unit from the first production run sent to Indiegogo backers

Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-16 09:45:17 +02:00
Ethan Lee cb6b586965 Input: xpad - add GPD Win 2 Controller USB IDs
commit c1ba08390a upstream.

GPD Win 2 Website: http://www.gpd.hk/gpdwin2.asp

Tested on a unit from the first production run sent to Indiegogo backers

Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-16 09:45:15 +02:00
Benjamin Tissoires 2be683020b Input: elan_i2c_smbus - fix corrupted stack
commit 40f7090bb1 upstream.

New ICs (like the one on the Lenovo T480s) answer to
ETP_SMBUS_IAP_VERSION_CMD 4 bytes instead of 3. This corrupts the stack
as i2c_smbus_read_block_data() uses the values returned by the i2c
device to know how many data it need to return.

i2c_smbus_read_block_data() can read up to 32 bytes (I2C_SMBUS_BLOCK_MAX)
and there is no safeguard on how many bytes are provided in the return
value. Ensure we always have enough space for any future firmware.
Also 0-initialize the values to prevent any access to uninitialized memory.

Cc: <stable@vger.kernel.org> # v4.4.x, v4.9.x, v4.14.x, v4.15.x, v4.16.x
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: KT Liao <kt.liao@emc.com.tw>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-05 11:41:56 +02:00
Benjamin Tissoires 9a85abc794 Input: synaptics - add Lenovo 80 series ids to SMBus
commit ad8fb554f0 upstream.

This time, Lenovo decided to go with different pieces in its latest
series of Thinkpads.

For those we have been able to test:
- the T480 is using Synaptics with an IBM trackpoint
   -> it behaves properly with or without intertouch, there is no point
      not using RMI4
- the X1 Carbon 6th gen is using Synaptics with an IBM trackpoint
   -> the touchpad doesn't behave properly under PS/2 so we have to
      switch it to RMI4 if we do not want to have disappointed users
- the X280 is using Synaptics with an ALPS trackpoint
   -> the recent fixes in the trackpoint handling fixed it so upstream
      now works fine with or without RMI4, and there is no point not
      using RMI4
- the T480s is using an Elan touchpad, so that's a different story

Cc: <stable@vger.kernel.org> # v4.14.x, v4.15.x, v4.16.x
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: KT Liao <kt.liao@emc.com.tw>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-05 11:41:56 +02:00
Aaron Ma 9c707c93e1 Input: synaptics - add Intertouch support on X1 Carbon 6th and X280
commit 5717a09aea upstream.

Synaptics devices reported it has Intertouch support,
and it fails via PS/2 as following logs:

psmouse serio2: Failed to reset mouse on synaptics-pt/serio0
psmouse serio2: Failed to enable mouse on synaptics-pt/serio0

Set these new devices to use SMBus to fix this issue, then they report
SMBus version 3 is using, patch:
https://patchwork.kernel.org/patch/9989547/ enabled SMBus ver 3 and
makes synaptics devices work fine on SMBus mode.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-05 11:41:56 +02:00
Edvard Holst af504c5a88 Input: synaptics - Lenovo Thinkpad X1 Carbon G5 (2017) with Elantech trackpoints should use RMI
commit 15e2cffec3 upstream.

Lenovo use two different trackpoints in the fifth generation Thinkpad X1
Carbon. Both are accessible over SMBUS/RMI but the pnpIDs are missing.
This patch is for the Elantech trackpoint specifically which also
reports SMB version 3 so rmi_smbus needs to be updated in order to
handle it.

For the record, I was not the first one to come up with this patch as it
has been floating around the internet for a while now. However, I have
spent significant time with testing and my efforts to find the original
author of the patch have been unsuccessful.

Signed-off-by: Edvard Holst <edvard.holst@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-05 11:41:56 +02:00
Dmitry Torokhov 88859f6cc5 Input: synaptics - Lenovo Carbon X1 Gen5 (2017) devices should use RMI
commit 9b2071028f upstream.

The touchpad on Lenovo Carbon X1 Gen 5 (2017 - Kabylake) is accessible over
SMBUS/RMI, so let's activate it by default.

Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-05 11:41:55 +02:00
Vittorio Gambaletta (VittGam) 10579ed39e Input: atmel_mxt_ts - add touchpad button mapping for Samsung Chromebook Pro
commit f372b81101 upstream.

This patch adds the correct platform data information for the Caroline
Chromebook, so that the mouse button does not get stuck in pressed state
after the first click.

The Samus button keymap and platform data definition are the correct
ones for Caroline, so they have been reused here.

Signed-off-by: Vittorio Gambaletta <linuxbugs@vittgam.net>
Signed-off-by: Salvatore Bellizzi <lkml@seppia.net>
Tested-by: Guenter Roeck <groeck@chromium.org>
Cc: stable@vger.kernel.org
[dtor: adjusted vendor spelling to match shipping firmware]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-09 09:51:51 +02:00
Dmitry Torokhov 8949370219 Input: leds - fix out of bound access
commit 6bd6ae6396 upstream.

UI_SET_LEDBIT ioctl() causes the following KASAN splat when used with
led > LED_CHARGING:

[ 1274.663418] BUG: KASAN: slab-out-of-bounds in input_leds_connect+0x611/0x730 [input_leds]
[ 1274.663426] Write of size 8 at addr ffff88003377b2c0 by task ckb-next-daemon/5128

This happens because we were writing to the led structure before making
sure that it exists.

Reported-by: Tasos Sahanidis <tasos@tasossah.com>
Tested-by: Tasos Sahanidis <tasos@tasossah.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-09 09:51:51 +02:00
Andi Shyti 6a5505da41 Input: stmfts - set IRQ_NOAUTOEN to the irq flag
[ Upstream commit cba04cdf43 ]

The interrupt is requested before the device is powered on and
it's value in some cases cannot be reliable. It happens on some
devices that an interrupt is generated as soon as requested
before having the chance to disable the irq.

Set the irq flag as IRQ_NOAUTOEN before requesting it.

This patch mutes the error:

  stmfts 2-0049: failed to read events: -11

received sometimes during boot time.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26 11:02:10 +02:00
Peter Hutterer 0d5ef8956c Input: synaptics - reset the ABS_X/Y fuzz after initializing MT axes
[ Upstream commit 19eb4ed114 ]

input_mt_init_slots() resets the ABS_X/Y fuzz to 0 and expects the driver
to call input_mt_report_pointer_emulation(). That is based on the MT
position bits which are already defuzzed - hence a fuzz of 0.

In the case of synaptics semi-mt devices, we report the ABS_X/Y axes
manually.  This results in the MT position being defuzzed but the
single-touch emulation missing that defuzzing.

Work around this by re-initializing the ABS_X/Y axes after the MT axis to
get the same fuzz value back.

https://bugs.freedesktop.org/show_bug.cgi?id=104533

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26 11:02:05 +02:00
Dmitry Torokhov d925c30874 Input: psmouse - fix Synaptics detection when protocol is disabled
[ Upstream commit 2bc4298f59 ]

When Synaptics protocol is disabled, we still need to try and detect the
hardware, so we can switch to SMBus device if SMbus is detected, or we know
that it is Synaptics device and reset it properly for the bare PS/2
protocol.

Fixes: c378b5119e ("Input: psmouse - factor out common protocol probing code")
Reported-by: Matteo Croce <mcroce@redhat.com>
Tested-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26 11:02:05 +02:00
Hans de Goede 88f6f0490f Input: goodix - disable IRQs while suspended
[ Upstream commit faec44b683 ]

We should not try to do any i2c transfers before the controller is
resumed (which happens before our resume method gets called).

So we need to disable our IRQ while suspended to enforce this. The
code paths for devices with GPIOs for the int and reset pins already
disable the IRQ the through goodix_free_irq().

This commit also disables the IRQ while suspended for devices without
GPIOs for the int and reset pins.

This fixes the i2c bus sometimes getting stuck after a suspend/resume
causing the touchscreen to sometimes not work after a suspend/resume.
This has been tested on a GPD pocked device.

BugLink: https://github.com/nexus511/gpd-ubuntu-packages/issues/10
BugLink: https://www.reddit.com/r/GPDPocket/comments/7niut2/fix_for_broken_touch_after_resume_all_linux/
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-12 12:32:20 +02:00
Ondrej Zary 8ac678a4b3 Input: i8042 - enable MUX on Sony VAIO VGN-CS series to fix touchpad
commit 04bb1719c4 upstream.

The touch sensor buttons on Sony VAIO VGN-CS series laptops (e.g.
VGN-CS31S) are a separate PS/2 device. As the MUX is disabled for all
VAIO machines by the nomux blacklist, the data from touch sensor
buttons and touchpad are combined. The protocol used by the buttons is
probably similar to the touchpad protocol (both are Synaptics) so both
devices get enabled. The controller combines the data, creating a mess
which results in random button clicks, touchpad stopping working and
lost sync error messages:
psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 4
psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1
psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1
psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1
psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1
psmouse serio1: issuing reconnect request

Add a new i8042_dmi_forcemux_table whitelist with VGN-CS.
With MUX enabled, touch sensor buttons are detected as separate device
(and left disabled as there's currently no driver), fixing all touchpad
problems.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-08 14:26:33 +02:00
Dennis Wassenberg 4043155add Input: i8042 - add Lenovo ThinkPad L460 to i8042 reset list
commit b56af54ac7 upstream.

Reset i8042 before probing because of insufficient BIOS initialisation of
the i8042 serial controller. This makes Synaptics touchpad detection
possible. Without resetting the Synaptics touchpad is not detected because
there are always NACK messages from AUX port.

Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-08 14:26:33 +02:00
Masaki Ota ac72f0080c Input: ALPS - fix TrackStick detection on Thinkpad L570 and Latitude 7370
commit 567b9b549c upstream.

The primary interface for the touchpad device in Thinkpad L570 is SMBus,
so ALPS overlooked PS2 interface Firmware setting of TrackStick, and
shipped with TrackStick otp bit is disabled.

The address 0xD7 contains device number information, so we can identify
the device by checking this value, but to access it we need to enable
Command mode, and then re-enable the device. Devices shipped in Thinkpad
L570 report either 0x0C or 0x1D as device numbers, if we see them we assume
that the devices are DualPoints.

The same issue exists on Dell Latitude 7370.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196929
Fixes: 646580f793 ("Input: ALPS - fix multi-touch decoding on SS4 plus touchpads")
Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com>
Tested-by: Aaron Ma <aaron.ma@canonical.com>
Tested-by: Jonathan Liu <net147@gmail.com>
Tested-by: Jaak Ristioja <jaak@ristioja.ee>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-08 14:26:32 +02:00
Zhang Bo 89d3fccd8b Input: matrix_keypad - fix race when disabling interrupts
commit ea4f7bd2ac upstream.

If matrix_keypad_stop() is executing and the keypad interrupt is triggered,
disable_row_irqs() may be called by both matrix_keypad_interrupt() and
matrix_keypad_stop() at the same time, causing interrupts to be disabled
twice and the keypad being "stuck" after resuming.

Take lock when setting keypad->stopped to ensure that ISR will not race
with matrix_keypad_stop() disabling interrupts.

Signed-off-by: Zhang Bo <zbsdta@126.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-15 10:54:32 +01:00
Oleksandr Andrushchenko 9d27ab3463 Input: xen-kbdfront - do not advertise multi-touch pressure support
[ Upstream commit 02a0d9216d ]

Some user-space applications expect multi-touch pressure
on contact to be reported if it is advertised in device
properties. Otherwise, such applications may treat reports
not as actual touches, but hovering. Currently this is
only advertised, but not reported.
Fix this by not advertising that ABS_MT_PRESSURE is supported.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
Patchwork-Id: 10140017
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-03 10:24:32 +01:00
Dmitry Torokhov 01ab9886ea Input: synaptics-rmi4 - do not delete interrupt memory too early
commit a1ab69021a upstream.

We want to free memory reserved for interrupt mask handling only after we
free functions, as function drivers might want to mask interrupts. This is
needed for the followup patch to the F03 that would implement unmasking and
masking interrupts from the serio pass-through port open() and close()
methods.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-03 17:39:24 +01:00
Dmitry Torokhov fced3c99e7 Input: synaptics-rmi4 - unmask F03 interrupts when port is opened
commit 6abe534f07 upstream.

Currently we register the pass-through serio port when we probe the F03 RMI
function, and then, in sensor configure phase, we unmask interrupts.
Unfortunately this is too late, as other drivers are free probe devices
attached to the serio port as soon as it is probed. Because interrupts are
masked, the IO times out, which may result in not being able to detect
trackpoints on the pass-through port.

To fix the issue we implement open() and close() methods for the
pass-through serio port and unmask interrupts from there. We also move
creation of the pass-through port form probe to configure stage, as RMI
driver does not enable transport interrupt until all functions are probed
(we should change this, but this is a separate topic).

We also try to clear the pending data before unmasking interrupts, because
some devices like to spam the system with multiple 0xaa 0x00 announcements,
which may interfere with us trying to query ID of the device.

Fixes: c5e8848fc9 ("Input: synaptics-rmi4 - add support for F03")
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-03 17:39:24 +01:00
Dmitry Torokhov 203a60330e Input: trackpoint - only expose supported controls for Elan, ALPS and NXP
commit 2a924d7179 upstream.

The newer trackpoints from ALPS, Elan and NXP implement a very limited
subset of extended commands and controls that the original trackpoints
implemented, so we should not be exposing not working controls in sysfs.
The newer trackpoints also do not implement "Power On Reset" or "Read
Extended Button Status", so we should not be using these commands during
initialization.

While we are at it, let's change "unsigned char" to u8 for byte data or
bool for booleans and use better suited error codes instead of -1.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-31 14:03:42 +01:00
Aaron Ma 7e4cd0ad57 Input: trackpoint - force 3 buttons if 0 button is reported
commit f5d07b9e98 upstream.

Lenovo introduced trackpoint compatible sticks with minimum PS/2 commands.
They supposed to reply with 0x02, 0x03, or 0x04 in response to the
"Read Extended ID" command, so we would know not to try certain extended
commands. Unfortunately even some trackpoints reporting the original IBM
version (0x01 firmware 0x0e) now respond with incorrect data to the "Get
Extended Buttons" command:

 thinkpad_acpi: ThinkPad BIOS R0DET87W (1.87 ), EC unknown
 thinkpad_acpi: Lenovo ThinkPad E470, model 20H1004SGE

 psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 0/0

Since there are no trackpoints without buttons, let's assume the trackpoint
has 3 buttons when we get 0 response to the extended buttons query.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196253
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-31 14:03:42 +01:00
Mark Furneaux 25cb145272 Input: xpad - add support for PDP Xbox One controllers
commit e5c9c6a885 upstream.

Adds support for the current lineup of Xbox One controllers from PDP
(Performance Designed Products). These controllers are very picky with
their initialization sequence and require an additional 2 packets before
they send any input reports.

Signed-off-by: Mark Furneaux <mark@furneaux.ca>
Reviewed-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-31 14:03:42 +01:00
Johan Hovold b1c7c57f5a Input: twl4030-vibra - fix sibling-node lookup
commit 5b18920199 upstream.

A helper purported to look up a child node based on its name was using
the wrong of-helper and ended up prematurely freeing the parent of-node
while searching the whole device tree depth-first starting at the parent
node.

Fixes: 64b9e4d803 ("input: twl4030-vibra: Support for DT booted kernel")
Fixes: e661d0a044 ("Input: twl4030-vibra - fix ERROR: Bad of_node_put() warning")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-23 19:58:16 +01:00
Johan Hovold aabc966e7b Input: twl6040-vibra - fix child-node lookup
commit dcaf12a8b0 upstream.

Fix child-node lookup during probe, which ended up searching the whole
device tree depth-first starting at parent rather than just matching on
its children.

Later sanity checks on node properties (which would likely be missing)
should prevent this from causing much trouble however, especially as the
original premature free of the parent node has already been fixed
separately (but that "fix" was apparently never backported to stable).

Fixes: e7ec014a47 ("Input: twl6040-vibra - update for device tree support")
Fixes: c52c545ead ("Input: twl6040-vibra - fix DT node memory management")
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: H. Nikolaus Schaller <hns@goldelico.com> (on Pyra OMAP5 hardware)
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-23 19:58:16 +01:00
Johan Hovold 1bb19ef3ea Input: 88pm860x-ts - fix child-node lookup
commit 906bf7daa0 upstream.

Fix child node-lookup during probe, which ended up searching the whole
device tree depth-first starting at parent rather than just matching on
its children.

To make things worse, the parent node was prematurely freed, while the
child node was leaked.

Fixes: 2e57d56747 ("mfd: 88pm860x: Device tree support")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-23 19:58:16 +01:00
Nick Desaulniers b276eae883 Input: synaptics-rmi4 - prevent UAF reported by KASAN
commit 55edde9fff upstream.

KASAN found a UAF due to dangling pointer. As the report below says,
rmi_f11_attention() accesses drvdata->attn_data.data, which was freed in
rmi_irq_fn.

[  311.424062] BUG: KASAN: use-after-free in rmi_f11_attention+0x526/0x5e0 [rmi_core]
[  311.424067] Read of size 27 at addr ffff88041fd610db by task irq/131-i2c_hid/1162
[  311.424075] CPU: 0 PID: 1162 Comm: irq/131-i2c_hid Not tainted 4.15.0-rc8+ #2
[  311.424076] Hardware name: Razer Blade Stealth/Razer, BIOS 6.05 01/26/2017
[  311.424078] Call Trace:
[  311.424086]  dump_stack+0xae/0x12d
[  311.424090]  ? _atomic_dec_and_lock+0x103/0x103
[  311.424094]  ? show_regs_print_info+0xa/0xa
[  311.424099]  ? input_handle_event+0x10b/0x810
[  311.424104]  print_address_description+0x65/0x229
[  311.424108]  kasan_report.cold.5+0xa7/0x281
[  311.424117]  rmi_f11_attention+0x526/0x5e0 [rmi_core]
[  311.424123]  ? memcpy+0x1f/0x50
[  311.424132]  ? rmi_f11_attention+0x526/0x5e0 [rmi_core]
[  311.424143]  ? rmi_f11_probe+0x1e20/0x1e20 [rmi_core]
[  311.424153]  ? rmi_process_interrupt_requests+0x220/0x2a0 [rmi_core]
[  311.424163]  ? rmi_irq_fn+0x22c/0x270 [rmi_core]
[  311.424173]  ? rmi_process_interrupt_requests+0x2a0/0x2a0 [rmi_core]
[  311.424177]  ? free_irq+0xa0/0xa0
[  311.424180]  ? irq_finalize_oneshot.part.39+0xeb/0x180
[  311.424190]  ? rmi_process_interrupt_requests+0x2a0/0x2a0 [rmi_core]
[  311.424193]  ? irq_thread_fn+0x3d/0x80
[  311.424197]  ? irq_finalize_oneshot.part.39+0x180/0x180
[  311.424200]  ? irq_thread+0x21d/0x290
[  311.424203]  ? irq_thread_check_affinity+0x170/0x170
[  311.424207]  ? remove_wait_queue+0x150/0x150
[  311.424212]  ? kasan_unpoison_shadow+0x30/0x40
[  311.424214]  ? __init_waitqueue_head+0xa0/0xd0
[  311.424218]  ? task_non_contending.cold.55+0x18/0x18
[  311.424221]  ? irq_forced_thread_fn+0xa0/0xa0
[  311.424226]  ? irq_thread_check_affinity+0x170/0x170
[  311.424230]  ? kthread+0x19e/0x1c0
[  311.424233]  ? kthread_create_worker_on_cpu+0xc0/0xc0
[  311.424237]  ? ret_from_fork+0x32/0x40

[  311.424244] Allocated by task 899:
[  311.424249]  kasan_kmalloc+0xbf/0xe0
[  311.424252]  __kmalloc_track_caller+0xd9/0x1f0
[  311.424255]  kmemdup+0x17/0x40
[  311.424264]  rmi_set_attn_data+0xa4/0x1b0 [rmi_core]
[  311.424269]  rmi_raw_event+0x10b/0x1f0 [hid_rmi]
[  311.424278]  hid_input_report+0x1a8/0x2c0 [hid]
[  311.424283]  i2c_hid_irq+0x146/0x1d0 [i2c_hid]
[  311.424286]  irq_thread_fn+0x3d/0x80
[  311.424288]  irq_thread+0x21d/0x290
[  311.424291]  kthread+0x19e/0x1c0
[  311.424293]  ret_from_fork+0x32/0x40

[  311.424296] Freed by task 1162:
[  311.424300]  kasan_slab_free+0x71/0xc0
[  311.424303]  kfree+0x90/0x190
[  311.424311]  rmi_irq_fn+0x1b2/0x270 [rmi_core]
[  311.424319]  rmi_irq_fn+0x257/0x270 [rmi_core]
[  311.424322]  irq_thread_fn+0x3d/0x80
[  311.424324]  irq_thread+0x21d/0x290
[  311.424327]  kthread+0x19e/0x1c0
[  311.424330]  ret_from_fork+0x32/0x40

[  311.424334] The buggy address belongs to the object at ffff88041fd610c0 which belongs to the cache kmalloc-64 of size 64
[  311.424340] The buggy address is located 27 bytes inside of 64-byte region [ffff88041fd610c0, ffff88041fd61100)
[  311.424344] The buggy address belongs to the page:
[  311.424348] page:ffffea00107f5840 count:1 mapcount:0 mapping: (null) index:0x0
[  311.424353] flags: 0x17ffffc0000100(slab)
[  311.424358] raw: 0017ffffc0000100 0000000000000000 0000000000000000 00000001802a002a
[  311.424363] raw: dead000000000100 dead000000000200 ffff8804228036c0 0000000000000000
[  311.424366] page dumped because: kasan: bad access detected

[  311.424369] Memory state around the buggy address:
[  311.424373]  ffff88041fd60f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[  311.424377]  ffff88041fd61000: fb fb fb fb fb fb fb fb fc fc fc fc fb fb fb fb
[  311.424381] >ffff88041fd61080: fb fb fb fb fc fc fc fc fb fb fb fb fb fb fb fb
[  311.424384]                                                     ^
[  311.424387]  ffff88041fd61100: fc fc fc fc fb fb fb fb fb fb fb fb fc fc fc fc
[  311.424391]  ffff88041fd61180: fb fb fb fb fb fb fb fb fc fc fc fc fb fb fb fb

Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-23 19:58:16 +01:00
Nir Perry e86e5430b3 Input: ALPS - fix multi-touch decoding on SS4 plus touchpads
commit 4d94e776bd upstream.

The fix for handling two-finger scroll (i4a646580f793 - "Input: ALPS -
fix two-finger scroll breakage in right side on ALPS touchpad")
introduced a minor "typo" that broke decoding of multi-touch events are
decoded on some ALPS touchpads.  For example, tapping with three-fingers
can no longer be used to emulate middle-mouse-button (the kernel doesn't
recognize this as the proper event, and doesn't report it correctly to
userspace).  This affects touchpads that use SS4 "plus" protocol
variant, like those found on Dell E7270 & E7470 laptops (tested on
E7270).

First, probably the code in alps_decode_ss4_v2() for case
SS4_PACKET_ID_MULTI used inconsistent indices to "f->mt[]". You can see
0 & 1 are used for the "if" part but 2 & 3 are used for the "else" part.

Second, in the previous patch, new macros were introduced to decode X
coordinates specific to the SS4 "plus" variant, but the macro to
define the maximum X value wasn't changed accordingly. The macros to
decode X values for "plus" variant are effectively shifted right by 1
bit, but the max wasn't shifted too. This causes the driver to
incorrectly handle "no data" cases, which also interfered with how
multi-touch was handled.

Fixes: 4a646580f7 ("Input: ALPS - fix two-finger scroll breakage...")
Signed-off-by: Nir Perry <nirperry@gmail.com>
Reviewed-by: Masaki Ota <masaki.ota@jp.alps.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-23 19:58:15 +01:00
Aaron Ma 2df832f7aa Input: elantech - add new icbody type 15
commit 10d900303f upstream.

The touchpad of Lenovo Thinkpad L480 reports it's version as 15.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10 09:31:21 +01:00
Juergen Gross 399bbc9bb6 x86/virt: Add enum for hypervisors to replace x86_hyper
commit 03b2a320b1 upstream.

The x86_hyper pointer is only used for checking whether a virtual
device is supporting the hypervisor the system is running on.

Use an enum for that purpose instead and drop the x86_hyper pointer.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Xavier Deguillard <xdeguillard@vmware.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: akataria@vmware.com
Cc: arnd@arndb.de
Cc: boris.ostrovsky@oracle.com
Cc: devel@linuxdriverproject.org
Cc: dmitry.torokhov@gmail.com
Cc: gregkh@linuxfoundation.org
Cc: haiyangz@microsoft.com
Cc: kvm@vger.kernel.org
Cc: kys@microsoft.com
Cc: linux-graphics-maintainer@vmware.com
Cc: linux-input@vger.kernel.org
Cc: moltmann@vmware.com
Cc: pbonzini@redhat.com
Cc: pv-drivers@vmware.com
Cc: rkrcmar@redhat.com
Cc: sthemmin@microsoft.com
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20171109132739.23465-3-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-25 14:26:20 +01:00
Linus Torvalds 60cfc98b24 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input layer updates from Dmitry Torokhov:

 - a new ACPI ID for Elan touchpad found in yet another Ideapad model

 - Synaptics RMI4 will allow binding to controllers reporting SMB
   version 3 (note that we are not adding any new ACPI IDs to the
   Synaptics PS/2 drover so unless user explicitly enables intertouch
   support there is no user-visible change)

 - a fixup to TSC 2004/5 touchscreen driver to mark input devices as
   "direct" to help userspace identify the type of device they are
   dealing with

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: synaptics-rmi4 - RMI4 can also use SMBUS version 3
  Input: tsc200x-core - set INPUT_PROP_DIRECT
  Input: elan_i2c - add ELAN060C to the ACPI table
2017-11-10 14:14:23 -08:00
Yiannis Marangos 26dd633e43 Input: synaptics-rmi4 - RMI4 can also use SMBUS version 3
Some Synaptics devices, such as LEN0073, use SMBUS version 3.

Signed-off-by: Yiannis Marangos <yiannis.marangos@gmail.com>
Acked-by: Benjamin Tissoires <benjamion.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-11-07 17:45:07 -08:00
Martin Kepplinger eca253912f Input: tsc200x-core - set INPUT_PROP_DIRECT
If INPUT_PROP_DIRECT is set, userspace doesn't have to fall back to old
ways of identifying touchscreen devices.

In order to identify a touchscreen device, Android for example, seems to
already depend on INPUT_PROP_DIRECT to be present in drivers. udev still
checks for either BTN_TOUCH or INPUT_PROP_DIRECT. Checking for BTN_TOUCH
however can quite easily lead to false positives; it's a code that not only
touchscreen device drivers use.

According to the documentation, touchscreen drivers should have this
property set and in order to make life easy for userspace, let's set it.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-11-07 17:44:56 -08:00