Linux Input/HID development
 help / color / mirror / Atom feed
* Re: [PATCH] Partially revert "HID: generic: create one input report per application type"
From: Benjamin Tissoires @ 2018-09-04 13:33 UTC (permalink / raw)
  To: Jiri Kosina, Dmitry Torokhov; +Cc: open list:HID CORE LAYER, lkml, 3.8+
In-Reply-To: <CAO-hwJKxAt95WTrNT6-SfejEpxZvv5aAgoF25SjTxuTmti=ZUQ@mail.gmail.com>

On Tue, Sep 4, 2018 at 1:55 PM Benjamin Tissoires
<benjamin.tissoires@redhat.com> wrote:
>
> On Fri, Aug 31, 2018 at 11:36 AM Benjamin Tissoires
> <benjamin.tissoires@redhat.com> wrote:
> >
> > This partially reverts commit f07b3c1da92db108662f99417a212fc1eddc44d1.
> >
> > It looks like some mice are not correctly treated by
> > HID_QUIRK_INPUT_PER_APP. Those mice have the following
> > report descriptor:
> >
> > 0x05, 0x01,                    // Usage Page (Generic Desktop)        0
> > 0x09, 0x02,                    // Usage (Mouse)                       2
> > 0xa1, 0x01,                    // Collection (Application)            4
> > 0x85, 0x01,                    //  Report ID (1)                      6
> > 0x09, 0x01,                    //  Usage (Pointer)                    8
> > 0xa1, 0x00,                    //  Collection (Physical)              10
> > 0x95, 0x05,                    //   Report Count (5)                  12
> > 0x75, 0x01,                    //   Report Size (1)                   14
> > 0x05, 0x09,                    //   Usage Page (Button)               16
> > 0x19, 0x01,                    //   Usage Minimum (1)                 18
> > 0x29, 0x05,                    //   Usage Maximum (5)                 20
> > 0x15, 0x00,                    //   Logical Minimum (0)               22
> > 0x25, 0x01,                    //   Logical Maximum (1)               24
> > 0x81, 0x02,                    //   Input (Data,Var,Abs)              26
> > ...
> > 0xc0,                          //  End Collection                     57
> > 0x85, 0x02,                    //  Report ID (2)                      58
> > 0x09, 0x01,                    //  Usage (Consumer Control)           60
> > 0xa1, 0x00,                    //  Collection (Physical)              62
> > 0x75, 0x0c,                    //   Report Size (12)                  64
> > 0x95, 0x02,                    //   Report Count (2)                  66
> > 0x05, 0x01,                    //   Usage Page (Generic Desktop)      68
> > 0x09, 0x30,                    //   Usage (X)                         70
> > 0x09, 0x31,                    //   Usage (Y)                         72
> > 0x16, 0x01, 0xf8,              //   Logical Minimum (-2047)           74
> > 0x26, 0xff, 0x07,              //   Logical Maximum (2047)            77
> > 0x81, 0x06,                    //   Input (Data,Var,Rel)              80
> > 0xc0,                          //  End Collection                     82
> > 0xc0,                          // End Collection                      83
> > ...
> >
> > Both the cursor position and the buttons are located in the
> > same application collection (Mouse) and the kernel should
> > only create one input device for those.
> >
> > However, for an undetermined reason, the kernel splits the
> > device in 2, making systemd not tagging the second mouse
> > with the coordinates only as a mouse. And then userspace
> > ignores it which leads to a mouse where only the buttons
> > are working.
> >
> > Until the quirk gets properly fixed, we should probably
> > revert applying it to all of the generic devices and
> > re-enable it when the root reason has been found.
>
> Jiri,
>
> I actually just got the proper fix today. I think it would be better
> to directly take the fix instead of the revert and a revert of the
> revert later.
>
> I just need to make sure the tests are correctly handled and I should
> be able to submit the patch today.

Patch now submitted: https://patchwork.kernel.org/patch/10587369/

Cheers,
Benjamin

^ permalink raw reply

* [PATCH] Input: wm97xx: only unregister wm97xx_driver if it has been registered
From: Colin King @ 2018-09-04 18:35 UTC (permalink / raw)
  To: Charles Keepax, Robert Jarzmik, Mark Brown, Mauro Carvalho Chehab,
	patches, linux-input
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

In the case where IS_BUILTIN(CONFIG_AC97_BUS)) is not true, the
wm97xx_driver driver is being unregistered even it has not been
previously registered.  Fix this by only unregistering it if
IS_BUILTIN(CONFIG_AC97_BUS)) is true.  This fixes the warning
message:

[  834.111248] ------------[ cut here ]------------
[  834.111248] Unexpected driver unregister!
[  834.111319] WARNING: CPU: 2 PID: 11749 at drivers/base/driver.c:193 driver_unregister+0x3b/0x40
[  834.111319] Modules linked in: wm97xx_ts(-) ....

..and a stack trace.

To easily reproduce this, load and unload the module on a system where
the hardware is not supported.

Fixes: ae9d1b5fbd7b ("Input: wm97xx: add new AC97 bus support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/input/touchscreen/wm97xx-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index 2566b4d8b342..73856c2a8ac0 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/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);
 }
 
-- 
2.17.1

^ permalink raw reply related

* Re: [PATCH 1/4] HID: multitouch: fix Elan panels with 2 input modes declaration
From: Jiri Kosina @ 2018-09-04 19:31 UTC (permalink / raw)
  To: Benjamin Tissoires; +Cc: Dmitry Torokhov, linux-input, linux-kernel, stable
In-Reply-To: <20180904133115.5111-2-benjamin.tissoires@redhat.com>

On Tue, 4 Sep 2018, Benjamin Tissoires wrote:

