* [PATCH 3/7] dt-bindings: input: touchscreen: sx8654: add compatible models
From: Richard Leitner @ 2018-10-16 9:16 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: linux-input, devicetree, linux-kernel, Richard Leitner
In-Reply-To: <20181016091653.26896-1-richard.leitner@skidata.com>
As the sx865[456] share the same datasheet and differ only in the
presence of a "capacitive proximity detection circuit" and a "haptics
motor driver for LRA/ERM" add them to the compatbiles. As the driver
doesn't implement these features it should be no problem.
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
---
Documentation/devicetree/bindings/input/touchscreen/sx8654.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/input/touchscreen/sx8654.txt b/Documentation/devicetree/bindings/input/touchscreen/sx8654.txt
index ca521d8f7d65..a538678424dd 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/sx8654.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/sx8654.txt
@@ -1,7 +1,10 @@
* Semtech SX8654 I2C Touchscreen Controller
Required properties:
-- compatible: must be "semtech,sx8654"
+- compatible: must be one of the following, depending on the model:
+ "semtech,sx8654"
+ "semtech,sx8655"
+ "semtech,sx8656"
- reg: i2c slave address
- interrupts: touch controller interrupt
--
2.11.0
^ permalink raw reply related
* [PATCH 2/7] Input: sx8654 - add reset-gpio support
From: Richard Leitner @ 2018-10-16 9:16 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: linux-input, devicetree, linux-kernel, Richard Leitner
In-Reply-To: <20181016091653.26896-1-richard.leitner@skidata.com>
The sx8654 features a NRST input which may be connected to a GPIO.
Therefore add support for hard-resetting the sx8654 via this NRST.
If the reset-gpio property is provided the sx8654 is resetted via NRST
instead of the soft-reset via I2C.
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
---
drivers/input/touchscreen/sx8654.c | 88 ++++++++++++++++++++++++++++++++------
1 file changed, 74 insertions(+), 14 deletions(-)
diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c
index ed29db3ec731..059127490c8d 100644
--- a/drivers/input/touchscreen/sx8654.c
+++ b/drivers/input/touchscreen/sx8654.c
@@ -33,6 +33,8 @@
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <linux/gpio/consumer.h>
+#include <linux/delay.h>
/* register addresses */
#define I2C_REG_TOUCH0 0x00
@@ -74,6 +76,7 @@
struct sx8654 {
struct input_dev *input;
struct i2c_client *client;
+ struct gpio_desc *gpio_reset;
};
static irqreturn_t sx8654_irq(int irq, void *handle)
@@ -124,6 +127,27 @@ static irqreturn_t sx8654_irq(int irq, void *handle)
return IRQ_HANDLED;
}
+static int sx8654_reset(struct sx8654 *ts)
+{
+ int err;
+
+ if (ts->gpio_reset) {
+ gpiod_set_value_cansleep(ts->gpio_reset, 1);
+ udelay(2); /* Tpulse > 1µs */
+ gpiod_set_value_cansleep(ts->gpio_reset, 0);
+
+ return 0;
+ }
+
+ dev_dbg(&ts->client->dev, "NRST unavailable, try softreset\n");
+ err = i2c_smbus_write_byte_data(ts->client, I2C_REG_SOFTRESET,
+ SOFTRESET_VALUE);
+ if (err)
+ return err;
+
+ return 0;
+}
+
static int sx8654_open(struct input_dev *dev)
{
struct sx8654 *sx8654 = input_get_drvdata(dev);
@@ -171,6 +195,44 @@ static void sx8654_close(struct input_dev *dev)
}
}
+#ifdef CONFIG_OF
+static int sx8654_get_ofdata(struct sx8654 *ts)
+{
+ struct device *dev = &ts->client->dev;
+ struct device_node *node = dev->of_node;
+ int err;
+
+ if (!node) {
+ ts->gpio_reset = NULL;
+ return 0;
+ }
+
+ ts->gpio_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
+ if (PTR_ERR(ts->gpio_reset) == -EPROBE_DEFER) {
+ return -EPROBE_DEFER;
+ } else if (IS_ERR(ts->gpio_reset)) {
+ err = PTR_ERR(ts->gpio_reset);
+ dev_err(dev, "unable to request GPIO reset pin (%d)\n", err);
+ return err;
+ }
+ dev_dbg(dev, "got GPIO reset pin\n");
+
+ return 0;
+}
+
+static const struct of_device_id sx8654_of_match[] = {
+ { .compatible = "semtech,sx8654", },
+ { },
+};
+MODULE_DEVICE_TABLE(of, sx8654_of_match);
+#else /* CONFIG_OF */
+static int sx8654_get_ofdata(struct sx8654 *ts)
+{
+ ts->gpio_reset = NULL;
+ return 0;
+}
+#endif /* CONFIG_OF */
+
static int sx8654_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -186,10 +248,20 @@ static int sx8654_probe(struct i2c_client *client,
if (!sx8654)
return -ENOMEM;
+ sx8654->client = client;
+
+ error = sx8654_get_ofdata(sx8654);
+ if (error) {
+ dev_err(&client->dev, "get_ofdata failed: %d\n", error);
+ return error;
+ }
+
input = devm_input_allocate_device(&client->dev);
if (!input)
return -ENOMEM;
+ sx8654->input = input;
+
input->name = "SX8654 I2C Touchscreen";
input->id.bustype = BUS_I2C;
input->dev.parent = &client->dev;
@@ -201,15 +273,11 @@ static int sx8654_probe(struct i2c_client *client,
input_set_abs_params(input, ABS_X, 0, MAX_12BIT, 0, 0);
input_set_abs_params(input, ABS_Y, 0, MAX_12BIT, 0, 0);
- sx8654->client = client;
- sx8654->input = input;
-
input_set_drvdata(sx8654->input, sx8654);
- error = i2c_smbus_write_byte_data(client, I2C_REG_SOFTRESET,
- SOFTRESET_VALUE);
+ error = sx8654_reset(sx8654);
if (error) {
- dev_err(&client->dev, "writing softreset value failed");
+ dev_err(&client->dev, "reset failed");
return error;
}
@@ -256,14 +324,6 @@ static int sx8654_probe(struct i2c_client *client,
return 0;
}
-#ifdef CONFIG_OF
-static const struct of_device_id sx8654_of_match[] = {
- { .compatible = "semtech,sx8654", },
- { },
-};
-MODULE_DEVICE_TABLE(of, sx8654_of_match);
-#endif
-
static const struct i2c_device_id sx8654_id_table[] = {
{ "semtech_sx8654", 0 },
{ },
--
2.11.0
^ permalink raw reply related
* [PATCH 1/7] dt-bindings: input: touchscreen: sx8654: add reset-gpio property
From: Richard Leitner @ 2018-10-16 9:16 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: linux-input, devicetree, linux-kernel, Richard Leitner
In-Reply-To: <20181016091653.26896-1-richard.leitner@skidata.com>
Document the reset-gpio property for the sx8654 touchscreen controller
driver.
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
---
Documentation/devicetree/bindings/input/touchscreen/sx8654.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/touchscreen/sx8654.txt b/Documentation/devicetree/bindings/input/touchscreen/sx8654.txt
index 4886c4aa2906..ca521d8f7d65 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/sx8654.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/sx8654.txt
@@ -5,6 +5,9 @@ Required properties:
- reg: i2c slave address
- interrupts: touch controller interrupt
+Optional properties:
+ - reset-gpios: GPIO specification for the NRST input
+
Example:
sx8654@48 {
@@ -12,4 +15,5 @@ Example:
reg = <0x48>;
interrupt-parent = <&gpio6>;
interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+ reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
};
--
2.11.0
^ permalink raw reply related
* [PATCH 0/7] Input: sx8654 - reset-gpio, sx865[056] support, etc.
From: Richard Leitner @ 2018-10-16 9:16 UTC (permalink / raw)
To: dmitry.torokhov, robh+dt, mark.rutland
Cc: linux-input, devicetree, linux-kernel, Richard Leitner
Add reset-gpio, sx8654[056] and common of_touchscreen functions support
for the sx8654 driver.
Richard Leitner (7):
dt-bindings: input: touchscreen: sx8654: add reset-gpio property
Input: sx8654 - add reset-gpio support
dt-bindings: input: touchscreen: sx8654: add compatible models
Input: sx8654 - add sx8655 and sx8656 to compatibles
dt-bindings: input: touchscreen: sx8654: add sx8650 to comatibles
Input: sx8654 - add sx8650 support
Input: sx8654 - use common of_touchscreen functions
.../bindings/input/touchscreen/sx8654.txt | 10 +-
drivers/input/touchscreen/sx8654.c | 267 ++++++++++++++++++---
2 files changed, 245 insertions(+), 32 deletions(-)
--
2.11.0
^ permalink raw reply
* Re: [PATCH v2] HID: i2c-hid: Add a small delay after sleep command for Raydium touchpanel
From: Kai Heng Feng @ 2018-10-16 8:41 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Jiri Kosina, Hans de Goede, open list:HID CORE LAYER, lkml
In-Reply-To: <CAO-hwJJACzB4MmPxeyT1ERLyifeC06tg_DU+1PZwOruBf-42TQ@mail.gmail.com>
> On Oct 15, 2018, at 16:04, Benjamin Tissoires <benjamin.tissoires@redhat.com> wrote:
>
> On Fri, Oct 5, 2018 at 6:46 AM Kai-Heng Feng
> <kai.heng.feng@canonical.com> wrote:
>>
>> Raydium touchpanel (2386:4B33) sometimes does not work in desktop session
>> although it works in display manager.
>>
>> During user logging, the display manager exits, close the HID device,
>> then the device gets runtime suspended and powered off. The desktop
>> session begins shortly after, opens the HID device, then the device gets
>> runtime resumed and powered on.
>>
>> If the trasition from display manager to desktop sesesion is fast, the
>> touchpanel cannot switch from powered off to powered on in short
>> timeframe. So add a small delay to workaround the issue.
>>
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>> ---
>> v2:
>> - Use quirk to only match affected touchpanel
>> - Only delay the next power on if the time hasn't elapsed
>
> Hi,
>
> I like the patch much better. And I even would be tempted to have this
> unconditionally enabled now that the general path doesn't have the
> msleep in the middle.
>
> So how about we merge this patch now, and if in the long run we see
> more devices that require this quirk, then we can probably remove the
> specific quirk and make it mandatory?
Of course, that’s totally makes sense.
Thanks for the review.
Kai-Heng
>
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>
> Cheers,
> Benjamin
>
>>
>> drivers/hid/hid-ids.h | 3 +++
>> drivers/hid/i2c-hid/i2c-hid-core.c | 19 +++++++++++++++++++
>> 2 files changed, 22 insertions(+)
>>
>> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
>> index 16342188df19..c1b5f03eb630 100644
>> --- a/drivers/hid/hid-ids.h
>> +++ b/drivers/hid/hid-ids.h
>> @@ -926,6 +926,9 @@
>> #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3003 0x3003
>> #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008
>>
>> +#define I2C_VENDOR_ID_RAYDIUM 0x2386
>> +#define I2C_PRODUCT_ID_RAYDIUM_4B33 0x4b33
>> +
>> #define USB_VENDOR_ID_RAZER 0x1532
>> #define USB_DEVICE_ID_RAZER_BLADE_14 0x011D
>>
>> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
>> index 4aab96cf0818..3cde7c1b9c33 100644
>> --- a/drivers/hid/i2c-hid/i2c-hid-core.c
>> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
>> @@ -49,6 +49,7 @@
>> #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0)
>> #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1)
>> #define I2C_HID_QUIRK_NO_RUNTIME_PM BIT(2)
>> +#define I2C_HID_QUIRK_DELAY_AFTER_SLEEP BIT(3)
>>
>> /* flags */
>> #define I2C_HID_STARTED 0
>> @@ -158,6 +159,8 @@ struct i2c_hid {
>>
>> bool irq_wake_enabled;
>> struct mutex reset_lock;
>> +
>> + unsigned long sleep_delay;
>> };
>>
>> static const struct i2c_hid_quirks {
>> @@ -172,6 +175,8 @@ static const struct i2c_hid_quirks {
>> { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
>> I2C_HID_QUIRK_NO_IRQ_AFTER_RESET |
>> I2C_HID_QUIRK_NO_RUNTIME_PM },
>> + { I2C_VENDOR_ID_RAYDIUM, I2C_PRODUCT_ID_RAYDIUM_4B33,
>> + I2C_HID_QUIRK_DELAY_AFTER_SLEEP },
>> { 0, 0 }
>> };
>>
>> @@ -387,6 +392,7 @@ static int i2c_hid_set_power(struct i2c_client *client, int power_state)
>> {
>> struct i2c_hid *ihid = i2c_get_clientdata(client);
>> int ret;
>> + unsigned long now, delay;
>>
>> i2c_hid_dbg(ihid, "%s\n", __func__);
>>
>> @@ -404,9 +410,22 @@ static int i2c_hid_set_power(struct i2c_client *client, int power_state)
>> goto set_pwr_exit;
>> }
>>
>> + if (ihid->quirks & I2C_HID_QUIRK_DELAY_AFTER_SLEEP &&
>> + power_state == I2C_HID_PWR_ON) {
>> + now = jiffies;
>> + if (time_after(ihid->sleep_delay, now)) {
>> + delay = jiffies_to_usecs(ihid->sleep_delay - now);
>> + usleep_range(delay, delay + 1);
>> + }
>> + }
>> +
>> ret = __i2c_hid_command(client, &hid_set_power_cmd, power_state,
>> 0, NULL, 0, NULL, 0);
>>
>> + if (ihid->quirks & I2C_HID_QUIRK_DELAY_AFTER_SLEEP &&
>> + power_state == I2C_HID_PWR_SLEEP)
>> + ihid->sleep_delay = jiffies + msecs_to_jiffies(20);
>> +
>> if (ret)
>> dev_err(&client->dev, "failed to change power setting.\n");
>>
>> --
>> 2.17.1
^ permalink raw reply
* INFO: task hung in evdev_release
From: syzbot @ 2018-10-16 6:02 UTC (permalink / raw)
To: dmitry.torokhov, linux-input, linux-kernel, rydberg,
syzkaller-bugs
Hello,
syzbot found the following crash on:
HEAD commit: 9dcd936c5312 Merge tag 'for-4.19/dm-fixes-4' of git://git...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1285436e400000
kernel config: https://syzkaller.appspot.com/x/.config?x=88e9a8a39dc0be2d
dashboard link: https://syzkaller.appspot.com/bug?extid=a979743610b4755d4d57
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10fcd826400000
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+a979743610b4755d4d57@syzkaller.appspotmail.com
team0 (unregistering): Port device team_slave_0 removed
bond0 (unregistering): Releasing backup interface bond_slave_1
bond0 (unregistering): Releasing backup interface bond_slave_0
bond0 (unregistering): Released all slaves
kworker/dying (307) used greatest stack depth: 14800 bytes left
INFO: task syz-executor0:17271 blocked for more than 140 seconds.
Not tainted 4.19.0-rc7+ #55
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor0 D19016 17271 15650 0x80000002
Call Trace:
context_switch kernel/sched/core.c:2825 [inline]
__schedule+0x86c/0x1ed0 kernel/sched/core.c:3473
schedule+0xfe/0x460 kernel/sched/core.c:3517
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:3575
__mutex_lock_common kernel/locking/mutex.c:1002 [inline]
__mutex_lock+0xbe7/0x1700 kernel/locking/mutex.c:1072
mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087
evdev_release+0x8a/0x1e0 drivers/input/evdev.c:477
__fput+0x385/0xa30 fs/file_table.c:278
____fput+0x15/0x20 fs/file_table.c:309
task_work_run+0x1e8/0x2a0 kernel/task_work.c:113
exit_task_work include/linux/task_work.h:22 [inline]
do_exit+0x1ad7/0x2610 kernel/exit.c:867
do_group_exit+0x177/0x440 kernel/exit.c:970
get_signal+0x8b0/0x1980 kernel/signal.c:2513
do_signal+0x9c/0x21e0 arch/x86/kernel/signal.c:816
exit_to_usermode_loop+0x2e5/0x380 arch/x86/entry/common.c:162
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457519
Code: 44 0f 7f 41 b0 f3 44 0f 7f 49 c0 f3 44 0f 7f 51 d0 f3 44 0f 7f 59 e0
f3 44 0f 7f 61 f0 c3 48 89 f8 f3 0f 6f 2e f3 0f 6f 76 10 <48> 01 df f3 0f
6f 7e 20 f3 44 0f 6f 46 30 4c 8d 57 e0 49 89 fb f3
RSP: 002b:00007f6cd89eccf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 000000000072bfa8 RCX: 0000000000457519
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000072bfa8
RBP: 000000000072bfa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000072bfac
R13: 00007ffda1adeb1f R14: 00007f6cd89ed9c0 R15: 0000000000000001
INFO: task syz-executor1:19103 blocked for more than 140 seconds.
Not tainted 4.19.0-rc7+ #55
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor1 D23568 19103 17558 0x00000004
Call Trace:
context_switch kernel/sched/core.c:2825 [inline]
__schedule+0x86c/0x1ed0 kernel/sched/core.c:3473
schedule+0xfe/0x460 kernel/sched/core.c:3517
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:3575
__mutex_lock_common kernel/locking/mutex.c:1002 [inline]
__mutex_lock+0xbe7/0x1700 kernel/locking/mutex.c:1072
mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087
evdev_close_device drivers/input/evdev.c:447 [inline]
evdev_release+0xfe/0x1e0 drivers/input/evdev.c:488
__fput+0x385/0xa30 fs/file_table.c:278
____fput+0x15/0x20 fs/file_table.c:309
task_work_run+0x1e8/0x2a0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:193 [inline]
exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x410ff1
Code: 30 48 89 4c 24 10 e8 8e 09 00 00 48 8b 44 24 28 48 89 04 24 48 8b 44
24 30 48 89 44 24 08 e8 36 5d 04 00 48 8b 6c 24 18 48 83 <c4> 20 c3 cc cc
cc cc cc cc cc cc cc cc cc cc 64 48 8b 0c 25 f8 ff
RSP: 002b:00007ffe35943940 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000007 RCX: 0000000000410ff1
RDX: 0000000000000000 RSI: 0000000000730488 RDI: 0000000000000006
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 00007ffe35943870 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000001 R14: 000000000000000e R15: 0000000000000001
INFO: task syz-executor2:19141 blocked for more than 140 seconds.
Not tainted 4.19.0-rc7+ #55
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
syz-executor2 D23568 19141 18263 0x00000006
Call Trace:
context_switch kernel/sched/core.c:2825 [inline]
__schedule+0x86c/0x1ed0 kernel/sched/core.c:3473
schedule+0xfe/0x460 kernel/sched/core.c:3517
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:3575
__mutex_lock_common kernel/locking/mutex.c:1002 [inline]
__mutex_lock+0xbe7/0x1700 kernel/locking/mutex.c:1072
mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087
evdev_close_device drivers/input/evdev.c:447 [inline]
evdev_release+0xfe/0x1e0 drivers/input/evdev.c:488
__fput+0x385/0xa30 fs/file_table.c:278
____fput+0x15/0x20 fs/file_table.c:309
task_work_run+0x1e8/0x2a0 kernel/task_work.c:113
get_signal+0x155e/0x1980 kernel/signal.c:2343
do_signal+0x9c/0x21e0 arch/x86/kernel/signal.c:816
exit_to_usermode_loop+0x2e5/0x380 arch/x86/entry/common.c:162
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x410ff1
Code: 30 48 89 4c 24 10 e8 8e 09 00 00 48 8b 44 24 28 48 89 04 24 48 8b 44
24 30 48 89 44 24 08 e8 36 5d 04 00 48 8b 6c 24 18 48 83 <c4> 20 c3 cc cc
cc cc cc cc cc cc cc cc cc cc 64 48 8b 0c 25 f8 ff
RSP: 002b:00007ffd4fba6dd0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000410ff1
RDX: 0000000000000000 RSI: 0000000000730488 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 00007ffd4fba6d00 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000000000009 R15: 0000000000000002
INFO: lockdep is turned off.
NMI backtrace for cpu 0
CPU: 0 PID: 983 Comm: khungtaskd Not tainted 4.19.0-rc7+ #55
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113
nmi_cpu_backtrace.cold.3+0x63/0xa2 lib/nmi_backtrace.c:101
nmi_trigger_cpumask_backtrace+0x1b3/0x1ed lib/nmi_backtrace.c:62
arch_trigger_cpumask_backtrace+0x14/0x20 arch/x86/kernel/apic/hw_nmi.c:38
trigger_all_cpu_backtrace include/linux/nmi.h:144 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:204 [inline]
watchdog+0xb3e/0x1050 kernel/hung_task.c:265
kthread+0x35a/0x420 kernel/kthread.c:246
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.19.0-rc7+ #55
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:tick_nohz_update_jiffies kernel/time/tick-sched.c:502 [inline]
RIP: 0010:tick_nohz_irq_enter kernel/time/tick-sched.c:1232 [inline]
RIP: 0010:tick_irq_enter+0x279/0x3e0 kernel/time/tick-sched.c:1249
Code: 00 0f 84 02 01 00 00 e8 35 98 0d 00 48 89 df 57 9d 0f 1f 44 00 00 e8
d6 a6 13 00 e8 21 98 0d 00 e8 cc c1 0d 00 e9 1e fe ff ff <e8> 12 98 0d 00
e8 9d 16 1c 02 31 c9 4c 89 f2 48 89 de 89 c7 e8 2e
RSP: 0018:ffff8801daf07c98 EFLAGS: 00000002
RAX: 0000000000000000 RBX: ffff8801daf26460 RCX: ffffffff81713bf5
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000001
RBP: ffff8801daf07cc8 R08: ffff8801d9b103c0 R09: 000000000000000a
R10: fffffbfff145fa09 R11: 0000000000000001 R12: 0000000000000017
R13: ffff8801daf264ac R14: 000000deb5875cd2 R15: 0000000000000004
FS: 0000000000000000(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600400 CR3: 00000001bf8a0000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<IRQ>
irq_enter+0xbd/0xe0 kernel/softirq.c:353
scheduler_ipi+0x3d0/0xad0 kernel/sched/core.c:1770
smp_reschedule_interrupt+0x109/0x650 arch/x86/kernel/smp.c:278
reschedule_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:888
</IRQ>
RIP: 0010:native_safe_halt+0x6/0x10 arch/x86/include/asm/irqflags.h:57
Code: e9 2c ff ff ff 48 89 c7 48 89 45 d8 e8 63 eb 11 fa 48 8b 45 d8 e9 ca
fe ff ff 48 89 df e8 52 eb 11 fa eb 82 55 48 89 e5 fb f4 <5d> c3 0f 1f 84
00 00 00 00 00 55 48 89 e5 f4 5d c3 90 90 90 90 90
RSP: 0018:ffff8801d9b1fc30 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff02
RAX: dffffc0000000000 RBX: 1ffff1003b363f8a RCX: ffffffff8184e1ca
RDX: 1ffffffff1263e54 RSI: ffffffff8184e1e4 RDI: ffffffff8931f2a0
RBP: ffff8801d9b1fc30 R08: ffff8801d9b103c0 R09: ffffed003b5e4732
R10: ffffed003b5e4732 R11: ffff8801daf23993 R12: ffff8801d9b1fcf0
R13: ffffffff89f3bee0 R14: 0000000000000000 R15: 0000000000000001
arch_safe_halt arch/x86/include/asm/paravirt.h:94 [inline]
default_idle+0xbf/0x490 arch/x86/kernel/process.c:498
arch_cpu_idle+0x10/0x20 arch/x86/kernel/process.c:489
default_idle_call+0x6d/0x90 kernel/sched/idle.c:93
cpuidle_idle_call kernel/sched/idle.c:153 [inline]
do_idle+0x3db/0x5b0 kernel/sched/idle.c:262
cpu_startup_entry+0x10c/0x120 kernel/sched/idle.c:368
start_secondary+0x447/0x5f0 arch/x86/kernel/smpboot.c:271
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243
---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches
^ permalink raw reply
* Re: 2nd Fan quirk for Thinkpad P50 causes spurios touchpad/trackpoint events on ThinkPad L570
From: Dmitry Torokhov @ 2018-10-16 0:11 UTC (permalink / raw)
To: jaak-89mTbI93R4uuvFJfX82//w
Cc: agk-mA9ux5SlULTR7s880joybQ, Pali Rohár, Platform Driver,
ibm-acpi-devel, Henrique de Moraes Holschuh,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Andy Shevchenko
In-Reply-To: <36111ed4-621c-47a8-bc6a-66cf756a0ac6-89mTbI93R4uuvFJfX82//w@public.gmane.org>
On Sat, Oct 13, 2018 at 6:32 AM Jaak Ristioja <jaak-89mTbI93R4uuvFJfX82//w@public.gmane.org> wrote:
>
> On 27.08.2018 19:22, Jaak Ristioja wrote:
> > Upgrading Linux from 4.16 to 4.17, a ThinkPad L570 started receiving
> > spurious input events, mostly right mouse button click events, but also
> > cursor jumps.
> >
> > I have not attempted to understand whether these events come from the
> > trackpoint or touchpad or some other driver, but I managed to bisect
> > this issue to commit a986c75a7df0 titled "platform/x86: thinkpad_acpi:
> > Add 2nd Fan Support for Thinkpad P50" by Alexander Kappner.
> >
> > Apparently the quirk mitigation is applied when the BIOS version begins
> > with N1. The BIOS version on the L570 in question is N1XET57W (1.35 )
> > which is probably why this commit causes the described problems on the
> > ThinkPad L570. How exactly? - I don't know.
> >
> > The issue did not reproduce when running some stable 4.17 and 4.18
> > kernels with commit a986c75a7df0 reverted.
> >
> > Please fix this for future kernels. Thanks! :)
>
> Ping. Do you need any additional information?
Sounds like we need tighter check for the quirk, maybe based on
DMI/Board name? Can we revert the offending commit for now?
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v3 6/8] input: stpmic1: add stpmic1 onkey driver
From: dmitry.torokhov @ 2018-10-15 22:32 UTC (permalink / raw)
To: Pascal PAILLET-LME
Cc: robh+dt@kernel.org, mark.rutland@arm.com, lee.jones@linaro.org,
lgirdwood@gmail.com, broonie@kernel.org, wim@linux-watchdog.org,
linux@roeck-us.net, linux-input@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-watchdog@vger.kernel.org, benjamin.gaignard@linaro.org,
eballetbo@gmail.com
In-Reply-To: <1539016176-4072-7-git-send-email-p.paillet@st.com>
Hi Pascal,
On Mon, Oct 08, 2018 at 04:29:41PM +0000, Pascal PAILLET-LME wrote:
> From: pascal paillet <p.paillet@st.com>
>
> The stpmic1 pmic is able to manage an onkey button. This driver exposes
> the stpmic1 onkey as an input device. It can also be configured to
> shut-down the power supplies on a long key-press with an adjustable
> duration.
>
> Signed-off-by: pascal paillet <p.paillet@st.com>
> ---
> changes in v3:
> * Rename struct stpmic1_dev by struct stpmic1.
> * Replace of_property_ by device_property.
> * Remove log in IRQ handler.
> * Add email address in MODULE_AUTHOR.
>
> drivers/input/misc/Kconfig | 11 ++
> drivers/input/misc/Makefile | 2 +
> drivers/input/misc/stpmic1_onkey.c | 248 +++++++++++++++++++++++++++++++++++++
> 3 files changed, 261 insertions(+)
> create mode 100644 drivers/input/misc/stpmic1_onkey.c
>
> diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
> index ca59a2b..279fb02 100644
> --- a/drivers/input/misc/Kconfig
> +++ b/drivers/input/misc/Kconfig
> @@ -851,4 +851,15 @@ config INPUT_SC27XX_VIBRA
> To compile this driver as a module, choose M here. The module will
> be called sc27xx_vibra.
>
> +config INPUT_STPMIC1_ONKEY
> + tristate "STPMIC1 PMIC Onkey support"
> + depends on MFD_STPMIC1
> + help
> + Say Y to enable support of onkey embedded into STPMIC1 PMIC. onkey
> + can be used to wakeup from low power modes and force a shut-down on
> + long press.
> +
> + To compile this driver as a module, choose M here: the
> + module will be called stpmic1_onkey.
> +
> endif
> diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
> index 9d0f9d1..1b44202 100644
> --- a/drivers/input/misc/Makefile
> +++ b/drivers/input/misc/Makefile
> @@ -71,6 +71,7 @@ obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
> obj-$(CONFIG_INPUT_SIRFSOC_ONKEY) += sirfsoc-onkey.o
> obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY) += soc_button_array.o
> obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
> +obj-$(CONFIG_INPUT_STPMIC1_ONKEY) += stpmic1_onkey.o
> obj-$(CONFIG_INPUT_TPS65218_PWRBUTTON) += tps65218-pwrbutton.o
> obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON) += twl4030-pwrbutton.o
> obj-$(CONFIG_INPUT_TWL4030_VIBRA) += twl4030-vibra.o
> @@ -81,3 +82,4 @@ obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o
> obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o
> obj-$(CONFIG_INPUT_YEALINK) += yealink.o
> obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR) += ideapad_slidebar.o
> +
> diff --git a/drivers/input/misc/stpmic1_onkey.c b/drivers/input/misc/stpmic1_onkey.c
> new file mode 100644
> index 0000000..871a087
> --- /dev/null
> +++ b/drivers/input/misc/stpmic1_onkey.c
> @@ -0,0 +1,248 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (C) STMicroelectronics 2018
> +// Author: Pascal Paillet <p.paillet@st.com> for STMicroelectronics.
> +
> +#include <linux/input.h>
> +#include <linux/interrupt.h>
> +#include <linux/mfd/stpmic1.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/property.h>
> +#include <linux/regmap.h>
> +
> +/**
> + * struct stpmic1_onkey - OnKey data
> + * @pmic: pointer to STPMIC1 PMIC device
> + * @input_dev: pointer to input device
> + * @irq_falling: irq that we are hooked on to
> + * @irq_rising: irq that we are hooked on to
> + */
> +struct stpmic1_onkey {
> + struct stpmic1 *pmic;
> + struct input_dev *input_dev;
> + int irq_falling;
> + int irq_rising;
> +};
> +
> +/**
> + * struct pmic_onkey_config - configuration of pmic PONKEYn
> + * @cc_flag_clear: value to clear CC flag in case of PowerOff
> + * trigger by longkey press
> + * @onkey_pullup_val: value of PONKEY PullUp (active or inactive)
> + * @power_off_time_sec: value for long press h/w shutdown event
> + */
> +struct pmic_onkey_config {
> + bool cc_flag_clear;
> + u8 onkey_pullup_val;
> + u8 power_off_time_sec;
> +};
> +
> +static irqreturn_t onkey_falling_irq(int irq, void *ponkey)
> +{
> + struct stpmic1_onkey *onkey = ponkey;
> + struct input_dev *input_dev = onkey->input_dev;
> +
> + input_report_key(input_dev, KEY_POWER, 1);
> + pm_wakeup_event(input_dev->dev.parent, 0);
> + input_sync(input_dev);
> +
> + return IRQ_HANDLED;
> +}
> +
> +static irqreturn_t onkey_rising_irq(int irq, void *ponkey)
> +{
> + struct stpmic1_onkey *onkey = ponkey;
> + struct input_dev *input_dev = onkey->input_dev;
> +
> + input_report_key(input_dev, KEY_POWER, 0);
> + pm_wakeup_event(input_dev->dev.parent, 0);
> + input_sync(input_dev);
> +
> + return IRQ_HANDLED;
> +}
> +
> +static int stpmic1_onkey_dt_params(struct platform_device *pdev,
> + struct stpmic1_onkey *onkey,
> + struct pmic_onkey_config *config)
> +{
> + struct device *dev = &pdev->dev;
> + u32 val;
> +
> + onkey->irq_falling = platform_get_irq_byname(pdev, "onkey-falling");
> + if (onkey->irq_falling < 0) {
> + dev_err(dev, "failed: request IRQ onkey-falling %d\n",
> + onkey->irq_falling);
> + return onkey->irq_falling;
> + }
> +
> + onkey->irq_rising = platform_get_irq_byname(pdev, "onkey-rising");
> + if (onkey->irq_rising < 0) {
> + dev_err(dev, "failed: request IRQ onkey-rising %d\n",
> + onkey->irq_rising);
> + return onkey->irq_rising;
> + }
> +
> + if (!device_property_read_u32(dev, "power-off-time-sec", &val)) {
> + if ((val > 0) && (val <= 16)) {
> + config->power_off_time_sec = val;
> + } else {
> + dev_err(dev, "power-off-time-sec out of range\n");
> + return -EINVAL;
> + }
> + }
> +
> + if (device_property_present(dev, "st,onkey-clear-cc-flag"))
> + config->cc_flag_clear = true;
> +
> + if (device_property_present(dev, "st,onkey-pu-inactive"))
> + config->onkey_pullup_val = PONKEY_PU_ACTIVE;
> +
> + dev_dbg(dev, "onkey-switch-off duration=%d seconds\n",
> + config->power_off_time_sec);
> +
> + return 0;
> +}
> +
> +static int stpmic1_onkey_probe(struct platform_device *pdev)
> +{
> + struct stpmic1 *pmic = dev_get_drvdata(pdev->dev.parent);
> + struct device *dev = &pdev->dev;
> + struct input_dev *input_dev;
> + struct stpmic1_onkey *onkey;
> + struct pmic_onkey_config config;
> + unsigned int val = 0;
> + int error;
> +
> + onkey = devm_kzalloc(dev, sizeof(*onkey), GFP_KERNEL);
> + if (!onkey)
> + return -ENOMEM;
> +
> + memset(&config, 0, sizeof(struct pmic_onkey_config));
> + error = stpmic1_onkey_dt_params(pdev, onkey, &config);
> + if (error)
> + return error;
> +
> + input_dev = devm_input_allocate_device(dev);
> + if (!input_dev) {
> + dev_err(dev, "Can't allocate Pwr Onkey Input Device\n");
> + return -ENOMEM;
> + }
> +
> + input_dev->name = "pmic_onkey";
> + input_dev->phys = "pmic_onkey/input0";
> +
> + input_set_capability(input_dev, EV_KEY, KEY_POWER);
> +
> + /* Setup Power Onkey Hardware parameters (long key press)*/
> + if (config.power_off_time_sec > 0) {
> + val |= PONKEY_PWR_OFF;
> + val |= ((16 - config.power_off_time_sec) &
> + PONKEY_TURNOFF_TIMER_MASK);
> + }
> + if (config.cc_flag_clear)
How about doing:
if (device_property_present(dev, "st,onkey-clear-cc-flag"))
> + val |= PONKEY_CC_FLAG_CLEAR;
and similarly handle other properties? Then you would not really need
the "config" structure/variable nor stpmic1_onkey_dt_params() and I do
not think you'd lose any readability.
> + error = regmap_update_bits(pmic->regmap, PKEY_TURNOFF_CR,
> + PONKEY_TURNOFF_MASK, val);
> + if (error) {
> + dev_err(dev, "LONG_PRESS_KEY_UPDATE failed: %d\n", error);
> + return error;
> + }
> +
> + error = regmap_update_bits(pmic->regmap, PADS_PULL_CR,
> + PONKEY_PU_ACTIVE,
> + config.onkey_pullup_val);
> + if (error) {
> + dev_err(dev, "ONKEY Pads configuration failed: %d\n", error);
> + return error;
> + }
> +
> + onkey->pmic = pmic;
> + onkey->input_dev = input_dev;
> +
> + /* interrupt is nested in a thread */
> + error = devm_request_threaded_irq(dev, onkey->irq_falling, NULL,
> + onkey_falling_irq, IRQF_ONESHOT,
> + dev_name(dev), onkey);
> + if (error) {
> + dev_err(dev, "Can't get IRQ Onkey Falling: %d\n", error);
> + return error;
> + }
> +
> + error = devm_request_threaded_irq(dev, onkey->irq_rising, NULL,
> + onkey_rising_irq, IRQF_ONESHOT,
> + dev_name(dev), onkey);
> + if (error) {
> + dev_err(dev, "Can't get IRQ Onkey Rising: %d\n", error);
> + return error;
> + }
> +
> + error = input_register_device(input_dev);
> + if (error) {
> + dev_err(dev, "Can't register power button: %d\n", error);
> + return error;
> + }
> +
> + platform_set_drvdata(pdev, onkey);
> + device_init_wakeup(dev, true);
> +
> + return 0;
> +}
> +
> +static int stpmic1_onkey_remove(struct platform_device *pdev)
> +{
> + struct stpmic1_onkey *onkey = platform_get_drvdata(pdev);
> +
> + input_unregister_device(onkey->input_dev);
Input device is devm-managed, it doe snot have to be unregistered
manually. You can remove stpmic1_onkey_remove altogether.
> + return 0;
> +}
> +
> +static int __maybe_unused stpmic1_onkey_suspend(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct stpmic1_onkey *onkey = platform_get_drvdata(pdev);
> +
> + if (device_may_wakeup(dev)) {
> + enable_irq_wake(onkey->irq_falling);
> + enable_irq_wake(onkey->irq_rising);
> + }
> + return 0;
> +}
> +
> +static int __maybe_unused stpmic1_onkey_resume(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct stpmic1_onkey *onkey = platform_get_drvdata(pdev);
> +
> + if (device_may_wakeup(dev)) {
> + disable_irq_wake(onkey->irq_falling);
> + disable_irq_wake(onkey->irq_rising);
> + }
> + return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(stpmic1_onkey_pm,
> + stpmic1_onkey_suspend,
> + stpmic1_onkey_resume);
> +
> +static const struct of_device_id of_stpmic1_onkey_match[] = {
> + { .compatible = "st,stpmic1-onkey" },
> + { },
> +};
> +
> +MODULE_DEVICE_TABLE(of, of_stpmic1_onkey_match);
> +
> +static struct platform_driver stpmic1_onkey_driver = {
> + .probe = stpmic1_onkey_probe,
> + .remove = stpmic1_onkey_remove,
> + .driver = {
> + .name = "stpmic1_onkey",
> + .of_match_table = of_match_ptr(of_stpmic1_onkey_match),
> + .pm = &stpmic1_onkey_pm,
> + },
> +};
> +module_platform_driver(stpmic1_onkey_driver);
> +
> +MODULE_DESCRIPTION("Onkey driver for STPMIC1");
> +MODULE_AUTHOR("Pascal Paillet <p.paillet@st.com>");
> +MODULE_LICENSE("GPL v2");
> --
> 1.9.1
--
Dmitry
^ permalink raw reply
* Re: [PATCH v2 0/8] OLPC 1.75 Keyboard/Touchpad fixes
From: Pavel Machek @ 2018-10-15 19:56 UTC (permalink / raw)
To: Lubomir Rintel
Cc: Dmitry Torokhov, Michael Turquette, Rob Herring, Mark Rutland,
Stephen Boyd, James Cameron, linux-input, devicetree,
linux-kernel, linux-clk
In-Reply-To: <20181010142504.233467-1-lkundrak@v3.sk>
[-- Attachment #1: Type: text/plain, Size: 713 bytes --]
Hi!
> This makes keyboard/touchpad work on a DT MMP2 platform.
>
> I believe that it would be a good idea if this, once reviewed, went in
> via the input tree. The DT and CLK parts got reviews/acks.
>
> Changes from v1:
> - Basically none, just re-send, including Ack and Review tags in patches
> that received them. Plus an extra Cc.
> I'd be very thankful for reviews.
Ok, I believe I have OLPC 1.75, and it is actually a nice
machine. Can I get recent kernel working there in useful fashion? (Is
there docs somewhere)?
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply
* Re: [PATCH] HID: steam: remove input device when a hid client is running.
From: Pierre-Loup A. Griffais @ 2018-10-15 19:55 UTC (permalink / raw)
To: Rodrigo Rivas Costa, Benjamin Tissoires, Jiri Kosina, lkml,
linux-input
In-Reply-To: <20181014173643.9643-1-rodrigorivascosta@gmail.com>
On 10/14/18 10:36 AM, Rodrigo Rivas Costa wrote:
> Previously, when a HID client such as the Steam Client was running, this
> driver disabled its input device to avoid doubling the input events.
>
> While it worked mostly fine, some games got confused by the idle gamepad,
> and switched to two player mode, or asked the user to choose which gamepad
> to use. Other games just crashed, probably a bug in Unity [1].
>
> With this commit, when a HID client starts, the input device is removed;
> when the HID client ends the input device is recreated.
>
> [1]: https://github.com/ValveSoftware/steam-for-linux/issues/5645
Hi Rodrigo,
Thanks a lot, this should indeed help a ton. Just the presence of an
extra gamepad node can indeed cause applications to go completely
different paths. Assuming it otherwise looks good, is there a chance
this fix could be put back into the 4.18 branch?
Thanks,
- Pierre-Loup
>
> Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
> ---
> drivers/hid/hid-steam.c | 154 +++++++++++++++++++++++-----------------
> 1 file changed, 90 insertions(+), 64 deletions(-)
>
> diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c
> index 0422ec2b13d2..dc4128bfe2ca 100644
> --- a/drivers/hid/hid-steam.c
> +++ b/drivers/hid/hid-steam.c
> @@ -23,8 +23,9 @@
> * In order to avoid breaking them this driver creates a layered hidraw device,
> * so it can detect when the client is running and then:
> * - it will not send any command to the controller.
> - * - this input device will be disabled, to avoid double input of the same
> + * - this input device will be removed, to avoid double input of the same
> * user action.
> + * When the client is closed, this input device will be created again.
> *
> * For additional functions, such as changing the right-pad margin or switching
> * the led, you can use the user-space tool at:
> @@ -113,7 +114,7 @@ struct steam_device {
> spinlock_t lock;
> struct hid_device *hdev, *client_hdev;
> struct mutex mutex;
> - bool client_opened, input_opened;
> + bool client_opened;
> struct input_dev __rcu *input;
> unsigned long quirks;
> struct work_struct work_connect;
> @@ -279,18 +280,6 @@ static void steam_set_lizard_mode(struct steam_device *steam, bool enable)
> }
> }
>
> -static void steam_update_lizard_mode(struct steam_device *steam)
> -{
> - mutex_lock(&steam->mutex);
> - if (!steam->client_opened) {
> - if (steam->input_opened)
> - steam_set_lizard_mode(steam, false);
> - else
> - steam_set_lizard_mode(steam, lizard_mode);
> - }
> - mutex_unlock(&steam->mutex);
> -}
> -
> static int steam_input_open(struct input_dev *dev)
> {
> struct steam_device *steam = input_get_drvdata(dev);
> @@ -301,7 +290,6 @@ static int steam_input_open(struct input_dev *dev)
> return ret;
>
> mutex_lock(&steam->mutex);
> - steam->input_opened = true;
> if (!steam->client_opened && lizard_mode)
> steam_set_lizard_mode(steam, false);
> mutex_unlock(&steam->mutex);
> @@ -313,7 +301,6 @@ static void steam_input_close(struct input_dev *dev)
> struct steam_device *steam = input_get_drvdata(dev);
>
> mutex_lock(&steam->mutex);
> - steam->input_opened = false;
> if (!steam->client_opened && lizard_mode)
> steam_set_lizard_mode(steam, true);
> mutex_unlock(&steam->mutex);
> @@ -400,7 +387,7 @@ static int steam_battery_register(struct steam_device *steam)
> return 0;
> }
>
> -static int steam_register(struct steam_device *steam)
> +static int steam_input_register(struct steam_device *steam)
> {
> struct hid_device *hdev = steam->hdev;
> struct input_dev *input;
> @@ -414,17 +401,6 @@ static int steam_register(struct steam_device *steam)
> return 0;
> }
>
> - /*
> - * Unlikely, but getting the serial could fail, and it is not so
> - * important, so make up a serial number and go on.
> - */
> - if (steam_get_serial(steam) < 0)
> - strlcpy(steam->serial_no, "XXXXXXXXXX",
> - sizeof(steam->serial_no));
> -
> - hid_info(hdev, "Steam Controller '%s' connected",
> - steam->serial_no);
> -
> input = input_allocate_device();
> if (!input)
> return -ENOMEM;
> @@ -492,11 +468,6 @@ static int steam_register(struct steam_device *steam)
> goto input_register_fail;
>
> rcu_assign_pointer(steam->input, input);
> -
> - /* ignore battery errors, we can live without it */
> - if (steam->quirks & STEAM_QUIRK_WIRELESS)
> - steam_battery_register(steam);
> -
> return 0;
>
> input_register_fail:
> @@ -504,27 +475,88 @@ static int steam_register(struct steam_device *steam)
> return ret;
> }
>
> -static void steam_unregister(struct steam_device *steam)
> +static void steam_input_unregister(struct steam_device *steam)
> {
> struct input_dev *input;
> + rcu_read_lock();
> + input = rcu_dereference(steam->input);
> + rcu_read_unlock();
> + if (!input)
> + return;
> + RCU_INIT_POINTER(steam->input, NULL);
> + synchronize_rcu();
> + input_unregister_device(input);
> +}
> +
> +static void steam_battery_unregister(struct steam_device *steam)
> +{
> struct power_supply *battery;
>
> rcu_read_lock();
> - input = rcu_dereference(steam->input);
> battery = rcu_dereference(steam->battery);
> rcu_read_unlock();
>
> - if (battery) {
> - RCU_INIT_POINTER(steam->battery, NULL);
> - synchronize_rcu();
> - power_supply_unregister(battery);
> + if (!battery)
> + return;
> + RCU_INIT_POINTER(steam->battery, NULL);
> + synchronize_rcu();
> + power_supply_unregister(battery);
> +}
> +
> +static int steam_register(struct steam_device *steam)
> +{
> + int ret;
> +
> + /*
> + * This function can be called several times in a row with the
> + * wireless adaptor, without steam_unregister() between them, because
> + * another client send a get_connection_status command, for example.
> + * The battery and serial number are set just once per device.
> + */
> + if (!steam->serial_no[0]) {
> + /*
> + * Unlikely, but getting the serial could fail, and it is not so
> + * important, so make up a serial number and go on.
> + */
> + if (steam_get_serial(steam) < 0)
> + strlcpy(steam->serial_no, "XXXXXXXXXX",
> + sizeof(steam->serial_no));
> +
> + hid_info(steam->hdev, "Steam Controller '%s' connected",
> + steam->serial_no);
> +
> + /* ignore battery errors, we can live without it */
> + if (steam->quirks & STEAM_QUIRK_WIRELESS)
> + steam_battery_register(steam);
> +
> + mutex_lock(&steam_devices_lock);
> + list_add(&steam->list, &steam_devices);
> + mutex_unlock(&steam_devices_lock);
> }
> - if (input) {
> - RCU_INIT_POINTER(steam->input, NULL);
> - synchronize_rcu();
> +
> + mutex_lock(&steam->mutex);
> + if (!steam->client_opened) {
> + steam_set_lizard_mode(steam, lizard_mode);
> + ret = steam_input_register(steam);
> + } else {
> + ret = 0;
> + }
> + mutex_unlock(&steam->mutex);
> +
> + return ret;
> +}
> +
> +static void steam_unregister(struct steam_device *steam)
> +{
> + steam_battery_unregister(steam);
> + steam_input_unregister(steam);
> + if (steam->serial_no[0]) {
> hid_info(steam->hdev, "Steam Controller '%s' disconnected",
> steam->serial_no);
> - input_unregister_device(input);
> + mutex_lock(&steam_devices_lock);
> + list_del(&steam->list);
> + mutex_unlock(&steam_devices_lock);
> + steam->serial_no[0] = 0;
> }
> }
>
> @@ -600,6 +632,9 @@ static int steam_client_ll_open(struct hid_device *hdev)
> mutex_lock(&steam->mutex);
> steam->client_opened = true;
> mutex_unlock(&steam->mutex);
> +
> + steam_input_unregister(steam);
> +
> return ret;
> }
>
> @@ -609,13 +644,13 @@ static void steam_client_ll_close(struct hid_device *hdev)
>
> mutex_lock(&steam->mutex);
> steam->client_opened = false;
> - if (steam->input_opened)
> - steam_set_lizard_mode(steam, false);
> - else
> - steam_set_lizard_mode(steam, lizard_mode);
> mutex_unlock(&steam->mutex);
>
> hid_hw_close(steam->hdev);
> + if (steam->connected) {
> + steam_set_lizard_mode(steam, lizard_mode);
> + steam_input_register(steam);
> + }
> }
>
> static int steam_client_ll_raw_request(struct hid_device *hdev,
> @@ -744,11 +779,6 @@ static int steam_probe(struct hid_device *hdev,
> }
> }
>
> - mutex_lock(&steam_devices_lock);
> - steam_update_lizard_mode(steam);
> - list_add(&steam->list, &steam_devices);
> - mutex_unlock(&steam_devices_lock);
> -
> return 0;
>
> hid_hw_open_fail:
> @@ -774,10 +804,6 @@ static void steam_remove(struct hid_device *hdev)
> return;
> }
>
> - mutex_lock(&steam_devices_lock);
> - list_del(&steam->list);
> - mutex_unlock(&steam_devices_lock);
> -
> hid_destroy_device(steam->client_hdev);
> steam->client_opened = false;
> cancel_work_sync(&steam->work_connect);
> @@ -792,12 +818,14 @@ static void steam_remove(struct hid_device *hdev)
> static void steam_do_connect_event(struct steam_device *steam, bool connected)
> {
> unsigned long flags;
> + bool changed;
>
> spin_lock_irqsave(&steam->lock, flags);
> + changed = steam->connected != connected;
> steam->connected = connected;
> spin_unlock_irqrestore(&steam->lock, flags);
>
> - if (schedule_work(&steam->work_connect) == 0)
> + if (changed && schedule_work(&steam->work_connect) == 0)
> dbg_hid("%s: connected=%d event already queued\n",
> __func__, connected);
> }
> @@ -1019,13 +1047,8 @@ static int steam_raw_event(struct hid_device *hdev,
> return 0;
> rcu_read_lock();
> input = rcu_dereference(steam->input);
> - if (likely(input)) {
> + if (likely(input))
> steam_do_input_event(steam, input, data);
> - } else {
> - dbg_hid("%s: input data without connect event\n",
> - __func__);
> - steam_do_connect_event(steam, true);
> - }
> rcu_read_unlock();
> break;
> case STEAM_EV_CONNECT:
> @@ -1074,7 +1097,10 @@ static int steam_param_set_lizard_mode(const char *val,
>
> mutex_lock(&steam_devices_lock);
> list_for_each_entry(steam, &steam_devices, list) {
> - steam_update_lizard_mode(steam);
> + mutex_lock(&steam->mutex);
> + if (!steam->client_opened)
> + steam_set_lizard_mode(steam, lizard_mode);
> + mutex_unlock(&steam->mutex);
> }
> mutex_unlock(&steam_devices_lock);
> return 0;
>
^ permalink raw reply
* Re: [PATCH] Input: atmel_mxt_ts - mark expected switch fall-through
From: Gustavo A. R. Silva @ 2018-10-15 18:30 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Nick Dyer, linux-input, linux-kernel
In-Reply-To: <20181015182156.GD127224@dtor-ws>
On 10/15/18 8:21 PM, Dmitry Torokhov wrote:
> On Mon, Oct 08, 2018 at 07:03:55PM +0200, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> Applied, thank you.
>
Thanks, Dmitry.
--
Gustavo
^ permalink raw reply
* Re: [PATCH] Input: atmel_mxt_ts - mark expected switch fall-through
From: Dmitry Torokhov @ 2018-10-15 18:21 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: Nick Dyer, linux-input, linux-kernel
In-Reply-To: <20181008170355.GA18107@embeddedor.com>
On Mon, Oct 08, 2018 at 07:03:55PM +0200, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied, thank you.
> ---
> drivers/input/touchscreen/atmel_mxt_ts.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index bbc122f..d3aacd5 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -488,7 +488,7 @@ static int mxt_lookup_bootloader_address(struct mxt_data *data, bool retry)
> bootloader = appmode - 0x24;
> break;
> }
> - /* Fall through for normal case */
> + /* Fall through - for normal case */
> case 0x4c:
> case 0x4d:
> case 0x5a:
> --
> 2.7.4
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: cyapa - mark expected switch fall-throughs
From: Dmitry Torokhov @ 2018-10-15 18:21 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: linux-input, linux-kernel
In-Reply-To: <20181008153824.GA14336@embeddedor.com>
On Mon, Oct 08, 2018 at 05:38:24PM +0200, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Notice that in this particular case, I replaced the "Fallthrough state"
> commern with a proper "Fall through", which is what GCC is expecting to
> find.
>
> Addresses-Coverity-ID: 114758 ("Missing break in switch")
> Addresses-Coverity-ID: 114759 ("Missing break in switch")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied, thank you.
> ---
> drivers/input/mouse/cyapa_gen3.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/mouse/cyapa_gen3.c b/drivers/input/mouse/cyapa_gen3.c
> index 076dda4..00e395d 100644
> --- a/drivers/input/mouse/cyapa_gen3.c
> +++ b/drivers/input/mouse/cyapa_gen3.c
> @@ -1067,7 +1067,7 @@ static int cyapa_gen3_do_operational_check(struct cyapa *cyapa)
> return error;
> }
>
> - /* Fallthrough state */
> + /* Fall through */
> case CYAPA_STATE_BL_IDLE:
> /* Try to get firmware version in bootloader mode. */
> cyapa_gen3_bl_query_data(cyapa);
> @@ -1078,7 +1078,7 @@ static int cyapa_gen3_do_operational_check(struct cyapa *cyapa)
> return error;
> }
>
> - /* Fallthrough state */
> + /* Fall through */
> case CYAPA_STATE_OP:
> /*
> * Reading query data before going back to the full mode
> --
> 2.7.4
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15IGM
From: Dmitry Torokhov @ 2018-10-15 18:18 UTC (permalink / raw)
To: Mikhail Nikiforov; +Cc: linux-input, stable
In-Reply-To: <20181014014632.4331-1-jackxviichaos@gmail.com>
On Sun, Oct 14, 2018 at 04:46:32AM +0300, Mikhail Nikiforov wrote:
> Add ELAN061C to the ACPI table to support Elan touchpad found in Lenovo
> IdeaPad 330-15IGM.
>
> Signed-off-by: Mikhail Nikiforov <jackxviichaos@gmail.com>
> Cc: stable@vger.kernel.org
Applied, thank you.
> ---
> drivers/input/mouse/elan_i2c_core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
> index f5ae24865355..b0f9d19b3410 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -1346,6 +1346,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
> { "ELAN0611", 0 },
> { "ELAN0612", 0 },
> { "ELAN0618", 0 },
> + { "ELAN061C", 0 },
> { "ELAN061D", 0 },
> { "ELAN0622", 0 },
> { "ELAN1000", 0 },
> --
> 2.17.1
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH] input: touchscreen: fix wm97xx-ts exit path
From: Dmitry Torokhov @ 2018-10-15 18:17 UTC (permalink / raw)
To: Randy Dunlap
Cc: LKML, linux-input@vger.kernel.org, Robert Jarzmik, Charles Keepax,
Mark Brown, patches
In-Reply-To: <c522fb84-20cd-39e6-bd2d-79ed8709fd5d@infradead.org>
On Sat, Oct 13, 2018 at 10:06:18AM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
>
> Loading then unloading wm97xx-ts.ko when CONFIG_AC97_BUS=m
> causes a WARNING: from drivers/base/driver.c:
>
> Unexpected driver unregister!
> WARNING: CPU: 0 PID: 1709 at ../drivers/base/driver.c:193 driver_unregister+0x30/0x40
>
> Fix this by only calling driver_unregister() with the same
> condition that driver_register() is called.
>
> Fixes: ae9d1b5fbd7b ("Input: wm97xx: add new AC97 bus support")
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
> Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: patches@opensource.cirrus.com
> Cc: linux-input@vger.kernel.org
Applied, thank you.
> ---
> drivers/input/touchscreen/wm97xx-core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- lnx-419-rc7.orig/drivers/input/touchscreen/wm97xx-core.c
> +++ lnx-419-rc7/drivers/input/touchscreen/wm97xx-core.c
> @@ -929,7 +929,8 @@ static int __init wm97xx_init(void)
>
> static void __exit wm97xx_exit(void)
> {
> - driver_unregister(&wm97xx_driver);
> + if (IS_BUILTIN(CONFIG_AC97_BUS))
> + driver_unregister(&wm97xx_driver);
> platform_driver_unregister(&wm97xx_mfd_driver);
> }
>
>
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH 0/7] HID: logitech-hidpp: support non DJ devices
From: Benjamin Tissoires @ 2018-10-15 12:34 UTC (permalink / raw)
To: Jiri Kosina, Nestor Lopez Casado, simon, ogay
Cc: open list:HID CORE LAYER, lkml
In-Reply-To: <20180907103450.13890-1-benjamin.tissoires@redhat.com>
Hello,
On Fri, Sep 7, 2018 at 12:34 PM Benjamin Tissoires
<benjamin.tissoires@redhat.com> wrote:
>
> Hi Jiri, Nestor,
>
> I have this series in my tree for a while now (first commit was in January).
> I never sent it (as far as I can remember*) because I was requesting
> feedback regarding the G920 wheel. I think I haven't break it, but
> mistakes can happen.
>
> Anyway, I think it's been too long, so I am just sending it now, as
> it will fix the names of the non-dj devices that share the same USB receiver
> (G900 and G403 for instance). Also, rebasing on top of new code is a pain
> I'd rather not do every 3 months.
>
Can anyone review this series?
It's been in my local tree for too long and feels too lonely there :)
Cheers,
Benjamin
>
> * looking into my archives, I actually sent those as a part of the
> battery support in hid-logitech-hidpp. Consider it as a fresh start though :)
>
> Benjamin Tissoires (7):
> HID: logitech-hidpp: allow non HID++ devices to be handled by this
> module
> HID: logitech-hidpp: make .probe usbhid capable
> HID: logitech-hidpp: support non-DJ receivers
> HID: logitech-hidpp: get the name and serial of the other non-HID++
> node
> HID: logitech-hidpp: create a name based on the type if non available
> HID: logitech-hidpp: support the G700 over wireless
> HID: logitech-hidpp: support the G900 over wireless
>
> drivers/hid/hid-ids.h | 4 +
> drivers/hid/hid-logitech-hidpp.c | 470 +++++++++++++++++++++++++++++++++------
> 2 files changed, 407 insertions(+), 67 deletions(-)
>
> --
> 2.14.3
>
^ permalink raw reply
* Re: [PATCH v2] HID: i2c-hid: Add a small delay after sleep command for Raydium touchpanel
From: Benjamin Tissoires @ 2018-10-15 8:04 UTC (permalink / raw)
To: Kai Heng Feng; +Cc: Jiri Kosina, Hans de Goede, open list:HID CORE LAYER, lkml
In-Reply-To: <20181005044629.26286-1-kai.heng.feng@canonical.com>
On Fri, Oct 5, 2018 at 6:46 AM Kai-Heng Feng
<kai.heng.feng@canonical.com> wrote:
>
> Raydium touchpanel (2386:4B33) sometimes does not work in desktop session
> although it works in display manager.
>
> During user logging, the display manager exits, close the HID device,
> then the device gets runtime suspended and powered off. The desktop
> session begins shortly after, opens the HID device, then the device gets
> runtime resumed and powered on.
>
> If the trasition from display manager to desktop sesesion is fast, the
> touchpanel cannot switch from powered off to powered on in short
> timeframe. So add a small delay to workaround the issue.
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> v2:
> - Use quirk to only match affected touchpanel
> - Only delay the next power on if the time hasn't elapsed
Hi,
I like the patch much better. And I even would be tempted to have this
unconditionally enabled now that the general path doesn't have the
msleep in the middle.
So how about we merge this patch now, and if in the long run we see
more devices that require this quirk, then we can probably remove the
specific quirk and make it mandatory?
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cheers,
Benjamin
>
> drivers/hid/hid-ids.h | 3 +++
> drivers/hid/i2c-hid/i2c-hid-core.c | 19 +++++++++++++++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 16342188df19..c1b5f03eb630 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -926,6 +926,9 @@
> #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3003 0x3003
> #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008
>
> +#define I2C_VENDOR_ID_RAYDIUM 0x2386
> +#define I2C_PRODUCT_ID_RAYDIUM_4B33 0x4b33
> +
> #define USB_VENDOR_ID_RAZER 0x1532
> #define USB_DEVICE_ID_RAZER_BLADE_14 0x011D
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
> index 4aab96cf0818..3cde7c1b9c33 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-core.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
> @@ -49,6 +49,7 @@
> #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0)
> #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1)
> #define I2C_HID_QUIRK_NO_RUNTIME_PM BIT(2)
> +#define I2C_HID_QUIRK_DELAY_AFTER_SLEEP BIT(3)
>
> /* flags */
> #define I2C_HID_STARTED 0
> @@ -158,6 +159,8 @@ struct i2c_hid {
>
> bool irq_wake_enabled;
> struct mutex reset_lock;
> +
> + unsigned long sleep_delay;
> };
>
> static const struct i2c_hid_quirks {
> @@ -172,6 +175,8 @@ static const struct i2c_hid_quirks {
> { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
> I2C_HID_QUIRK_NO_IRQ_AFTER_RESET |
> I2C_HID_QUIRK_NO_RUNTIME_PM },
> + { I2C_VENDOR_ID_RAYDIUM, I2C_PRODUCT_ID_RAYDIUM_4B33,
> + I2C_HID_QUIRK_DELAY_AFTER_SLEEP },
> { 0, 0 }
> };
>
> @@ -387,6 +392,7 @@ static int i2c_hid_set_power(struct i2c_client *client, int power_state)
> {
> struct i2c_hid *ihid = i2c_get_clientdata(client);
> int ret;
> + unsigned long now, delay;
>
> i2c_hid_dbg(ihid, "%s\n", __func__);
>
> @@ -404,9 +410,22 @@ static int i2c_hid_set_power(struct i2c_client *client, int power_state)
> goto set_pwr_exit;
> }
>
> + if (ihid->quirks & I2C_HID_QUIRK_DELAY_AFTER_SLEEP &&
> + power_state == I2C_HID_PWR_ON) {
> + now = jiffies;
> + if (time_after(ihid->sleep_delay, now)) {
> + delay = jiffies_to_usecs(ihid->sleep_delay - now);
> + usleep_range(delay, delay + 1);
> + }
> + }
> +
> ret = __i2c_hid_command(client, &hid_set_power_cmd, power_state,
> 0, NULL, 0, NULL, 0);
>
> + if (ihid->quirks & I2C_HID_QUIRK_DELAY_AFTER_SLEEP &&
> + power_state == I2C_HID_PWR_SLEEP)
> + ihid->sleep_delay = jiffies + msecs_to_jiffies(20);
> +
> if (ret)
> dev_err(&client->dev, "failed to change power setting.\n");
>
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH v2] HID: i2c-hid: Add a small delay after sleep command for Raydium touchpanel
From: Kai Heng Feng @ 2018-10-15 3:33 UTC (permalink / raw)
To: Jiri Kosina
Cc: Benjamin Tissoires, Hans de Goede, open list:HID CORE LAYER,
linux-kernel
In-Reply-To: <20181005044629.26286-1-kai.heng.feng@canonical.com>
Hi Jiri and Benjamin,
> On Oct 5, 2018, at 12:46, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
>
> Raydium touchpanel (2386:4B33) sometimes does not work in desktop session
> although it works in display manager.
>
> During user logging, the display manager exits, close the HID device,
> then the device gets runtime suspended and powered off. The desktop
> session begins shortly after, opens the HID device, then the device gets
> runtime resumed and powered on.
>
> If the trasition from display manager to desktop sesesion is fast, the
> touchpanel cannot switch from powered off to powered on in short
> timeframe. So add a small delay to workaround the issue.
Please review my patch and let me know if the approach is okay, thanks!
Kai-Heng
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> v2:
> - Use quirk to only match affected touchpanel
> - Only delay the next power on if the time hasn't elapsed
>
> drivers/hid/hid-ids.h | 3 +++
> drivers/hid/i2c-hid/i2c-hid-core.c | 19 +++++++++++++++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 16342188df19..c1b5f03eb630 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -926,6 +926,9 @@
> #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3003 0x3003
> #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008
>
> +#define I2C_VENDOR_ID_RAYDIUM 0x2386
> +#define I2C_PRODUCT_ID_RAYDIUM_4B33 0x4b33
> +
> #define USB_VENDOR_ID_RAZER 0x1532
> #define USB_DEVICE_ID_RAZER_BLADE_14 0x011D
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
> index 4aab96cf0818..3cde7c1b9c33 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-core.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
> @@ -49,6 +49,7 @@
> #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0)
> #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1)
> #define I2C_HID_QUIRK_NO_RUNTIME_PM BIT(2)
> +#define I2C_HID_QUIRK_DELAY_AFTER_SLEEP BIT(3)
>
> /* flags */
> #define I2C_HID_STARTED 0
> @@ -158,6 +159,8 @@ struct i2c_hid {
>
> bool irq_wake_enabled;
> struct mutex reset_lock;
> +
> + unsigned long sleep_delay;
> };
>
> static const struct i2c_hid_quirks {
> @@ -172,6 +175,8 @@ static const struct i2c_hid_quirks {
> { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
> I2C_HID_QUIRK_NO_IRQ_AFTER_RESET |
> I2C_HID_QUIRK_NO_RUNTIME_PM },
> + { I2C_VENDOR_ID_RAYDIUM, I2C_PRODUCT_ID_RAYDIUM_4B33,
> + I2C_HID_QUIRK_DELAY_AFTER_SLEEP },
> { 0, 0 }
> };
>
> @@ -387,6 +392,7 @@ static int i2c_hid_set_power(struct i2c_client *client, int power_state)
> {
> struct i2c_hid *ihid = i2c_get_clientdata(client);
> int ret;
> + unsigned long now, delay;
>
> i2c_hid_dbg(ihid, "%s\n", __func__);
>
> @@ -404,9 +410,22 @@ static int i2c_hid_set_power(struct i2c_client *client, int power_state)
> goto set_pwr_exit;
> }
>
> + if (ihid->quirks & I2C_HID_QUIRK_DELAY_AFTER_SLEEP &&
> + power_state == I2C_HID_PWR_ON) {
> + now = jiffies;
> + if (time_after(ihid->sleep_delay, now)) {
> + delay = jiffies_to_usecs(ihid->sleep_delay - now);
> + usleep_range(delay, delay + 1);
> + }
> + }
> +
> ret = __i2c_hid_command(client, &hid_set_power_cmd, power_state,
> 0, NULL, 0, NULL, 0);
>
> + if (ihid->quirks & I2C_HID_QUIRK_DELAY_AFTER_SLEEP &&
> + power_state == I2C_HID_PWR_SLEEP)
> + ihid->sleep_delay = jiffies + msecs_to_jiffies(20);
> +
> if (ret)
> dev_err(&client->dev, "failed to change power setting.\n");
>
> --
> 2.17.1
>
^ permalink raw reply
* [PATCH] HID: steam: remove input device when a hid client is running.
From: Rodrigo Rivas Costa @ 2018-10-14 17:36 UTC (permalink / raw)
To: Benjamin Tissoires, Jiri Kosina, Pierre-Loup A. Griffais, lkml,
linux-input
Cc: Rodrigo Rivas Costa
Previously, when a HID client such as the Steam Client was running, this
driver disabled its input device to avoid doubling the input events.
While it worked mostly fine, some games got confused by the idle gamepad,
and switched to two player mode, or asked the user to choose which gamepad
to use. Other games just crashed, probably a bug in Unity [1].
With this commit, when a HID client starts, the input device is removed;
when the HID client ends the input device is recreated.
[1]: https://github.com/ValveSoftware/steam-for-linux/issues/5645
Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
---
drivers/hid/hid-steam.c | 154 +++++++++++++++++++++++-----------------
1 file changed, 90 insertions(+), 64 deletions(-)
diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c
index 0422ec2b13d2..dc4128bfe2ca 100644
--- a/drivers/hid/hid-steam.c
+++ b/drivers/hid/hid-steam.c
@@ -23,8 +23,9 @@
* In order to avoid breaking them this driver creates a layered hidraw device,
* so it can detect when the client is running and then:
* - it will not send any command to the controller.
- * - this input device will be disabled, to avoid double input of the same
+ * - this input device will be removed, to avoid double input of the same
* user action.
+ * When the client is closed, this input device will be created again.
*
* For additional functions, such as changing the right-pad margin or switching
* the led, you can use the user-space tool at:
@@ -113,7 +114,7 @@ struct steam_device {
spinlock_t lock;
struct hid_device *hdev, *client_hdev;
struct mutex mutex;
- bool client_opened, input_opened;
+ bool client_opened;
struct input_dev __rcu *input;
unsigned long quirks;
struct work_struct work_connect;
@@ -279,18 +280,6 @@ static void steam_set_lizard_mode(struct steam_device *steam, bool enable)
}
}
-static void steam_update_lizard_mode(struct steam_device *steam)
-{
- mutex_lock(&steam->mutex);
- if (!steam->client_opened) {
- if (steam->input_opened)
- steam_set_lizard_mode(steam, false);
- else
- steam_set_lizard_mode(steam, lizard_mode);
- }
- mutex_unlock(&steam->mutex);
-}
-
static int steam_input_open(struct input_dev *dev)
{
struct steam_device *steam = input_get_drvdata(dev);
@@ -301,7 +290,6 @@ static int steam_input_open(struct input_dev *dev)
return ret;
mutex_lock(&steam->mutex);
- steam->input_opened = true;
if (!steam->client_opened && lizard_mode)
steam_set_lizard_mode(steam, false);
mutex_unlock(&steam->mutex);
@@ -313,7 +301,6 @@ static void steam_input_close(struct input_dev *dev)
struct steam_device *steam = input_get_drvdata(dev);
mutex_lock(&steam->mutex);
- steam->input_opened = false;
if (!steam->client_opened && lizard_mode)
steam_set_lizard_mode(steam, true);
mutex_unlock(&steam->mutex);
@@ -400,7 +387,7 @@ static int steam_battery_register(struct steam_device *steam)
return 0;
}
-static int steam_register(struct steam_device *steam)
+static int steam_input_register(struct steam_device *steam)
{
struct hid_device *hdev = steam->hdev;
struct input_dev *input;
@@ -414,17 +401,6 @@ static int steam_register(struct steam_device *steam)
return 0;
}
- /*
- * Unlikely, but getting the serial could fail, and it is not so
- * important, so make up a serial number and go on.
- */
- if (steam_get_serial(steam) < 0)
- strlcpy(steam->serial_no, "XXXXXXXXXX",
- sizeof(steam->serial_no));
-
- hid_info(hdev, "Steam Controller '%s' connected",
- steam->serial_no);
-
input = input_allocate_device();
if (!input)
return -ENOMEM;
@@ -492,11 +468,6 @@ static int steam_register(struct steam_device *steam)
goto input_register_fail;
rcu_assign_pointer(steam->input, input);
-
- /* ignore battery errors, we can live without it */
- if (steam->quirks & STEAM_QUIRK_WIRELESS)
- steam_battery_register(steam);
-
return 0;
input_register_fail:
@@ -504,27 +475,88 @@ static int steam_register(struct steam_device *steam)
return ret;
}
-static void steam_unregister(struct steam_device *steam)
+static void steam_input_unregister(struct steam_device *steam)
{
struct input_dev *input;
+ rcu_read_lock();
+ input = rcu_dereference(steam->input);
+ rcu_read_unlock();
+ if (!input)
+ return;
+ RCU_INIT_POINTER(steam->input, NULL);
+ synchronize_rcu();
+ input_unregister_device(input);
+}
+
+static void steam_battery_unregister(struct steam_device *steam)
+{
struct power_supply *battery;
rcu_read_lock();
- input = rcu_dereference(steam->input);
battery = rcu_dereference(steam->battery);
rcu_read_unlock();
- if (battery) {
- RCU_INIT_POINTER(steam->battery, NULL);
- synchronize_rcu();
- power_supply_unregister(battery);
+ if (!battery)
+ return;
+ RCU_INIT_POINTER(steam->battery, NULL);
+ synchronize_rcu();
+ power_supply_unregister(battery);
+}
+
+static int steam_register(struct steam_device *steam)
+{
+ int ret;
+
+ /*
+ * This function can be called several times in a row with the
+ * wireless adaptor, without steam_unregister() between them, because
+ * another client send a get_connection_status command, for example.
+ * The battery and serial number are set just once per device.
+ */
+ if (!steam->serial_no[0]) {
+ /*
+ * Unlikely, but getting the serial could fail, and it is not so
+ * important, so make up a serial number and go on.
+ */
+ if (steam_get_serial(steam) < 0)
+ strlcpy(steam->serial_no, "XXXXXXXXXX",
+ sizeof(steam->serial_no));
+
+ hid_info(steam->hdev, "Steam Controller '%s' connected",
+ steam->serial_no);
+
+ /* ignore battery errors, we can live without it */
+ if (steam->quirks & STEAM_QUIRK_WIRELESS)
+ steam_battery_register(steam);
+
+ mutex_lock(&steam_devices_lock);
+ list_add(&steam->list, &steam_devices);
+ mutex_unlock(&steam_devices_lock);
}
- if (input) {
- RCU_INIT_POINTER(steam->input, NULL);
- synchronize_rcu();
+
+ mutex_lock(&steam->mutex);
+ if (!steam->client_opened) {
+ steam_set_lizard_mode(steam, lizard_mode);
+ ret = steam_input_register(steam);
+ } else {
+ ret = 0;
+ }
+ mutex_unlock(&steam->mutex);
+
+ return ret;
+}
+
+static void steam_unregister(struct steam_device *steam)
+{
+ steam_battery_unregister(steam);
+ steam_input_unregister(steam);
+ if (steam->serial_no[0]) {
hid_info(steam->hdev, "Steam Controller '%s' disconnected",
steam->serial_no);
- input_unregister_device(input);
+ mutex_lock(&steam_devices_lock);
+ list_del(&steam->list);
+ mutex_unlock(&steam_devices_lock);
+ steam->serial_no[0] = 0;
}
}
@@ -600,6 +632,9 @@ static int steam_client_ll_open(struct hid_device *hdev)
mutex_lock(&steam->mutex);
steam->client_opened = true;
mutex_unlock(&steam->mutex);
+
+ steam_input_unregister(steam);
+
return ret;
}
@@ -609,13 +644,13 @@ static void steam_client_ll_close(struct hid_device *hdev)
mutex_lock(&steam->mutex);
steam->client_opened = false;
- if (steam->input_opened)
- steam_set_lizard_mode(steam, false);
- else
- steam_set_lizard_mode(steam, lizard_mode);
mutex_unlock(&steam->mutex);
hid_hw_close(steam->hdev);
+ if (steam->connected) {
+ steam_set_lizard_mode(steam, lizard_mode);
+ steam_input_register(steam);
+ }
}
static int steam_client_ll_raw_request(struct hid_device *hdev,
@@ -744,11 +779,6 @@ static int steam_probe(struct hid_device *hdev,
}
}
- mutex_lock(&steam_devices_lock);
- steam_update_lizard_mode(steam);
- list_add(&steam->list, &steam_devices);
- mutex_unlock(&steam_devices_lock);
-
return 0;
hid_hw_open_fail:
@@ -774,10 +804,6 @@ static void steam_remove(struct hid_device *hdev)
return;
}
- mutex_lock(&steam_devices_lock);
- list_del(&steam->list);
- mutex_unlock(&steam_devices_lock);
-
hid_destroy_device(steam->client_hdev);
steam->client_opened = false;
cancel_work_sync(&steam->work_connect);
@@ -792,12 +818,14 @@ static void steam_remove(struct hid_device *hdev)
static void steam_do_connect_event(struct steam_device *steam, bool connected)
{
unsigned long flags;
+ bool changed;
spin_lock_irqsave(&steam->lock, flags);
+ changed = steam->connected != connected;
steam->connected = connected;
spin_unlock_irqrestore(&steam->lock, flags);
- if (schedule_work(&steam->work_connect) == 0)
+ if (changed && schedule_work(&steam->work_connect) == 0)
dbg_hid("%s: connected=%d event already queued\n",
__func__, connected);
}
@@ -1019,13 +1047,8 @@ static int steam_raw_event(struct hid_device *hdev,
return 0;
rcu_read_lock();
input = rcu_dereference(steam->input);
- if (likely(input)) {
+ if (likely(input))
steam_do_input_event(steam, input, data);
- } else {
- dbg_hid("%s: input data without connect event\n",
- __func__);
- steam_do_connect_event(steam, true);
- }
rcu_read_unlock();
break;
case STEAM_EV_CONNECT:
@@ -1074,7 +1097,10 @@ static int steam_param_set_lizard_mode(const char *val,
mutex_lock(&steam_devices_lock);
list_for_each_entry(steam, &steam_devices, list) {
- steam_update_lizard_mode(steam);
+ mutex_lock(&steam->mutex);
+ if (!steam->client_opened)
+ steam_set_lizard_mode(steam, lizard_mode);
+ mutex_unlock(&steam->mutex);
}
mutex_unlock(&steam_devices_lock);
return 0;
--
2.19.1
^ permalink raw reply related
* [PATCH] Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15IGM
From: Mikhail Nikiforov @ 2018-10-14 1:46 UTC (permalink / raw)
To: Dmitry Torokhov, linux-input; +Cc: Mikhail Nikiforov, stable
Add ELAN061C to the ACPI table to support Elan touchpad found in Lenovo
IdeaPad 330-15IGM.
Signed-off-by: Mikhail Nikiforov <jackxviichaos@gmail.com>
Cc: stable@vger.kernel.org
---
drivers/input/mouse/elan_i2c_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index f5ae24865355..b0f9d19b3410 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -1346,6 +1346,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
{ "ELAN0611", 0 },
{ "ELAN0612", 0 },
{ "ELAN0618", 0 },
+ { "ELAN061C", 0 },
{ "ELAN061D", 0 },
{ "ELAN0622", 0 },
{ "ELAN1000", 0 },
--
2.17.1
^ permalink raw reply related
* [PATCH] input: touchscreen: fix wm97xx-ts exit path
From: Randy Dunlap @ 2018-10-13 17:06 UTC (permalink / raw)
To: LKML, linux-input@vger.kernel.org
Cc: Robert Jarzmik, Charles Keepax, Dmitry Torokhov, Mark Brown,
patches
From: Randy Dunlap <rdunlap@infradead.org>
Loading then unloading wm97xx-ts.ko when CONFIG_AC97_BUS=m
causes a WARNING: from drivers/base/driver.c:
Unexpected driver unregister!
WARNING: CPU: 0 PID: 1709 at ../drivers/base/driver.c:193 driver_unregister+0x30/0x40
Fix this by only calling driver_unregister() with the same
condition that driver_register() is called.
Fixes: ae9d1b5fbd7b ("Input: wm97xx: add new AC97 bus support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: patches@opensource.cirrus.com
Cc: linux-input@vger.kernel.org
---
drivers/input/touchscreen/wm97xx-core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- lnx-419-rc7.orig/drivers/input/touchscreen/wm97xx-core.c
+++ lnx-419-rc7/drivers/input/touchscreen/wm97xx-core.c
@@ -929,7 +929,8 @@ static int __init wm97xx_init(void)
static void __exit wm97xx_exit(void)
{
- driver_unregister(&wm97xx_driver);
+ if (IS_BUILTIN(CONFIG_AC97_BUS))
+ driver_unregister(&wm97xx_driver);
platform_driver_unregister(&wm97xx_mfd_driver);
}
^ permalink raw reply
* Re: [git pull] Input updates for v4.19-rc7
From: Dmitry Torokhov @ 2018-10-12 20:02 UTC (permalink / raw)
To: Greg KH; +Cc: Linus Torvalds, linux-kernel, linux-input
In-Reply-To: <20181012105152.GB19643@kroah.com>
On Fri, Oct 12, 2018 at 12:51:52PM +0200, Greg KH wrote:
> On Thu, Oct 11, 2018 at 04:57:36PM -0700, Dmitry Torokhov wrote:
> > Hi Greg,
> >
> > Please pull from:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git for-linus
> >
> > to receive updates for the input subsystem:
> >
> > - we added a few scheduling points into various input interfaces to
> > ensure that large writes will not cause RCU stalls
> >
> > - fixed configuring PS/2 keyboards as wakeup devices on newer platforms
>
> That feels like a really "late" contribution, I hope it goes well :)
Yeah, that is true, but I'd be marking it for 4.19 stable anyway as we
do want newer devices to wake up on keyboard activity, so there was no
reason not to send it now. If we have to revert we'd be reverting
everywhere anyways.
FWIW Daniel posted the patch a while ago, we just have been working out
kinks in handling builds with different config options.
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v2] dt-bindings: input: pwm-vibrator: correct pwms in example
From: Rob Herring @ 2018-10-12 19:31 UTC (permalink / raw)
Cc: robh, dmitry.torokhov, linux-input, devicetree, linux-kernel,
sebastian.reichel, mark.rutland, masneyb
In-Reply-To: <20180927004858.32529-1-masneyb@onstation.org>
On Wed, 26 Sep 2018 20:48:58 -0400, Brian Masney wrote:
> In the example for the pwm-vibrator bindings, pwm8 is the direction pin,
> and pwm9 is the enable pin. The pwms on the vibrator node has these two
> values swapped so this patch corrects it.
>
> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---
> Changes since v1:
> - Swapped the pwms values instead of the pwm-names values since enable
> is required and direction is optional. Based on feedback from
> Rob Herring.
>
> Documentation/devicetree/bindings/input/pwm-vibrator.txt | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* Re: [PATCH 0/5] Fix Elan I2C touchpads in latest generation from Lenovo
From: Benjamin Tissoires @ 2018-10-12 19:07 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: 廖崇榮, Rob Herring, open list:HID CORE LAYER,
lkml, devicetree
In-Reply-To: <20181012185342.GA35430@dtor-ws>
On Fri, Oct 12, 2018 at 8:53 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Fri, Oct 12, 2018 at 04:24:08PM +0200, Benjamin Tissoires wrote:
> > Since v4.18, we unconditionally switch the I2C capable touchpads over I2C.
> > In the model I had (a pre-prod t480s I guess), the touchpad was behaving
> > fine.
> > However, it occurs that later production models don't expose the clickpad
> > information from I2C. The Windows driver gets all the information from PS/2
> > so we should do the same.
> >
> > The situation is even worse for the P52. Once of the query parameter function
> > fails, which means the touchpad doesn't even probe. This effectively kills
> > the touchpad, which is less than ideal.
> >
> > Dmitry, I am not sure if we should take those for stable in v4.18+.
> > I'd like to, but given the series is 5 patches, I don't know if this
> > will be acceptable.
> > We could revert in stable df077237cf55928f5 but that would mean
> > distributions will have to revert the revert if they want to provide
> > the I2C behavior.
> >
> > So, regarding stable: your call :)
>
> Heh ;) I think we have to fix it at least in 4.19 stable train. How
> about we merge it normally into 4.20, and let it cook there for a while.
> If there is no issues, then we can send it to 4.19 stable manually. How
> does this sound?
>
Sounds like a plan :)
Cheers,
Benjamin
^ permalink raw reply
* Re: [PATCH 0/5] Fix Elan I2C touchpads in latest generation from Lenovo
From: Dmitry Torokhov @ 2018-10-12 18:53 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: KT Liao, Rob Herring, linux-input, linux-kernel, devicetree
In-Reply-To: <20181012142413.26107-1-benjamin.tissoires@redhat.com>
On Fri, Oct 12, 2018 at 04:24:08PM +0200, Benjamin Tissoires wrote:
> Since v4.18, we unconditionally switch the I2C capable touchpads over I2C.
> In the model I had (a pre-prod t480s I guess), the touchpad was behaving
> fine.
> However, it occurs that later production models don't expose the clickpad
> information from I2C. The Windows driver gets all the information from PS/2
> so we should do the same.
>
> The situation is even worse for the P52. Once of the query parameter function
> fails, which means the touchpad doesn't even probe. This effectively kills
> the touchpad, which is less than ideal.
>
> Dmitry, I am not sure if we should take those for stable in v4.18+.
> I'd like to, but given the series is 5 patches, I don't know if this
> will be acceptable.
> We could revert in stable df077237cf55928f5 but that would mean
> distributions will have to revert the revert if they want to provide
> the I2C behavior.
>
> So, regarding stable: your call :)
Heh ;) I think we have to fix it at least in 4.19 stable train. How
about we merge it normally into 4.20, and let it cook there for a while.
If there is no issues, then we can send it to 4.19 stable manually. How
does this sound?
Thanks.
--
Dmitry
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox