Commit Graph

5685 Commits

Author SHA1 Message Date
ce94943ffc 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)
2019-02-12 10:32:56 +08:00
5773b61e2f 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>
2019-02-12 10:32:36 +08:00
99396ee388 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>
2019-02-12 10:32:14 +08:00
28363e4c22 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
2019-02-12 10:31:08 +08:00
c27af72052 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>
2019-02-12 10:31:04 +08:00
bd5469e537 MLK-17829 touchscreen: Add synaptics_dsx S3508 i2c touch driver
Add S3508 touch driver support.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2019-02-12 10:30:59 +08:00
1e03bfc519 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)
2019-02-12 10:29:35 +08:00
140a054f7c 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>
2019-02-12 10:29:11 +08:00
2238e1d437 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)
2019-02-12 10:28:23 +08:00
98d6bd67e3 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>
2019-02-12 10:28:14 +08:00
59559499c6 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>
2019-02-12 10:27:50 +08:00
b619a9ead4 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>
2019-02-12 10:27:40 +08:00
76be690508 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>
2019-02-12 10:27:12 +08:00
f8c447594a 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>
2019-02-12 10:26:15 +08:00
52494604d4 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)
2019-02-12 10:26:12 +08:00
1f497f31f3 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>
2019-02-12 10:26:05 +08:00
ee8c64fa88 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)
2019-02-12 10:25:58 +08:00
219cb98d1e 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>
2019-02-12 10:25:28 +08:00
a1791ffd5e 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 f75c35512b)
2019-02-12 10:25:27 +08:00
db2a800282 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 307d613b1f)
2019-02-12 10:25:27 +08:00
d9e976e0ad 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 529dee44f7)
2019-02-12 10:25:26 +08:00
f5aca0582b 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>
2019-02-12 10:25:10 +08:00
816cfcc2b9 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>
2019-02-12 10:25:04 +08:00
a160e6ec7b 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>
2019-02-12 10:25:02 +08:00
318904dad2 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>
2019-02-12 10:24:14 +08:00
00099d3aeb 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>
2019-02-12 10:24:08 +08:00
34cdc47450 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 20180719c5)
2019-02-12 10:24:03 +08:00
2fa37dca8a 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>
2019-02-12 10:23:59 +08:00
5d955b364f 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>
2019-02-12 10:23:29 +08:00
42892f9202 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 f7d40aa30c)
2019-02-12 10:23:28 +08:00
04fd48094f 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 095c876a12)
2019-02-12 10:23:23 +08:00
e639248628 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)
2019-02-12 10:23:00 +08:00
e818f83391 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)
2019-02-12 10:23:00 +08:00
8ade0b80a7 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)
2019-02-12 10:23:00 +08:00
1cd784c222 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)
2019-02-12 10:21:29 +08:00
79f4c7473e 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)
2019-02-12 10:21:28 +08:00
16bf758cad 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)
2019-02-12 10:21:28 +08:00
28edadd147 Input: uinput - fix undefined behavior in uinput_validate_absinfo()
commit d77651a227 upstream.

An integer overflow may arise in uinput_validate_absinfo() if "max - min"
can't be represented by an "int". We should check for overflow before
trying to use the result.

Reported-by: Kyungtae Kim <kt0755@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-31 08:13:45 +01:00
f2b63cc459 Input: xpad - add support for SteelSeries Stratus Duo
commit fe2bfd0d40 upstream.

Add support for the SteelSeries Stratus Duo, a wireless Xbox 360
controller. The Stratus Duo ships with a USB dongle to enable wireless
connectivity, but it can also function as a wired controller by connecting
it directly to a PC via USB, hence the need for two USD PIDs. 0x1430 is the
dongle, and 0x1431 is the controller.

Signed-off-by: Tom Panfil <tom@steelseries.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-31 08:13:45 +01:00
dd707bdce2 Input: synaptics - enable SMBus for HP EliteBook 840 G4
[ Upstream commit 7a71712293 ]

dmesg reports that "Your touchpad (PNP: SYN3052 SYN0100 SYN0002 PNP0f13)
says it can support a different bus."

I've tested the offered psmouse.synaptics_intertouch=1 with 4.18.x and
4.19.x and it seems to work well. No problems seen with suspend/resume.

Also, it appears that RMI/SMBus mode is actually required for 3-4 finger
multitouch gestures to work -- otherwise they are not reported at all.

Information from dmesg in both modes:

  psmouse serio3: synaptics: Touchpad model: 1, fw: 8.2, id: 0x1e2b1,
      caps: 0xf00123/0x840300/0x2e800/0x0, board id: 3139, fw id: 2000742

  psmouse serio3: synaptics: Trying to set up SMBus access
  rmi4_smbus 6-002c: registering SMbus-connected sensor
  rmi4_f01 rmi4-00.fn01: found RMI device,
      manufacturer: Synaptics, product: TM3139-001, fw id: 2000742

Signed-off-by: Mantas Mikulėnas <grawity@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-01-13 10:01:01 +01:00
154ed1efea Input: synaptics - enable RMI on ThinkPad T560
[ Upstream commit ca5047286c ]

Before commit 7fd6d98b89 ("i2c: i801: Allow ACPI AML access I/O
ports not reserved for SMBus"), enabling RMI on the T560 would cause
the touchpad to stop working after resuming from suspend. Now that
this issue is fixed, RMI can be enabled safely and works fine.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Yussuf Khalil <dev@pp3345.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-01-13 10:00:57 +01:00
6989cedd76 Input: omap-keypad - fix idle configuration to not block SoC idle states
[ Upstream commit e2ca26ec4f ]

With PM enabled, I noticed that pressing a key on the droid4 keyboard will
block deeper idle states for the SoC. Let's fix this by using IRQF_ONESHOT
and stop constantly toggling the device OMAP4_KBD_IRQENABLE register as
suggested by Dmitry Torokhov <dmitry.torokhov@gmail.com>.

From the hardware point of view, looks like we need to manage the registers
for OMAP4_KBD_IRQENABLE and OMAP4_KBD_WAKEUPENABLE together to avoid
blocking deeper SoC idle states. And with toggling of OMAP4_KBD_IRQENABLE
register now gone with IRQF_ONESHOT, also the SoC idle state problem is
gone during runtime. We still also need to clear OMAP4_KBD_WAKEUPENABLE in
omap4_keypad_close() though to pair it with omap4_keypad_open() to prevent
blocking deeper SoC idle states after rmmod omap4-keypad.

Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-01-13 10:00:57 +01:00
9023f52fd3 Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G
commit 7db54c89f0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-09 17:14:48 +01:00
647492ad73 Input: omap-keypad - fix keyboard debounce configuration
[ Upstream commit 6c3516fed7 ]

I noticed that the Android v3.0.8 kernel on droid4 is using different
keypad values from the mainline kernel and does not have issues with
keys occasionally being stuck until pressed again. Turns out there was
an earlier patch posted to fix this as "Input: omap-keypad: errata i689:
Correct debounce time", but it was never reposted to fix use macros
for timing calculations.

This updated version is using macros, and also fixes the use of the
input clock rate to use 32768KiHz instead of 32000KiHz. And we want to
use the known good Android kernel values of 3 and 6 instead of 2 and 6
in the earlier patch.

Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:13:15 +01:00
2dc84c590c Input: synaptics - enable SMBus for HP 15-ay000
[ Upstream commit 5a6dab15f7 ]

SMBus works fine for the touchpad with id SYN3221, used in the HP 15-ay000
series,

This device has been reported in these messages in the "linux-input"
mailing list:
* https://marc.info/?l=linux-input&m=152016683003369&w=2
* https://www.spinics.net/lists/linux-input/msg52525.html

Reported-by: Nitesh Debnath <niteshkd1999@gmail.com>
Reported-by: Teika Kazura <teika@gmx.com>
Signed-off-by: Teika Kazura <teika@gmx.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:13:15 +01:00
ce28c745aa Input: hyper-v - fix wakeup from suspend-to-idle
[ Upstream commit 10f91c73cc ]

It makes little sense but still possible to put Hyper-V guests into
suspend-to-idle state. To wake them up two wakeup sources were registered
in the past: hyperv-keyboard and hid-hyperv. However, since
commit eed4d47efe ("ACPI / sleep: Ignore spurious SCI wakeups from
suspend-to-idle") pm_wakeup_event() from these devices is ignored. Switch
to pm_wakeup_hard_event() API as these devices are actually the only
possible way to wakeup Hyper-V guests.

Fixes: eed4d47efe (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle)
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: K. Y. Srinivasan <kys@microsoft.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-21 14:13:11 +01:00
61ffe9b932 Input: elan_i2c - add support for ELAN0621 touchpad
commit bf87ade0dd upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-08 13:03:39 +01:00
ec2c95c56b Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15ARR
commit ad33429cd0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-08 13:03:39 +01:00
1151c09851 Input: elan_i2c - add ELAN0620 to the ACPI table
commit 3ed64da3b7 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-08 13:03:39 +01:00
4121029c43 Input: cros_ec_keyb - fix button/switch capability reports
commit ac5722c164 upstream.

The cros_ec_keyb_bs array lists buttons and switches together, expecting
that its users will match the appropriate type and bit fields. But
cros_ec_keyb_register_bs() only checks the 'bit' field, which causes
misreported input capabilities in some cases. For example, tablets
(e.g., Scarlet -- a.k.a. Acer Chromebook Tab 10) were reporting a SW_LID
capability, because EC_MKBP_POWER_BUTTON and EC_MKBP_LID_OPEN happen to
share the same bit.

(This has comedic effect on a tablet, in which a power-management daemon
then thinks this "lid" is closed, and so puts the system to sleep as
soon as it boots!)

To fix this, check both the 'ev_type' and 'bit' fields before reporting
the capability.

Tested with a lid (Kevin / Samsung Chromebook Plus) and without a lid
(Scarlet / Acer Chromebook Tab 10).

This error got introduced when porting the feature from the downstream
Chromium OS kernel to be upstreamed.

Fixes: cdd7950e7a ("input: cros_ec_keyb: Add non-matrix buttons and switches")
Cc: <stable@vger.kernel.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-08 13:03:39 +01:00