> When implementing commit 7f81c8db5489 ("HID: multitouch: simplify
> the settings of the various features"), I wrongly removed a test
> that made sure we never try to set the second InputMode feature
> to something else than 0.
> 
> This broke badly some recent Elan panels that now forget to send the
> click button in some area of the touchpad.
> 
> Fixes 7f81c8db5489

Please make sure that the 'Fixes:' tag is always in proper format. There 
are tools depending on that :)

I'll fix that up manually.

Thanks!

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* Re: [PATCH 0/4] HID fixes
From: Jiri Kosina @ 2018-09-04 19:33 UTC (permalink / raw)
  To: Benjamin Tissoires; +Cc: Dmitry Torokhov, linux-input, linux-kernel
In-Reply-To: <20180904133115.5111-1-benjamin.tissoires@redhat.com>

On Tue, 4 Sep 2018, Benjamin Tissoires wrote:

> Hi Jiri,
> 
> there is no real link between those 4 commit but the fact that I wrote
> them today ;)
> 
> 2 patches should at least be scheduled for v4.19: 1/4 and 3/4
> Both are stable fixes for mistakes I made in v4.18.
> 
> Patch 2 and 4 are just nice to have, so v4.20 should be fine.

And I've queued the patches exactly like that. Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* Re: [PATCH v2 1/5] Add the `REL_WHEEL_HI_RES` event code
From: Dmitry Torokhov @ 2018-09-05  0:25 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Harry Cutts, linux-input, LKML, Jiri Kosina, Benjamin Tissoires,
	linux-doc, Jonathan Corbet
In-Reply-To: <nycvar.YFH.7.76.1809031542370.25787@cbobk.fhfr.pm>

On Mon, Sep 03, 2018 at 03:43:13PM +0200, Jiri Kosina wrote:
> On Thu, 30 Aug 2018, Harry Cutts wrote:
> 
> > This event code represents scroll reports from high-resolution wheels,
> > and will be used by future patches in this series. See the linux-input
> > "Reporting high-resolution scroll events" thread [0] for more details.
> > 
> > [0]: https://www.spinics.net/lists/linux-input/msg57380.html
> > 
> > Signed-off-by: Harry Cutts <hcutts@chromium.org>
> > ---
> > 
> > Changes in v2: None
> > 
> >  Documentation/input/event-codes.rst    | 11 ++++++++++-
> >  include/uapi/linux/input-event-codes.h |  1 +
> >  2 files changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/input/event-codes.rst b/Documentation/input/event-codes.rst
> > index a8c0873beb95..cef220c176a4 100644
> > --- a/Documentation/input/event-codes.rst
> > +++ b/Documentation/input/event-codes.rst
> > @@ -190,7 +190,16 @@ A few EV_REL codes have special meanings:
> >  * REL_WHEEL, REL_HWHEEL:
> >  
> >    - These codes are used for vertical and horizontal scroll wheels,
> > -    respectively.
> > +    respectively. The value is the number of "notches" moved on the wheel, the
> > +    physical size of which varies by device. For high-resolution wheels (which
> > +    report multiple events for each notch of movement, or do not have notches)
> > +    this may be an approximation based on the high-resolution scroll events.
> > +
> > +* REL_WHEEL_HI_RES:
> > +
> > +  - If a vertical scroll wheel supports high-resolution scrolling, this code
> > +    will be emitted in addition to REL_WHEEL. The value is the (approximate)
> > +    distance travelled by the user's finger, in microns.
> >  
> >  EV_ABS
> >  ------
> > diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
> > index 53fbae27b280..dad8d3890a3a 100644
> > --- a/include/uapi/linux/input-event-codes.h
> > +++ b/include/uapi/linux/input-event-codes.h
> > @@ -708,6 +708,7 @@
> >  #define REL_DIAL		0x07
> >  #define REL_WHEEL		0x08
> >  #define REL_MISC		0x09
> > +#define REL_WHEEL_HI_RES	0x0a
> >  #define REL_MAX			0x0f
> >  #define REL_CNT			(REL_MAX+1)
> 
> Dmitry, is this OK with you?

Yep, please feel free to merge through your tree.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Thanks.

-- 
Dmitry

^ permalink raw reply

* [PATCH] input: keyboard: gpio-keys: Fixed a documentation index issue.
From: Song Qiang @ 2018-09-05  4:13 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: robh+dt, mark.rutland, linux-input, linux-kernel, linux-doc,
	Song Qiang

gpio_keys.c now exists in the drivers/input/keyboard/ rather than
drivers/input/.

Signed-off-by: Song Qiang <songqiang.1304521@gmail.com>
---
 Documentation/devicetree/bindings/input/gpio-keys.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/gpio-keys.txt b/Documentation/devicetree/bindings/input/gpio-keys.txt
index 996ce84352cb..7cccc49b6bea 100644
--- a/Documentation/devicetree/bindings/input/gpio-keys.txt
+++ b/Documentation/devicetree/bindings/input/gpio-keys.txt
@@ -1,4 +1,4 @@
-Device-Tree bindings for input/gpio_keys.c keyboard driver
+Device-Tree bindings for input/keyboard/gpio_keys.c keyboard driver
 
 Required properties:
 	- compatible = "gpio-keys";
-- 
2.17.1

^ permalink raw reply related

* Re: [PATCH] HID: core: fix NULL pointer dereference
From: Stefan Agner @ 2018-09-05  5:32 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Jiri Kosina, Benjamin Tissoires, linux-input, linux-kernel
In-Reply-To: <20180829152209.GA29831@embeddedor.com>

On 29.08.2018 08:22, Gustavo A. R. Silva wrote:
> There is a NULL pointer dereference in case memory resources
> for *parse* are not successfully allocated.
> 
> Fix this by adding a new goto label and make the execution
> path jump to it in case vzalloc() fails.
> 
> Addresses-Coverity-ID: 1473081 ("Dereference after null check")
> Fixes: b2dd9f2e5a8a ("HID: core: fix memory leak on probe")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Reviewed-by: Stefan Agner <stefan@agner.ch>

--
Stefan

> ---
>  drivers/hid/hid-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 4548dae..5bec924 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1000,7 +1000,7 @@ int hid_open_report(struct hid_device *device)
>  	parser = vzalloc(sizeof(struct hid_parser));
>  	if (!parser) {
>  		ret = -ENOMEM;
> -		goto err;
> +		goto alloc_err;
>  	}
>  
>  	parser->device = device;
> @@ -1049,6 +1049,7 @@ int hid_open_report(struct hid_device *device)
>  	hid_err(device, "item fetching failed at offset %d\n", (int)(end - start));
>  err:
>  	kfree(parser->collection_stack);
> +alloc_err:
>  	vfree(parser);
>  	hid_close_report(device);
>  	return ret;

^ permalink raw reply

* Re: [PATCH 1/4] HID: multitouch: fix Elan panels with 2 input modes declaration
From: Benjamin Tissoires @ 2018-09-05  7:01 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Dmitry Torokhov, open list:HID CORE LAYER, lkml, 3.8+
In-Reply-To: <nycvar.YFH.7.76.1809042130260.15880@cbobk.fhfr.pm>

On Tue, Sep 4, 2018 at 9:31 PM Jiri Kosina <jikos@kernel.org> wrote:
>
> On Tue, 4 Sep 2018, Benjamin Tissoires wrote:
>
> > When implementing commit 7f81c8db5489 ("HID: multitouch: simplify
> > the settings of the various features"), I wrongly removed a test
> > that made sure we never try to set the second InputMode feature
> > to something else than 0.
> >
> > This broke badly some recent Elan panels that now forget to send the
> > click button in some area of the touchpad.
> >
> > Fixes 7f81c8db5489
>
> Please make sure that the 'Fixes:' tag is always in proper format. There
> are tools depending on that :)

Oops, thanks for fixing it. Lazy me :)

Cheers,
Benjamin

>
> I'll fix that up manually.
>
> Thanks!
>
> --
> Jiri Kosina
> SUSE Labs
>

^ permalink raw reply

* Re: [PATCH] HID: core: fix NULL pointer dereference
From: Jiri Kosina @ 2018-09-05  8:08 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Stefan Agner, Benjamin Tissoires, linux-input, linux-kernel
In-Reply-To: <20180829152209.GA29831@embeddedor.com>

On Wed, 29 Aug 2018, Gustavo A. R. Silva wrote:

> There is a NULL pointer dereference in case memory resources
> for *parse* are not successfully allocated.
> 
> Fix this by adding a new goto label and make the execution
> path jump to it in case vzalloc() fails.
> 
> Addresses-Coverity-ID: 1473081 ("Dereference after null check")
> Fixes: b2dd9f2e5a8a ("HID: core: fix memory leak on probe")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  drivers/hid/hid-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 4548dae..5bec924 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1000,7 +1000,7 @@ int hid_open_report(struct hid_device *device)
>  	parser = vzalloc(sizeof(struct hid_parser));
>  	if (!parser) {
>  		ret = -ENOMEM;
> -		goto err;
> +		goto alloc_err;
>  	}
>  
>  	parser->device = device;
> @@ -1049,6 +1049,7 @@ int hid_open_report(struct hid_device *device)
>  	hid_err(device, "item fetching failed at offset %d\n", (int)(end - start));
>  err:
>  	kfree(parser->collection_stack);
> +alloc_err:
>  	vfree(parser);
>  	hid_close_report(device);
>  	return ret;

Queued in for-4.19/fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* Re: [PATCH v2 0/5] Add support for high-resolution scrolling on Logitech mice
From: Jiri Kosina @ 2018-09-05  8:13 UTC (permalink / raw)
  To: Harry Cutts
  Cc: linux-input, LKML, Dmitry Torokhov, Benjamin Tissoires, linux-doc,
	Jonathan Corbet
In-Reply-To: <20180830215622.47550-1-hcutts@chromium.org>

On Thu, 30 Aug 2018, Harry Cutts wrote:

> This is v2 of the patch set adding support for high-resolution scroll 
> wheels on Logitech mice. See the linux-input "Reporting high-resolution 
> scroll events" thread [0] for previous discussion of the evdev changes. 
> I would love to hear your feedback.

Queued in for-4.20/logitech-highres. Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* Re: [PATCH v2 0/2] Rumble support for Xbox One S controller
From: Jiri Kosina @ 2018-09-05  8:20 UTC (permalink / raw)
  To: Andrey Smirnov
  Cc: Dmitry Torokhov, Benjamin Tissoires, linux-input, linux-kernel,
	Pierre-Loup A . Griffais, Juha Kuikka
In-Reply-To: <20180816024410.29218-1-andrew.smirnov@gmail.com>

On Wed, 15 Aug 2018, Andrey Smirnov wrote:

> This is v2 of the patches adding support for rumble for Xbox One S
> controller connected over Bluetooth. Hopefully all of the changes are
> pretty straightforward and self-explanatory.

Applied to for-4.20/microsoft branch. Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* Re: [PATCH] hid: hid-core: Fix a sleep-in-atomic-context bug in __hid_request()
From: Jiri Kosina @ 2018-09-05  8:29 UTC (permalink / raw)
  To: Jia-Ju Bai; +Cc: benjamin.tissoires, linux-input, linux-kernel
In-Reply-To: <20180901121659.1257-1-baijiaju1990@gmail.com>

On Sat, 1 Sep 2018, Jia-Ju Bai wrote:

> The driver may sleep with holding a spinlock.
> 
> The function call paths (from bottom to top) in Linux-4.16 are:
> 
> [FUNC] hid_alloc_report_buf(GFP_KERNEL)
> drivers/hid/hid-core.c, 1435: 
> 	hid_alloc_report_buf in __hid_request
> ./include/linux/hid.h, 1023: 
> 	__hid_request in hid_hw_request
> drivers/hid/hid-picolcd_core.c, 111: 
> 	hid_hw_request in picolcd_send_and_wait
> drivers/hid/hid-picolcd_core.c, 100: 
> 	_raw_spin_lock_irqsave in picolcd_send_and_wait
> 
> [FUNC] hid_alloc_report_buf(GFP_KERNEL)
> drivers/hid/hid-core.c, 1435: 
> 	hid_alloc_report_buf in __hid_request
> ./include/linux/hid.h, 1023: 
> 	__hid_request in hid_hw_request
> drivers/hid/hid-picolcd_core.c, 245: 
> 	hid_hw_request in picolcd_reset
> drivers/hid/hid-picolcd_core.c, 235: 
> 	_raw_spin_lock_irqsave in picolcd_reset
> 
> [FUNC] hid_alloc_report_buf(GFP_KERNEL)
> drivers/hid/hid-core.c, 1435: 
> 	hid_alloc_report_buf in __hid_request
> ./include/linux/hid.h, 1023: 
> 	__hid_request in hid_hw_request
> drivers/hid/hid-picolcd_fb.c, 215: 
> 	hid_hw_request in picolcd_fb_reset
> drivers/hid/hid-picolcd_fb.c, 206: 
> 	_raw_spin_lock_irqsave in picolcd_fb_reset
> 
> [FUNC] hid_alloc_report_buf(GFP_KERNEL)
> drivers/hid/hid-core.c, 1435: 
> 	hid_alloc_report_buf in __hid_request
> ./include/linux/hid.h, 1023: 
> 	__hid_request in hid_hw_request
> drivers/hid/hid-lg4ff.c, 465: 
> 	hid_hw_request in lg4ff_play
> drivers/hid/hid-lg4ff.c, 441: 
> 	_raw_spin_lock_irqsave in lg4ff_play
> 
> To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
> 
> This bug is found by my static analysis tool DSAC.

Could you please rewrite the changelog so that it's human readable? The 
above is a bit hard to understand, I think something along the lines of 
"__hid_request() has to be allocating with GFP_ATOMIC because there are 
the following callchains leading to __hid_request() being an atomic 
context: ... a->b->c.._hid_request()" etc.

Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* Re: [PATCH] Input: wm97xx: only unregister wm97xx_driver if it has been registered
From: Charles Keepax @ 2018-09-05  9:16 UTC (permalink / raw)
  To: Colin King
  Cc: Charles Keepax, Robert Jarzmik, Mark Brown, Mauro Carvalho Chehab,
	patches, linux-input, kernel-janitors, linux-kernel
In-Reply-To: <20180904183505.10693-1-colin.king@canonical.com>

On Tue, Sep 04, 2018 at 07:35:05PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where IS_BUILTIN(CONFIG_AC97_BUS)) is not true, the
> wm97xx_driver driver is being unregistered even it has not been
> previously registered.  Fix this by only unregistering it if
> IS_BUILTIN(CONFIG_AC97_BUS)) is true.  This fixes the warning
> message:
> 
> [  834.111248] ------------[ cut here ]------------
> [  834.111248] Unexpected driver unregister!
> [  834.111319] WARNING: CPU: 2 PID: 11749 at drivers/base/driver.c:193 driver_unregister+0x3b/0x40
> [  834.111319] Modules linked in: wm97xx_ts(-) ....
> 
> ..and a stack trace.
> 
> To easily reproduce this, load and unload the module on a system where
> the hardware is not supported.
> 
> Fixes: ae9d1b5fbd7b ("Input: wm97xx: add new AC97 bus support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

^ permalink raw reply

* [PATCH 1/2] input: egalax_ts: add system wakeup support
From: Anson Huang @ 2018-09-05  9:26 UTC (permalink / raw)
  To: dmitry.torokhov, robh+dt, mark.rutland, marco.franchi,
	fabio.estevam, linux-input, devicetree, linux-kernel
  Cc: Linux-imx

This patch adds wakeup function support for egalax touch
screen, if "wakeup-source" is added to device tree's egalax
touch screen node, the wakeup function will be enabled, and
egalax touch screen will be able to wakeup system from suspend.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/input/touchscreen/egalax_ts.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 80e69bb..74984ed 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -164,6 +164,7 @@ static int egalax_firmware_version(struct i2c_client *client)
 static int egalax_ts_probe(struct i2c_client *client,
 			   const struct i2c_device_id *id)
 {
+	struct device_node *np = client->dev.of_node;
 	struct egalax_ts *ts;
 	struct input_dev *input_dev;
 	int error;
@@ -224,6 +225,9 @@ static int egalax_ts_probe(struct i2c_client *client,
 	if (error)
 		return error;
 
+	if (of_property_read_bool(np, "wakeup-source"))
+		device_init_wakeup(&client->dev, true);
+
 	return 0;
 }
 
@@ -241,6 +245,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev)
 	struct i2c_client *client = to_i2c_client(dev);
 	int ret;
 
+	if (device_may_wakeup(dev))
+		return enable_irq_wake(client->irq);
+
 	ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN);
 	return ret > 0 ? 0 : ret;
 }
@@ -249,6 +256,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
+	if (device_may_wakeup(dev))
+		return 0;
+
 	return egalax_wake_up_device(client);
 }
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH 2/2] dt-bindings: egalax-ts: add support for wakeup event action
From: Anson Huang @ 2018-09-05  9:26 UTC (permalink / raw)
  To: dmitry.torokhov, robh+dt, mark.rutland, marco.franchi,
	fabio.estevam, linux-input, devicetree, linux-kernel
  Cc: Linux-imx
In-Reply-To: <1536139607-16848-1-git-send-email-Anson.Huang@nxp.com>

Add support for wakeup event action, this would allow the device
to configure whether to be a wakeup source of system suspend.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
index 92fb262..296a9cd 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
@@ -6,6 +6,7 @@ Required properties:
 - interrupts: touch controller interrupt
 - wakeup-gpios: the gpio pin to be used for waking up the controller
   and also used as irq pin
+- wakeup-source: boolean, touch screen can wake-up the system
 
 Example:
 
@@ -15,4 +16,5 @@ Example:
 		interrupt-parent = <&gpio1>;
 		interrupts = <9 2>;
 		wakeup-gpios = <&gpio1 9 0>;
+		wakeup-source;
 	};
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH 1/2] input: egalax_ts: add system wakeup support
From: Andi Shyti @ 2018-09-05 10:34 UTC (permalink / raw)
  To: Anson Huang
  Cc: dmitry.torokhov, robh+dt, mark.rutland, marco.franchi,
	fabio.estevam, linux-input, devicetree, linux-kernel, Linux-imx
In-Reply-To: <1536139607-16848-1-git-send-email-Anson.Huang@nxp.com>

Hi Anson,

On Wed, Sep 05, 2018 at 05:26:46PM +0800, Anson Huang wrote:
> This patch adds wakeup function support for egalax touch
> screen, if "wakeup-source" is added to device tree's egalax
> touch screen node, the wakeup function will be enabled, and
> egalax touch screen will be able to wakeup system from suspend.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

I think you messed up the order of the patches, this patch
whould come after the PATCH 2/2.

You first create the property and then use it. If someone checks
out right here, he would find an inconsistency between the dts
property and this code.

You can either send a version 2 with the correct order or check
if Dmitry and Rob are willing to sync for who takes first the
patch first.

Andi

^ permalink raw reply

* Re: [PATCH 1/2] input: egalax_ts: add system wakeup support
From: Dmitry Torokhov @ 2018-09-05 17:27 UTC (permalink / raw)
  To: Anson Huang
  Cc: robh+dt, mark.rutland, marco.franchi, fabio.estevam, linux-input,
	devicetree, linux-kernel, Linux-imx
In-Reply-To: <1536139607-16848-1-git-send-email-Anson.Huang@nxp.com>

Hi Anson,

On Wed, Sep 05, 2018 at 05:26:46PM +0800, Anson Huang wrote:
> This patch adds wakeup function support for egalax touch
> screen, if "wakeup-source" is added to device tree's egalax
> touch screen node, the wakeup function will be enabled, and
> egalax touch screen will be able to wakeup system from suspend.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>  drivers/input/touchscreen/egalax_ts.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
> index 80e69bb..74984ed 100644
> --- a/drivers/input/touchscreen/egalax_ts.c
> +++ b/drivers/input/touchscreen/egalax_ts.c
> @@ -164,6 +164,7 @@ static int egalax_firmware_version(struct i2c_client *client)
>  static int egalax_ts_probe(struct i2c_client *client,
>  			   const struct i2c_device_id *id)
>  {
> +	struct device_node *np = client->dev.of_node;
>  	struct egalax_ts *ts;
>  	struct input_dev *input_dev;
>  	int error;
> @@ -224,6 +225,9 @@ static int egalax_ts_probe(struct i2c_client *client,
>  	if (error)
>  		return error;
>  
> +	if (of_property_read_bool(np, "wakeup-source"))
> +		device_init_wakeup(&client->dev, true);

This is done in i2c core, there is no need to do it in the driver.

> +
>  	return 0;
>  }
>  
> @@ -241,6 +245,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev)
>  	struct i2c_client *client = to_i2c_client(dev);
>  	int ret;
>  
> +	if (device_may_wakeup(dev))
> +		return enable_irq_wake(client->irq);
> +
>  	ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN);
>  	return ret > 0 ? 0 : ret;
>  }
> @@ -249,6 +256,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  
> +	if (device_may_wakeup(dev))
> +		return 0;

This will end up with unbalanced enable_irq_wake() from suspend.

> +
>  	return egalax_wake_up_device(client);
>  }
>  
> -- 
> 2.7.4
> 

Thanks.

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH] hid: hid-core: Fix a sleep-in-atomic-context bug in __hid_request()
From: Jia-Ju Bai @ 2018-09-06  2:35 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: benjamin.tissoires, linux-input, linux-kernel
In-Reply-To: <nycvar.YFH.7.76.1809051026540.15880@cbobk.fhfr.pm>



On 2018/9/5 16:29, Jiri Kosina wrote:
> On Sat, 1 Sep 2018, Jia-Ju Bai wrote:
>
>> The driver may sleep with holding a spinlock.
>>
>> The function call paths (from bottom to top) in Linux-4.16 are:
>>
>> [FUNC] hid_alloc_report_buf(GFP_KERNEL)
>> drivers/hid/hid-core.c, 1435:
>> 	hid_alloc_report_buf in __hid_request
>> ./include/linux/hid.h, 1023:
>> 	__hid_request in hid_hw_request
>> drivers/hid/hid-picolcd_core.c, 111:
>> 	hid_hw_request in picolcd_send_and_wait
>> drivers/hid/hid-picolcd_core.c, 100:
>> 	_raw_spin_lock_irqsave in picolcd_send_and_wait
>>
>> [FUNC] hid_alloc_report_buf(GFP_KERNEL)
>> drivers/hid/hid-core.c, 1435:
>> 	hid_alloc_report_buf in __hid_request
>> ./include/linux/hid.h, 1023:
>> 	__hid_request in hid_hw_request
>> drivers/hid/hid-picolcd_core.c, 245:
>> 	hid_hw_request in picolcd_reset
>> drivers/hid/hid-picolcd_core.c, 235:
>> 	_raw_spin_lock_irqsave in picolcd_reset
>>
>> [FUNC] hid_alloc_report_buf(GFP_KERNEL)
>> drivers/hid/hid-core.c, 1435:
>> 	hid_alloc_report_buf in __hid_request
>> ./include/linux/hid.h, 1023:
>> 	__hid_request in hid_hw_request
>> drivers/hid/hid-picolcd_fb.c, 215:
>> 	hid_hw_request in picolcd_fb_reset
>> drivers/hid/hid-picolcd_fb.c, 206:
>> 	_raw_spin_lock_irqsave in picolcd_fb_reset
>>
>> [FUNC] hid_alloc_report_buf(GFP_KERNEL)
>> drivers/hid/hid-core.c, 1435:
>> 	hid_alloc_report_buf in __hid_request
>> ./include/linux/hid.h, 1023:
>> 	__hid_request in hid_hw_request
>> drivers/hid/hid-lg4ff.c, 465:
>> 	hid_hw_request in lg4ff_play
>> drivers/hid/hid-lg4ff.c, 441:
>> 	_raw_spin_lock_irqsave in lg4ff_play
>>
>> To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
>>
>> This bug is found by my static analysis tool DSAC.
> Could you please rewrite the changelog so that it's human readable? The
> above is a bit hard to understand, I think something along the lines of
> "__hid_request() has to be allocating with GFP_ATOMIC because there are
> the following callchains leading to __hid_request() being an atomic
> context: ... a->b->c.._hid_request()" etc.
>

Okay, I will send a new patch.


Best wishes,
Jia-Ju Bai

^ permalink raw reply

* [PATCH v2] HID: i2c-hid: Don't reset device upon system resume
From: Kai-Heng Feng @ 2018-09-06  2:55 UTC (permalink / raw)
  To: jikos
  Cc: benjamin.tissoires, hdegoede, linux-input, linux-kernel,
	Kai-Heng Feng, Aaron Ma, AceLan Kao

Raydium touchscreen triggers interrupt storm after system-wide suspend:
[ 179.085033] i2c_hid i2c-CUST0000:00: i2c_hid_get_input: incomplete
report (58/65535)

According to Raydium, Windows driver does not reset the device after
system resume.

The HID over I2C spec does specify a reset should be used at
intialization, but it doesn't specify if reset is required for system
suspend.

Tested this patch on other i2c-hid touchpanels I have and those
touchpanels do work after S3 without doing reset. If any regression
happens to other touchpanel vendors, we can use quirk for Raydium
devices.

There's still one device uses I2C_HID_QUIRK_RESEND_REPORT_DESCR so keep
it there.

Cc: Aaron Ma <aaron.ma@canonical.com>
Cc: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
v2:
 Remove Raydium devices' ID and quirk.
 Rewording.

 drivers/hid/hid-ids.h         |  4 ----
 drivers/hid/i2c-hid/i2c-hid.c | 13 +++++++------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 7da93d789080..e254ae802688 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -530,10 +530,6 @@
 #define I2C_VENDOR_ID_HANTICK		0x0911
 #define I2C_PRODUCT_ID_HANTICK_5288	0x5288
 
-#define I2C_VENDOR_ID_RAYD		0x2386
-#define I2C_PRODUCT_ID_RAYD_3118	0x3118
-#define I2C_PRODUCT_ID_RAYD_4B33	0x4B33
-
 #define USB_VENDOR_ID_HANWANG		0x0b57
 #define USB_DEVICE_ID_HANWANG_TABLET_FIRST	0x5000
 #define USB_DEVICE_ID_HANWANG_TABLET_LAST	0x8fff
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 57126f6837bb..f3076659361a 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -170,12 +170,8 @@ static const struct i2c_hid_quirks {
 		I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV },
 	{ I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
 		I2C_HID_QUIRK_NO_IRQ_AFTER_RESET },
-	{ I2C_VENDOR_ID_RAYD, I2C_PRODUCT_ID_RAYD_3118,
-		I2C_HID_QUIRK_RESEND_REPORT_DESCR },
 	{ USB_VENDOR_ID_SIS_TOUCH, USB_DEVICE_ID_SIS10FB_TOUCH,
 		I2C_HID_QUIRK_RESEND_REPORT_DESCR },
-	{ I2C_VENDOR_ID_RAYD, I2C_PRODUCT_ID_RAYD_4B33,
-		I2C_HID_QUIRK_RESEND_REPORT_DESCR },
 	{ 0, 0 }
 };
 
@@ -1237,11 +1233,16 @@ static int i2c_hid_resume(struct device *dev)
 	pm_runtime_enable(dev);
 
 	enable_irq(client->irq);
-	ret = i2c_hid_hwreset(client);
+
+	/* Instead of resetting device, simply powers the device on. This
+	 * solves "incomplete reports" on Raydium devices 2386:3118 and
+	 * 2386:4B33
+	 */
+	ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
 	if (ret)
 		return ret;
 
-	/* RAYDIUM device (2386:3118) need to re-send report descr cmd
+	/* Some devices need to re-send report descr cmd
 	 * after resume, after this it will be back normal.
 	 * otherwise it issues too many incomplete reports.
 	 */
-- 
2.17.1

^ permalink raw reply related

* [PATCH V2] input: egalax_ts: add system wakeup support
From: Anson Huang @ 2018-09-06  3:24 UTC (permalink / raw)
  To: dmitry.torokhov, fabio.estevam, linux-input, linux-kernel; +Cc: Linux-imx

This patch adds wakeup function support for egalax touch
screen, if "wakeup-source" is added to device tree's egalax
touch screen node, the wakeup function will be enabled, and
egalax touch screen will be able to wakeup system from suspend.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
changes since V1:
	remove unnecessary device wakeup check and fix the irq wake balance issue.
 drivers/input/touchscreen/egalax_ts.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 80e69bb..83ac8c1 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -241,6 +241,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev)
 	struct i2c_client *client = to_i2c_client(dev);
 	int ret;
 
+	if (device_may_wakeup(dev))
+		return enable_irq_wake(client->irq);
+
 	ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN);
 	return ret > 0 ? 0 : ret;
 }
@@ -249,6 +252,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 
+	if (device_may_wakeup(dev))
+		return disable_irq_wake(client->irq);
+
 	return egalax_wake_up_device(client);
 }
 
-- 
2.7.4

^ permalink raw reply related

* RE: [PATCH 1/2] input: egalax_ts: add system wakeup support
From: Anson Huang @ 2018-09-06  3:30 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: robh+dt@kernel.org, mark.rutland@arm.com, Marco Antonio Franchi,
	Fabio Estevam, linux-input@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	dl-linux-imx
In-Reply-To: <20180905172700.GA257188@dtor-ws>

Hi, Dmitry

Anson Huang
Best Regards!


> -----Original Message-----
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Sent: Thursday, September 6, 2018 1:27 AM
> To: Anson Huang <anson.huang@nxp.com>
> Cc: robh+dt@kernel.org; mark.rutland@arm.com; Marco Antonio Franchi
> <marco.franchi@nxp.com>; Fabio Estevam <fabio.estevam@nxp.com>;
> linux-input@vger.kernel.org; devicetree@vger.kernel.org;
> linux-kernel@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH 1/2] input: egalax_ts: add system wakeup support
> 
> Hi Anson,
> 
> On Wed, Sep 05, 2018 at 05:26:46PM +0800, Anson Huang wrote:
> > This patch adds wakeup function support for egalax touch screen, if
> > "wakeup-source" is added to device tree's egalax touch screen node,
> > the wakeup function will be enabled, and egalax touch screen will be
> > able to wakeup system from suspend.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> >  drivers/input/touchscreen/egalax_ts.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/input/touchscreen/egalax_ts.c
> > b/drivers/input/touchscreen/egalax_ts.c
> > index 80e69bb..74984ed 100644
> > --- a/drivers/input/touchscreen/egalax_ts.c
> > +++ b/drivers/input/touchscreen/egalax_ts.c
> > @@ -164,6 +164,7 @@ static int egalax_firmware_version(struct
> > i2c_client *client)  static int egalax_ts_probe(struct i2c_client *client,
> >  			   const struct i2c_device_id *id)  {
> > +	struct device_node *np = client->dev.of_node;
> >  	struct egalax_ts *ts;
> >  	struct input_dev *input_dev;
> >  	int error;
> > @@ -224,6 +225,9 @@ static int egalax_ts_probe(struct i2c_client *client,
> >  	if (error)
> >  		return error;
> >
> > +	if (of_property_read_bool(np, "wakeup-source"))
> > +		device_init_wakeup(&client->dev, true);
> 
> This is done in i2c core, there is no need to do it in the driver.
 
Correct, I removed it in V2 patch.


> 
> > +
> >  	return 0;
> >  }
> >
> > @@ -241,6 +245,9 @@ static int __maybe_unused
> egalax_ts_suspend(struct device *dev)
> >  	struct i2c_client *client = to_i2c_client(dev);
> >  	int ret;
> >
> > +	if (device_may_wakeup(dev))
> > +		return enable_irq_wake(client->irq);
> > +
> >  	ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN);
> >  	return ret > 0 ? 0 : ret;
> >  }
> > @@ -249,6 +256,9 @@ static int __maybe_unused egalax_ts_resume(struct
> > device *dev)  {
> >  	struct i2c_client *client = to_i2c_client(dev);
> >
> > +	if (device_may_wakeup(dev))
> > +		return 0;
> 
> This will end up with unbalanced enable_irq_wake() from suspend.

Ah, it is a mistake, I fix it in V2 patch, please help review it.

And for the other patch about adding "wakeup-source" into dt-binding, I think it may
be no need now, since it is already included in i2c's dt-binding, right?

Thanks.

Anson.

> 
> > +
> >  	return egalax_wake_up_device(client);  }
> >
> > --
> > 2.7.4
> >
> 
> Thanks.
> 
> --
> Dmitry

^ permalink raw reply

* Re: [PATCH v2] HID: i2c-hid: Don't reset device upon system resume
From: Benjamin Tissoires @ 2018-09-06  7:07 UTC (permalink / raw)
  To: Kai Heng Feng
  Cc: Jiri Kosina, Hans de Goede, open list:HID CORE LAYER, lkml,
	Aaron Ma, AceLan Kao
In-Reply-To: <20180906025518.30191-1-kai.heng.feng@canonical.com>

On Thu, Sep 6, 2018 at 4:55 AM Kai-Heng Feng
<kai.heng.feng@canonical.com> wrote:
>
> Raydium touchscreen triggers interrupt storm after system-wide suspend:
> [ 179.085033] i2c_hid i2c-CUST0000:00: i2c_hid_get_input: incomplete
> report (58/65535)
>
> According to Raydium, Windows driver does not reset the device after
> system resume.
>
> The HID over I2C spec does specify a reset should be used at
> intialization, but it doesn't specify if reset is required for system
> suspend.
>
> Tested this patch on other i2c-hid touchpanels I have and those
> touchpanels do work after S3 without doing reset. If any regression
> happens to other touchpanel vendors, we can use quirk for Raydium
> devices.
>
> There's still one device uses I2C_HID_QUIRK_RESEND_REPORT_DESCR so keep
> it there.
>
> Cc: Aaron Ma <aaron.ma@canonical.com>
> Cc: AceLan Kao <acelan.kao@canonical.com>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>

Jiri, note that this will replace https://patchwork.kernel.org/patch/10583481/

Cheers,
Benjamin

> ---
> v2:
>  Remove Raydium devices' ID and quirk.
>  Rewording.
>
>  drivers/hid/hid-ids.h         |  4 ----
>  drivers/hid/i2c-hid/i2c-hid.c | 13 +++++++------
>  2 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 7da93d789080..e254ae802688 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -530,10 +530,6 @@
>  #define I2C_VENDOR_ID_HANTICK          0x0911
>  #define I2C_PRODUCT_ID_HANTICK_5288    0x5288
>
> -#define I2C_VENDOR_ID_RAYD             0x2386
> -#define I2C_PRODUCT_ID_RAYD_3118       0x3118
> -#define I2C_PRODUCT_ID_RAYD_4B33       0x4B33
> -
>  #define USB_VENDOR_ID_HANWANG          0x0b57
>  #define USB_DEVICE_ID_HANWANG_TABLET_FIRST     0x5000
>  #define USB_DEVICE_ID_HANWANG_TABLET_LAST      0x8fff
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index 57126f6837bb..f3076659361a 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -170,12 +170,8 @@ static const struct i2c_hid_quirks {
>                 I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV },
>         { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
>                 I2C_HID_QUIRK_NO_IRQ_AFTER_RESET },
> -       { I2C_VENDOR_ID_RAYD, I2C_PRODUCT_ID_RAYD_3118,
> -               I2C_HID_QUIRK_RESEND_REPORT_DESCR },
>         { USB_VENDOR_ID_SIS_TOUCH, USB_DEVICE_ID_SIS10FB_TOUCH,
>                 I2C_HID_QUIRK_RESEND_REPORT_DESCR },
> -       { I2C_VENDOR_ID_RAYD, I2C_PRODUCT_ID_RAYD_4B33,
> -               I2C_HID_QUIRK_RESEND_REPORT_DESCR },
>         { 0, 0 }
>  };
>
> @@ -1237,11 +1233,16 @@ static int i2c_hid_resume(struct device *dev)
>         pm_runtime_enable(dev);
>
>         enable_irq(client->irq);
> -       ret = i2c_hid_hwreset(client);
> +
> +       /* Instead of resetting device, simply powers the device on. This
> +        * solves "incomplete reports" on Raydium devices 2386:3118 and
> +        * 2386:4B33
> +        */
> +       ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
>         if (ret)
>                 return ret;
>
> -       /* RAYDIUM device (2386:3118) need to re-send report descr cmd
> +       /* Some devices need to re-send report descr cmd
>          * after resume, after this it will be back normal.
>          * otherwise it issues too many incomplete reports.
>          */
> --
> 2.17.1
>

^ permalink raw reply

* Re: [PATCH v2] HID: i2c-hid: Don't reset device upon system resume
From: Jiri Kosina @ 2018-09-06 14:32 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: benjamin.tissoires, hdegoede, linux-input, linux-kernel, Aaron Ma,
	AceLan Kao
In-Reply-To: <20180906025518.30191-1-kai.heng.feng@canonical.com>

On Thu, 6 Sep 2018, Kai-Heng Feng wrote:

> Raydium touchscreen triggers interrupt storm after system-wide suspend:
> [ 179.085033] i2c_hid i2c-CUST0000:00: i2c_hid_get_input: incomplete
> report (58/65535)
> 
> According to Raydium, Windows driver does not reset the device after
> system resume.
> 
> The HID over I2C spec does specify a reset should be used at
> intialization, but it doesn't specify if reset is required for system
> suspend.
> 
> Tested this patch on other i2c-hid touchpanels I have and those
> touchpanels do work after S3 without doing reset. If any regression
> happens to other touchpanel vendors, we can use quirk for Raydium
> devices.
> 
> There's still one device uses I2C_HID_QUIRK_RESEND_REPORT_DESCR so keep
> it there.
> 
> Cc: Aaron Ma <aaron.ma@canonical.com>
> Cc: AceLan Kao <acelan.kao@canonical.com>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Queued in for-4.19/fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* Re: [PATCH V2] input: egalax_ts: add system wakeup support
From: Fabio Estevam @ 2018-09-06 16:46 UTC (permalink / raw)
  To: Anson Huang
  Cc: Dmitry Torokhov, Fabio Estevam, linux-input, linux-kernel,
	NXP Linux Team
In-Reply-To: <1536204258-433-1-git-send-email-Anson.Huang@nxp.com>

On Thu, Sep 6, 2018 at 12:24 AM, Anson Huang <Anson.Huang@nxp.com> wrote:
> This patch adds wakeup function support for egalax touch
> screen, if "wakeup-source" is added to device tree's egalax
> touch screen node, the wakeup function will be enabled, and
> egalax touch screen will be able to wakeup system from suspend.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply

* [PATCH 0/2] input: atakbd.c bug fixes
From: Michael Schmitz @ 2018-09-06 23:40 UTC (permalink / raw)
  To: linux-input; +Cc: debian-68k, linux-m68k

Two bug fixes for the Atari keyboard input driver:

- keymap fixes: multiple keymap errors that had gone unnoticed
  since migration of the m68k keyboard driver code to the
  input framework. Correct the wrong keycodes - keymap is stil
  US but keypad, help and undo keys all generate the correct keycodes now.

- capslock fix: the Atari driver incorrectly assumed that capslock
  were a toggle key (i.e. sending no break scancodes), and synthesized
  a make/break keycode pair on each capslock scancode. This resulted in
  duplicate make/break codes on key release, and capslock functioning as
  a shift key. Remove code sending make/break pairs to get functional
  capslock behaviour.

Tested on my own Atari Falcon 030.

TIA for your review. Please CC linux-m68k in replies.

Cheers,

	Michael

CC to debian-68k, for consideration at the upcoming m68k hackers meeting.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox