* Re: [PATCH v4 0/4] HID: kye: Add support for all kye tablets
From: Jiri Kosina @ 2023-03-24 13:00 UTC (permalink / raw)
To: Yangfl; +Cc: Benjamin Tissoires, linux-input, linux-kernel
In-Reply-To: <CAAXyoMPMbYCV7br9DJn_KCq68RLnimockqU0uvsO8maT3ROxTA@mail.gmail.com>
On Sat, 11 Mar 2023, Yangfl wrote:
> > > This series refactor kye tablet descriptor fixup routine, by using a
> > > template and filling parameters on the fly, and add support for all
> > > possible kye tablets.
> > > ---
> > > v2: fix missing rsize assignment
> > > v3: fix geometry
> > > v4: split patches
> > >
> > > David Yang (4):
> > > HID: kye: Rewrite tablet descriptor fixup routine
> > > HID: kye: Generate tablet fixup descriptors on the fly
> > > HID: kye: Sort kye devices
> > > HID: kye: Add support for all kye tablets
> > >
> > > drivers/hid/hid-ids.h | 9 +-
> > > drivers/hid/hid-kye.c | 917 +++++++++++++++++----------------------
> > > drivers/hid/hid-quirks.c | 14 +-
> > > 3 files changed, 414 insertions(+), 526 deletions(-)
> >
> > Now queued in hid.git#for-6.4/kye, thanks David.
> >
> > --
> > Jiri Kosina
> > SUSE Labs
> >
>
> Thanks. But seems you missed the last patch.
Weird. Right you are. I have now fixed that. Thanks for catching it,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH 1/2] dt-bindings: input: fsl,scu-key: add wakeup-source property
From: Krzysztof Kozlowski @ 2023-03-24 11:40 UTC (permalink / raw)
To: Peng Fan (OSS), dmitry.torokhov, robh+dt, krzysztof.kozlowski+dt
Cc: shawnguo, aisheng.dong, linux-input, devicetree, linux-kernel,
linux-arm-kernel, s.hauer, kernel, festevam, linux-imx, Peng Fan
In-Reply-To: <20230323093141.4070840-1-peng.fan@oss.nxp.com>
On 23/03/2023 10:31, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Add wakeup-source to indicate whether it could work to wakeup the system
> from suspend mode.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH 5/6] devicetree: input: cypress,tt21000: add wakeup-source entry to documentation
From: Krzysztof Kozlowski @ 2023-03-24 9:42 UTC (permalink / raw)
To: Maximilian Weigand, Linus Walleij, Dmitry Torokhov, linux-input,
linux-kernel, devicetree
Cc: Alistair Francis
In-Reply-To: <20230323135205.1160879-6-mweigand@mweigand.net>
On 23/03/2023 14:52, Maximilian Weigand wrote:
> The touchscreen can be used to wake up systems from sleep and therefore
> the wakeup-source entry should be included in the documentation.
Use subject prefixes matching the subsystem (which you can get for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching).
Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.
>
> Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
> Reviewed-by: Alistair Francis <alistair@alistair23.me>
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH 3/6] devicetree: input: cypress,tt21000: fix interrupt type in dts example
From: Krzysztof Kozlowski @ 2023-03-24 9:41 UTC (permalink / raw)
To: Maximilian Weigand, Linus Walleij, Dmitry Torokhov, linux-input,
linux-kernel, devicetree
Cc: Alistair Francis
In-Reply-To: <20230323135205.1160879-4-mweigand@mweigand.net>
On 23/03/2023 14:52, Maximilian Weigand wrote:
> Triggering the interrupt of the IRQ_TYPE_LEVEL_LOW type can lead to
> probing issues with the device for the current driver (encountered on
> the Pine64 PineNote). Basically the interrupt would be triggered before
> certain commands were sent to the device, leading to a race between the
> device responding fast enough and the irq handler fetching a data frame
> from it. Actually all devices currently using the driver already use a
Use subject prefixes matching the subsystem (which you can get for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching). "dt-bindings", not "devicetree"
Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.
> falling edge trigger.
>
> Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
> Reviewed-by: Alistair Francis <alistair@alistair23.me>
Usually reviews are public.
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH 1/3] Input: xpad - fix support for some third-party controllers
From: Vicki Pfau @ 2023-03-24 4:06 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Jiri Kosina, Benjamin Tissoires, linux-input, Pavel Rojtberg,
Andrey Smirnov
In-Reply-To: <ZBz9OnKq1/UWddk9@google.com>
On 3/23/23 18:30, Dmitry Torokhov wrote:
> On Fri, Feb 24, 2023 at 05:21:46PM -0800, Vicki Pfau wrote:
>> Some third-party controllers, such as the HORPIAD FPS for Nintendo Switch and
>> Gamesir-G3w, require a specific packet that the first-party XInput driver sends
>> before it will start sending reports. It's not currently known what this packet
>> does, but since the first-party driver always sends it's unlikely that this
>> could cause issues with existing controllers.
>>
>> Co-authored-by: Andrey Smirnov <andrew.smirnov@gmail.com>
>> Signed-off-by: Vicki Pfau <vi@endrift.com>
>> ---
>> drivers/input/joystick/xpad.c | 22 ++++++++++++++++++++++
>> 1 file changed, 22 insertions(+)
>>
>> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
>> index 403b57e8176b..04af2213407f 100644
>> --- a/drivers/input/joystick/xpad.c
>> +++ b/drivers/input/joystick/xpad.c
>> @@ -265,6 +265,7 @@ static const struct xpad_device {
>> { 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE },
>> { 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
>> { 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
>> + { 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
>> { 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX },
>> { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
>> { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
>> @@ -2020,6 +2021,27 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
>> goto err_free_in_urb;
>> }
>>
>> + if (xpad->xtype == XTYPE_XBOX360) {
>> + /* Some third-party controllers Xbox 360-style controllers
>> + * require this message to finish initialization */
>> + uint8_t dummy[20];
>> + int ret;
>> +
>> + usb_control_msg_recv(udev, 0,
>> + /* bRequest */ 0x01,
>> + /* bmRequestType */
>> + USB_TYPE_VENDOR | USB_DIR_IN |
>> + USB_RECIP_INTERFACE,
>> + /* wValue */ 0x100,
>> + /* wIndex */ 0x00,
>> + dummy, sizeof(dummy),
>> + 25,
>> + GFP_KERNEL);
>> + if (ret)
>> + dev_warn(&xpad->dev->dev,
>> + "unable to receive magic message: %d\n", ret);
>
> You are not setting "ret", how was this tested?
Presumably with a stack frame that had that space unwittingly initialized to zero. Good catch, thanks. I've resubmitted with this fixed in v2.
>
>> + }
>> +
>> ep_irq_in = ep_irq_out = NULL;
>>
>> for (i = 0; i < 2; i++) {
>> --
>> 2.39.2
>>
>
^ permalink raw reply
* [PATCH v2 2/2] Input: xpad - fix support for some third-party controllers
From: Vicki Pfau @ 2023-03-24 4:04 UTC (permalink / raw)
To: Dmitry Torokhov, Lyude Paul, Benjamin Tissoires, linux-input
Cc: Vicki Pfau, Pavel Rojtberg, Andrey Smirnov
In-Reply-To: <20230324040446.3487725-1-vi@endrift.com>
Some third-party controllers, such as the HORPIAD FPS for Nintendo Switch and
Gamesir-G3w, require a specific packet that the first-party XInput driver sends
before it will start sending reports. It's not currently known what this packet
does, but since the first-party driver always sends it's unlikely that this
could cause issues with existing controllers.
Co-authored-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Vicki Pfau <vi@endrift.com>
---
drivers/input/joystick/xpad.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index c2c688156b2e..2d86ca0c1ace 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -264,6 +264,7 @@ static const struct xpad_device {
{ 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE },
{ 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
{ 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
+ { 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
{ 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX },
{ 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
{ 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
@@ -2013,6 +2014,25 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
goto err_free_in_urb;
}
+ if (xpad->xtype == XTYPE_XBOX360) {
+ /* Some third-party controllers Xbox 360-style controllers
+ * require this message to finish initialization */
+ uint8_t dummy[20];
+ int ret = usb_control_msg_recv(udev, 0,
+ /* bRequest */ 0x01,
+ /* bmRequestType */
+ USB_TYPE_VENDOR | USB_DIR_IN |
+ USB_RECIP_INTERFACE,
+ /* wValue */ 0x100,
+ /* wIndex */ 0x00,
+ dummy, sizeof(dummy),
+ 25,
+ GFP_KERNEL);
+ if (ret)
+ dev_warn(&xpad->dev->dev,
+ "unable to receive magic message: %d\n", ret);
+ }
+
ep_irq_in = ep_irq_out = NULL;
for (i = 0; i < 2; i++) {
--
2.40.0
^ permalink raw reply related
* [PATCH v2 1/2] Input: xpad - Treat Qanba controllers as Xbox360 controllers
From: Vicki Pfau @ 2023-03-24 4:04 UTC (permalink / raw)
To: Dmitry Torokhov, Lyude Paul, Benjamin Tissoires, linux-input
Cc: Pierre-Loup A. Griffais, Vicki Pfau
In-Reply-To: <20230324040446.3487725-1-vi@endrift.com>
From: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
They act that way in PC mode.
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Pierre-Loup A. Griffais <pgriffais@valvesoftware.com>
Signed-off-by: Vicki Pfau <vi@endrift.com>
---
drivers/input/joystick/xpad.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 49ae963e5f9d..c2c688156b2e 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -493,6 +493,7 @@ static const struct usb_device_id xpad_table[] = {
XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
XPAD_XBOX360_VENDOR(0x2563), /* OneXPlayer Gamepad */
XPAD_XBOX360_VENDOR(0x260d), /* Dareu H101 */
+ XPAD_XBOX360_VENDOR(0x2c22), /* Qanba Controllers */
XPAD_XBOX360_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller */
XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */
XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
--
2.40.0
^ permalink raw reply related
* [PATCH v2 0/2] Input: xpad - Additional third-party controller support
From: Vicki Pfau @ 2023-03-24 4:04 UTC (permalink / raw)
To: Dmitry Torokhov, Lyude Paul, Benjamin Tissoires, linux-input
Cc: Vicki Pfau, Pavel Rojtberg
This fixes some issues that came up in v1, including fixing the signed-off-by
in one patch, and properly initializing a variable that was added in another.
One of the other patches was dropped from this series as it appears to have
had a compatible version already applied, and the other patch has been
temporarily dropped pending further testing and fixes.
Pierre-Loup A. Griffais (1):
Input: xpad - Treat Qanba controllers as Xbox360 controllers
Vicki Pfau (1):
Input: xpad - fix support for some third-party controllers
drivers/input/joystick/xpad.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
--
2.40.0
^ permalink raw reply
* Re: [PATCH 3/3] Input: xpad - Add VID for Turtle Beach controllers
From: Dmitry Torokhov @ 2023-03-24 1:33 UTC (permalink / raw)
To: Vicki Pfau; +Cc: Jiri Kosina, Benjamin Tissoires, linux-input, Pavel Rojtberg
In-Reply-To: <20230225012147.276489-4-vi@endrift.com>
On Fri, Feb 24, 2023 at 05:21:48PM -0800, Vicki Pfau wrote:
> This adds support for the Turtle Beach REACT-R and Recon Xbox controllers
>
> Signed-off-by: Vicki Pfau <vi@endrift.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 2/3] Input: xpad - remove unused field in VID/PID table
From: Dmitry Torokhov @ 2023-03-24 1:33 UTC (permalink / raw)
To: Vicki Pfau; +Cc: Jiri Kosina, Benjamin Tissoires, linux-input, Pavel Rojtberg
In-Reply-To: <20230225012147.276489-3-vi@endrift.com>
On Fri, Feb 24, 2023 at 05:21:47PM -0800, Vicki Pfau wrote:
> The list of specific VID/PID combinations for various controllers recently
> added a new field "xtype". However, this field isn't used, nor filled in in the
> table itself, and was likely added by mistake and overlooked during review.
> Since this field isn't used, it's safe to remove.
>
> Signed-off-by: Vicki Pfau <vi@endrift.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 1/3] Input: xpad - fix support for some third-party controllers
From: Dmitry Torokhov @ 2023-03-24 1:30 UTC (permalink / raw)
To: Vicki Pfau
Cc: Jiri Kosina, Benjamin Tissoires, linux-input, Pavel Rojtberg,
Andrey Smirnov
In-Reply-To: <20230225012147.276489-2-vi@endrift.com>
On Fri, Feb 24, 2023 at 05:21:46PM -0800, Vicki Pfau wrote:
> Some third-party controllers, such as the HORPIAD FPS for Nintendo Switch and
> Gamesir-G3w, require a specific packet that the first-party XInput driver sends
> before it will start sending reports. It's not currently known what this packet
> does, but since the first-party driver always sends it's unlikely that this
> could cause issues with existing controllers.
>
> Co-authored-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Signed-off-by: Vicki Pfau <vi@endrift.com>
> ---
> drivers/input/joystick/xpad.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 403b57e8176b..04af2213407f 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -265,6 +265,7 @@ static const struct xpad_device {
> { 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE },
> { 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
> { 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
> + { 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
> { 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX },
> { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
> { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
> @@ -2020,6 +2021,27 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
> goto err_free_in_urb;
> }
>
> + if (xpad->xtype == XTYPE_XBOX360) {
> + /* Some third-party controllers Xbox 360-style controllers
> + * require this message to finish initialization */
> + uint8_t dummy[20];
> + int ret;
> +
> + usb_control_msg_recv(udev, 0,
> + /* bRequest */ 0x01,
> + /* bmRequestType */
> + USB_TYPE_VENDOR | USB_DIR_IN |
> + USB_RECIP_INTERFACE,
> + /* wValue */ 0x100,
> + /* wIndex */ 0x00,
> + dummy, sizeof(dummy),
> + 25,
> + GFP_KERNEL);
> + if (ret)
> + dev_warn(&xpad->dev->dev,
> + "unable to receive magic message: %d\n", ret);
You are not setting "ret", how was this tested?
> + }
> +
> ep_irq_in = ep_irq_out = NULL;
>
> for (i = 0; i < 2; i++) {
> --
> 2.39.2
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH 2/3] Input: xpad - fix PowerA EnWired Controller guide button
From: Dmitry Torokhov @ 2023-03-24 1:29 UTC (permalink / raw)
To: Vicki Pfau; +Cc: Jiri Kosina, Benjamin Tissoires, linux-input
In-Reply-To: <20230203022758.3982393-2-vi@endrift.com>
On Thu, Feb 02, 2023 at 06:27:57PM -0800, Vicki Pfau wrote:
> This commit explicitly disables the audio interface the same way the official
> driver does. This is needed for some controllers, such as the PowerA Enhanced
> Wired Controller for Series X|S (0x20d6:0x200e) to report the guide button.
>
> Signed-off-by: Vicki Pfau <vi@endrift.com>
> ---
> drivers/input/joystick/xpad.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index bb65c8268963..16bc3cd4c2b7 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -1390,6 +1390,13 @@ static int xpad_start_xbox_one(struct usb_xpad *xpad)
> unsigned long flags;
> int retval;
>
> + /* Explicitly disable the audio interface. This is needed for some
> + * controllers, such as the PowerA Enhanced Wired Controller
> + * for Series X|S (0x20d6:0x200e) to report the guide button */
Is it guaranteed that there is 2nd interface? Is it always the audio
interface?
> + retval = usb_set_interface(xpad->udev, 1, 0);
> + if (retval)
> + return retval;
> +
> spin_lock_irqsave(&xpad->odata_lock, flags);
>
> /*
> --
> 2.39.1
>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 3/3] Input: xpad - add support for 8BitDo Ultimate Wireless controller dongle
From: Dmitry Torokhov @ 2023-03-24 1:25 UTC (permalink / raw)
To: Vicki Pfau
Cc: Jiri Kosina, Benjamin Tissoires, linux-input,
Pierre-Loup A. Griffais, Josh Cotton
In-Reply-To: <20230203022758.3982393-3-vi@endrift.com>
On Thu, Feb 02, 2023 at 06:27:58PM -0800, Vicki Pfau wrote:
> From: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
>
> Add the VID and PID of the 8BitDo Ultimate Wireless controller dongle
>
> Signed-off-by: Josh Cotton <jcotton42@outlook.com>
Same issue as the first patch regarding attribution.
> ---
> drivers/input/joystick/xpad.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 16bc3cd4c2b7..403b57e8176b 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -359,6 +359,7 @@ static const struct xpad_device {
> { 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
> { 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 },
> { 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE },
> + { 0x2dc8, 0x3106, "8BitDo Ultimate Wireless Controller", 0, XTYPE_XBOX360 },
> { 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
> { 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
> { 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
> @@ -494,6 +495,7 @@ static const struct usb_device_id xpad_table[] = {
> XPAD_XBOX360_VENDOR(0x260d), /* Dareu H101 */
> XPAD_XBOX360_VENDOR(0x2c22), /* Qanba Controllers */
> XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */
> + XPAD_XBOX360_VENDOR(0x2dc8), /* 8BitDo Ultimate Wireless Controller */
> XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
> XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
> XPAD_XBOX360_VENDOR(0x31e3), /* Wooting Keyboards */
> --
> 2.39.1
>
--
Dmitry
^ permalink raw reply
* Re: [PATCH 1/3] Input: xpad - Treat Qanba controllers as Xbox360 controllers
From: Dmitry Torokhov @ 2023-03-24 1:24 UTC (permalink / raw)
To: Vicki Pfau
Cc: Jiri Kosina, Benjamin Tissoires, linux-input,
Pierre-Loup A. Griffais, Cristian Ciocaltea
In-Reply-To: <20230203022758.3982393-1-vi@endrift.com>
On Thu, Feb 02, 2023 at 06:27:56PM -0800, Vicki Pfau wrote:
> From: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
>
> They act that way in PC mode.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Sorry, this patch is a complete mess with regard to the sender, the
author, and the person giving their signed-off-by.
> ---
> drivers/input/joystick/xpad.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 2959d80f7fdb..bb65c8268963 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -492,6 +492,7 @@ static const struct usb_device_id xpad_table[] = {
> XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
> XPAD_XBOX360_VENDOR(0x2563), /* OneXPlayer Gamepad */
> XPAD_XBOX360_VENDOR(0x260d), /* Dareu H101 */
> + XPAD_XBOX360_VENDOR(0x2c22), /* Qanba Controllers */
> XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */
> XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
> XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
> --
> 2.39.1
>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v3] Input: i8042 - add TUXEDO devices to i8042 quirk tables for partial fix
From: Dmitry Torokhov @ 2023-03-24 1:15 UTC (permalink / raw)
To: Werner Sembach
Cc: hdegoede, mkorpershoek, chenhuacai, tiwai, wsa+renesas,
linux-input, linux-kernel
In-Reply-To: <20230321191619.647911-1-wse@tuxedocomputers.com>
On Tue, Mar 21, 2023 at 08:16:19PM +0100, Werner Sembach wrote:
> A lot of modern Clevo barebones have touchpad and/or keyboard issues after
> suspend fixable with nomux + reset + noloop + nopnp. Luckily, none of them
> have an external PS/2 port so this can safely be set for all of them.
>
> I'm not entirely sure if every device listed really needs all four quirks,
> but after testing and production use. No negative effects could be
> observed when setting all four.
>
> Setting SERIO_QUIRK_NOMUX or SERIO_QUIRK_RESET_ALWAYS on the Clevo N150CU
> and the Clevo NHxxRZQ makes the keyboard very laggy for ~5 seconds after
> boot and sometimes also after resume. However both are required for the
> keyboard to not fail completely sometimes after boot or resume.
>
> Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
> Cc: stable@vger.kernel.org
Applied, thank you.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 1/3] Input: xpad - fix support for some third-party controllers
From: Lyude Paul @ 2023-03-23 22:01 UTC (permalink / raw)
To: Vicki Pfau, Jiri Kosina, Benjamin Tissoires, linux-input,
Pavel Rojtberg, Dmitry Torokhov
Cc: Andrey Smirnov
In-Reply-To: <6db0559eea8a92d27408faadbeee9974471ce2c9.camel@redhat.com>
Ah wnoops, Vicki pointed out I made a mistake here and that this one is still
awaiting reviews from someone. will review in just a moment
On Thu, 2023-03-23 at 17:39 -0400, Lyude Paul wrote:
> Hey Dmitry, this patch series seems to have only gotten radio silence as well.
> What could we do to get this moving?
>
> On Fri, 2023-02-24 at 17:21 -0800, Vicki Pfau wrote:
> > Some third-party controllers, such as the HORPIAD FPS for Nintendo Switch and
> > Gamesir-G3w, require a specific packet that the first-party XInput driver sends
> > before it will start sending reports. It's not currently known what this packet
> > does, but since the first-party driver always sends it's unlikely that this
> > could cause issues with existing controllers.
> >
> > Co-authored-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > Signed-off-by: Vicki Pfau <vi@endrift.com>
> > ---
> > drivers/input/joystick/xpad.c | 22 ++++++++++++++++++++++
> > 1 file changed, 22 insertions(+)
> >
> > diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> > index 403b57e8176b..04af2213407f 100644
> > --- a/drivers/input/joystick/xpad.c
> > +++ b/drivers/input/joystick/xpad.c
> > @@ -265,6 +265,7 @@ static const struct xpad_device {
> > { 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE },
> > { 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
> > { 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
> > + { 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
> > { 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX },
> > { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
> > { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
> > @@ -2020,6 +2021,27 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
> > goto err_free_in_urb;
> > }
> >
> > + if (xpad->xtype == XTYPE_XBOX360) {
> > + /* Some third-party controllers Xbox 360-style controllers
> > + * require this message to finish initialization */
> > + uint8_t dummy[20];
> > + int ret;
> > +
> > + usb_control_msg_recv(udev, 0,
> > + /* bRequest */ 0x01,
> > + /* bmRequestType */
> > + USB_TYPE_VENDOR | USB_DIR_IN |
> > + USB_RECIP_INTERFACE,
> > + /* wValue */ 0x100,
> > + /* wIndex */ 0x00,
> > + dummy, sizeof(dummy),
> > + 25,
> > + GFP_KERNEL);
> > + if (ret)
> > + dev_warn(&xpad->dev->dev,
> > + "unable to receive magic message: %d\n", ret);
> > + }
> > +
> > ep_irq_in = ep_irq_out = NULL;
> >
> > for (i = 0; i < 2; i++) {
>
--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat
^ permalink raw reply
* Re: [PATCH 1/3] Input: xpad - fix support for some third-party controllers
From: Lyude Paul @ 2023-03-23 21:39 UTC (permalink / raw)
To: Vicki Pfau, Jiri Kosina, Benjamin Tissoires, linux-input,
Pavel Rojtberg, Dmitry Torokhov
Cc: Andrey Smirnov
In-Reply-To: <20230225012147.276489-2-vi@endrift.com>
Hey Dmitry, this patch series seems to have only gotten radio silence as well.
What could we do to get this moving?
On Fri, 2023-02-24 at 17:21 -0800, Vicki Pfau wrote:
> Some third-party controllers, such as the HORPIAD FPS for Nintendo Switch and
> Gamesir-G3w, require a specific packet that the first-party XInput driver sends
> before it will start sending reports. It's not currently known what this packet
> does, but since the first-party driver always sends it's unlikely that this
> could cause issues with existing controllers.
>
> Co-authored-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Signed-off-by: Vicki Pfau <vi@endrift.com>
> ---
> drivers/input/joystick/xpad.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 403b57e8176b..04af2213407f 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -265,6 +265,7 @@ static const struct xpad_device {
> { 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE },
> { 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
> { 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
> + { 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
> { 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX },
> { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
> { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
> @@ -2020,6 +2021,27 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
> goto err_free_in_urb;
> }
>
> + if (xpad->xtype == XTYPE_XBOX360) {
> + /* Some third-party controllers Xbox 360-style controllers
> + * require this message to finish initialization */
> + uint8_t dummy[20];
> + int ret;
> +
> + usb_control_msg_recv(udev, 0,
> + /* bRequest */ 0x01,
> + /* bmRequestType */
> + USB_TYPE_VENDOR | USB_DIR_IN |
> + USB_RECIP_INTERFACE,
> + /* wValue */ 0x100,
> + /* wIndex */ 0x00,
> + dummy, sizeof(dummy),
> + 25,
> + GFP_KERNEL);
> + if (ret)
> + dev_warn(&xpad->dev->dev,
> + "unable to receive magic message: %d\n", ret);
> + }
> +
> ep_irq_in = ep_irq_out = NULL;
>
> for (i = 0; i < 2; i++) {
--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat
^ permalink raw reply
* Re: [PATCH 1/3] Input: xpad - Treat Qanba controllers as Xbox360 controllers
From: Lyude Paul @ 2023-03-23 21:33 UTC (permalink / raw)
To: Vicki Pfau, Jiri Kosina, Benjamin Tissoires, linux-input,
Dmitry Torokhov
Cc: Pierre-Loup A. Griffais, Cristian Ciocaltea
In-Reply-To: <20230203022758.3982393-1-vi@endrift.com>
Hi Dmitry, it looks like this patch series has been sitting for a while now
without getting any kind of feedback. Could you please take a look at this the
next chance you get?
On Thu, 2023-02-02 at 18:27 -0800, Vicki Pfau wrote:
> From: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
>
> They act that way in PC mode.
>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
> drivers/input/joystick/xpad.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index 2959d80f7fdb..bb65c8268963 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
> @@ -492,6 +492,7 @@ static const struct usb_device_id xpad_table[] = {
> XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
> XPAD_XBOX360_VENDOR(0x2563), /* OneXPlayer Gamepad */
> XPAD_XBOX360_VENDOR(0x260d), /* Dareu H101 */
> + XPAD_XBOX360_VENDOR(0x2c22), /* Qanba Controllers */
> XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */
> XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
> XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat
^ permalink raw reply
* Re: [PATCH] HID: Recognize "Digitizer" as a valid input application
From: Jason Gerecke @ 2023-03-23 15:24 UTC (permalink / raw)
To: benjamin.tissoires, linux-input
Cc: jason.gerecke, jikos, joshua, ping.cheng, pinglinux, skomra,
José Expósito
In-Reply-To: <CANRwn3S=6S+mtzL5eFUP=z6K0m=1LO3gyvS4eWHugB8n_3NBhw@mail.gmail.com>
Following up on this since it has been a while since the last attempt.
I'm still hoping to get this patch merged if possible :)
The patch still applies cleanly against the for-6.4/core branch and
the hid-tools test suite still runs without any (new*) test failures
when the patch is applied. Please let me know if there's anything I
could / should do to continue moving this forward.
*There are four failures in test_sony.py, but they occur on the
for-6.4/core branch regardless of if the patch is applied or not.
Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one /
(That is to say, eight) to the two, /
But you can’t take seven from three, /
So you look at the sixty-fours....
On Thu, Dec 15, 2022 at 8:11 AM Jason Gerecke <killertofu@gmail.com> wrote:
>
> Thanks for the response, Jose.
>
> Unfortunately this isn't an issue that we can fix in the Wacom driver
> since it affects devices that don't use the Wacom driver. While we
> could theoretically adopt affected VID:PIDs into the Wacom driver on a
> case-by-case basis, there would be a large time lag between us
> adopting a device and users running the required kernel. This should
> really be something that is fixed in the hid-generic driver, even if
> it means some pain trying to ensure we don't break things in the
> process... I'm still hoping to hear something back from Benjamin about
> my hid-tools test results or if additional testing is needed.
>
> Jason
> ---
> Now instead of four in the eights place /
> you’ve got three, ‘Cause you added one /
> (That is to say, eight) to the two, /
> But you can’t take seven from three, /
> So you look at the sixty-fours....
>
> On Sat, Dec 3, 2022 at 3:43 AM José Expósito <jose.exposito89@gmail.com> wrote:
> >
> > Hi Jason,
> >
> > > Still waiting to hear back about this. Are positive results from the
> > > hid-tools tests sufficient, or is there additional work that should be
> > > done for this patch?
> >
> > A while ago a similar patch was sent [1] and it was in a similar status
> > to your patch for a while, so I decided to fix the issue in the UCLogic
> > driver [2].
> >
> > I can not tell you if this patch needs additional work, but you might be
> > interested in fixing it in the Wacom driver, where it'd be easier for you
> > to test that no regressions are introduced.
> >
> > I hope this helps a bit,
> > Jose
> >
> > [1] https://lore.kernel.org/linux-input/20220804151832.30373-1-openglfreak@googlemail.com/
> > [2] https://lore.kernel.org/linux-input/d08049f2-443b-f769-cfde-629cdfb96fc0@alexyzhang.dev/T/
^ permalink raw reply
* Re: [PATCH 2/6] Input: cyttsp5: remove unused code
From: kernel test robot @ 2023-03-23 15:18 UTC (permalink / raw)
To: Maximilian Weigand, Linus Walleij, Dmitry Torokhov, linux-input,
linux-kernel, devicetree
Cc: oe-kbuild-all, Maximilian Weigand, Alistair Francis
In-Reply-To: <20230323135205.1160879-3-mweigand@mweigand.net>
Hi Maximilian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on dtor-input/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Maximilian-Weigand/Input-cyttsp5-fix-array-length/20230323-215957
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
patch link: https://lore.kernel.org/r/20230323135205.1160879-3-mweigand%40mweigand.net
patch subject: [PATCH 2/6] Input: cyttsp5: remove unused code
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20230323/202303232302.FB64fi39-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/4358a60821eb8149dabed197c09d3c0eab63bf38
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Maximilian-Weigand/Input-cyttsp5-fix-array-length/20230323-215957
git checkout 4358a60821eb8149dabed197c09d3c0eab63bf38
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/input/touchscreen/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303232302.FB64fi39-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_get_hid_descriptor':
>> drivers/input/touchscreen/cyttsp5.c:604:12: warning: unused variable 'cmd' [-Wunused-variable]
604 | u8 cmd[2];
| ^~~
vim +/cmd +604 drivers/input/touchscreen/cyttsp5.c
5b0c03e24a061f Alistair Francis 2022-10-31 598
5b0c03e24a061f Alistair Francis 2022-10-31 599 static int cyttsp5_get_hid_descriptor(struct cyttsp5 *ts,
5b0c03e24a061f Alistair Francis 2022-10-31 600 struct cyttsp5_hid_desc *desc)
5b0c03e24a061f Alistair Francis 2022-10-31 601 {
5b0c03e24a061f Alistair Francis 2022-10-31 602 struct device *dev = ts->dev;
5b0c03e24a061f Alistair Francis 2022-10-31 603 int rc;
5b0c03e24a061f Alistair Francis 2022-10-31 @604 u8 cmd[2];
5b0c03e24a061f Alistair Francis 2022-10-31 605
5b0c03e24a061f Alistair Francis 2022-10-31 606 rc = cyttsp5_write(ts, HID_DESC_REG, NULL, 0);
5b0c03e24a061f Alistair Francis 2022-10-31 607 if (rc) {
5b0c03e24a061f Alistair Francis 2022-10-31 608 dev_err(dev, "Failed to get HID descriptor, rc=%d\n", rc);
5b0c03e24a061f Alistair Francis 2022-10-31 609 return rc;
5b0c03e24a061f Alistair Francis 2022-10-31 610 }
5b0c03e24a061f Alistair Francis 2022-10-31 611
5b0c03e24a061f Alistair Francis 2022-10-31 612 rc = wait_for_completion_interruptible_timeout(&ts->cmd_done,
5b0c03e24a061f Alistair Francis 2022-10-31 613 msecs_to_jiffies(CY_HID_GET_HID_DESCRIPTOR_TIMEOUT_MS));
5b0c03e24a061f Alistair Francis 2022-10-31 614 if (rc <= 0) {
5b0c03e24a061f Alistair Francis 2022-10-31 615 dev_err(ts->dev, "HID get descriptor timed out\n");
5b0c03e24a061f Alistair Francis 2022-10-31 616 rc = -ETIMEDOUT;
5b0c03e24a061f Alistair Francis 2022-10-31 617 return rc;
5b0c03e24a061f Alistair Francis 2022-10-31 618 }
5b0c03e24a061f Alistair Francis 2022-10-31 619
5b0c03e24a061f Alistair Francis 2022-10-31 620 memcpy(desc, ts->response_buf, sizeof(*desc));
5b0c03e24a061f Alistair Francis 2022-10-31 621
5b0c03e24a061f Alistair Francis 2022-10-31 622 /* Check HID descriptor length and version */
5b0c03e24a061f Alistair Francis 2022-10-31 623 if (le16_to_cpu(desc->hid_desc_len) != sizeof(*desc) ||
5b0c03e24a061f Alistair Francis 2022-10-31 624 le16_to_cpu(desc->bcd_version) != HID_VERSION) {
5b0c03e24a061f Alistair Francis 2022-10-31 625 dev_err(dev, "Unsupported HID version\n");
5b0c03e24a061f Alistair Francis 2022-10-31 626 return -ENODEV;
5b0c03e24a061f Alistair Francis 2022-10-31 627 }
5b0c03e24a061f Alistair Francis 2022-10-31 628
5b0c03e24a061f Alistair Francis 2022-10-31 629 return 0;
5b0c03e24a061f Alistair Francis 2022-10-31 630 }
5b0c03e24a061f Alistair Francis 2022-10-31 631
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply
* [PATCH 0/6] Small fixes to the cyttsp5 touchscreen driver
From: Maximilian Weigand @ 2023-03-23 13:51 UTC (permalink / raw)
To: Linus Walleij, Dmitry Torokhov, linux-input, linux-kernel,
devicetree
Cc: Maximilian Weigand, Alistair Francis
While working on some intermittent module-loading problems of the
cyttsp5 module on the Pine64 PineNote it was found that the device tree
example of the cypress,tt21000 was in error regarding the interrupt
type (IRQ_TYPE_EDGE_FALLING should be used instead of IRQ_TYPE_LEVEL_LOW).
This lead to the proper implementation of device sleep states, which is
required to ensure proper functioning of the touchscreen after resume
when the correct interrupt type IRQ_TYPE_FALLING_EDGE is used. Sleep and
wakeup commands to the touchscreen were derived from the GPL-2 android
driver by Cypress Semiconductor (copyright note for Cypress
Semiconductor is already in the current driver).
The first two patches fix small issues with the code found during
development of the suspend functionality.
Maximilian Weigand (6):
Input: cyttsp5: fix array length
Input: cyttsp5: remove unused code
devicetree: input: cypress,tt21000: fix interrupt type in dts example
Input: cyttsp5: properly initialize the device as a pm wakeup device
devicetree: input: cypress,tt21000: add wakeup-source entry to
documentation
Input: cyttsp5: implement proper sleep and wakeup procedures
.../input/touchscreen/cypress,tt21000.yaml | 4 +-
drivers/input/touchscreen/cyttsp5.c | 138 +++++++++++++++++-
2 files changed, 136 insertions(+), 6 deletions(-)
--
2.39.2
^ permalink raw reply
* [PATCH 1/6] Input: cyttsp5: fix array length
From: Maximilian Weigand @ 2023-03-23 13:52 UTC (permalink / raw)
To: Linus Walleij, Dmitry Torokhov, linux-input, linux-kernel,
devicetree
Cc: Maximilian Weigand, Alistair Francis
In-Reply-To: <20230323135205.1160879-1-mweigand@mweigand.net>
The cmd array should be initialized with the proper command size and not
with the actual command value that is sent to the touchscreen.
Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
---
drivers/input/touchscreen/cyttsp5.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
index 16caffa35dd9..42c7b44e37f8 100644
--- a/drivers/input/touchscreen/cyttsp5.c
+++ b/drivers/input/touchscreen/cyttsp5.c
@@ -559,7 +559,7 @@ static int cyttsp5_hid_output_get_sysinfo(struct cyttsp5 *ts)
static int cyttsp5_hid_output_bl_launch_app(struct cyttsp5 *ts)
{
int rc;
- u8 cmd[HID_OUTPUT_BL_LAUNCH_APP];
+ u8 cmd[HID_OUTPUT_BL_LAUNCH_APP_SIZE];
u16 crc;
put_unaligned_le16(HID_OUTPUT_BL_LAUNCH_APP_SIZE, cmd);
--
2.39.2
^ permalink raw reply related
* [PATCH 4/6] Input: cyttsp5: properly initialize the device as a pm wakeup device
From: Maximilian Weigand @ 2023-03-23 13:52 UTC (permalink / raw)
To: Linus Walleij, Dmitry Torokhov, linux-input, linux-kernel,
devicetree
Cc: Maximilian Weigand, Alistair Francis
In-Reply-To: <20230323135205.1160879-1-mweigand@mweigand.net>
When used as a wakeup source the driver should be properly registered
with the pm system using device_init_wakeup.
Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
---
drivers/input/touchscreen/cyttsp5.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
index 8b0c6975c6ec..01dd10a596ab 100644
--- a/drivers/input/touchscreen/cyttsp5.c
+++ b/drivers/input/touchscreen/cyttsp5.c
@@ -830,6 +830,9 @@ static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
return error;
}
+ if (device_property_read_bool(dev, "wakeup-source"))
+ device_init_wakeup(dev, true);
+
error = cyttsp5_startup(ts);
if (error) {
dev_err(ts->dev, "Fail initial startup r=%d\n", error);
--
2.39.2
^ permalink raw reply related
* [PATCH 5/6] devicetree: input: cypress,tt21000: add wakeup-source entry to documentation
From: Maximilian Weigand @ 2023-03-23 13:52 UTC (permalink / raw)
To: Linus Walleij, Dmitry Torokhov, linux-input, linux-kernel,
devicetree
Cc: Maximilian Weigand, Alistair Francis
In-Reply-To: <20230323135205.1160879-1-mweigand@mweigand.net>
The touchscreen can be used to wake up systems from sleep and therefore
the wakeup-source entry should be included in the documentation.
Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
---
.../devicetree/bindings/input/touchscreen/cypress,tt21000.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/touchscreen/cypress,tt21000.yaml b/Documentation/devicetree/bindings/input/touchscreen/cypress,tt21000.yaml
index a77203c78d6e..e2da13b7991d 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/cypress,tt21000.yaml
+++ b/Documentation/devicetree/bindings/input/touchscreen/cypress,tt21000.yaml
@@ -40,6 +40,8 @@ properties:
linux,keycodes:
description: EV_ABS specific event code generated by the axis.
+ wakeup-source: true
+
patternProperties:
"^button@[0-9]+$":
type: object
--
2.39.2
^ permalink raw reply related
* [PATCH 6/6] Input: cyttsp5: implement proper sleep and wakeup procedures
From: Maximilian Weigand @ 2023-03-23 13:52 UTC (permalink / raw)
To: Linus Walleij, Dmitry Torokhov, linux-input, linux-kernel,
devicetree
Cc: Maximilian Weigand, Alistair Francis
In-Reply-To: <20230323135205.1160879-1-mweigand@mweigand.net>
The touchscreen can be put into a deep sleep state that prevents it from
emitting touch irqs. Put the touchscreen into deep sleep during suspend
if it is not marked as a wakeup source.
This also fixes a problem with the touchscreen getting unresponsive after
system resume because it pulled the interrupt line low during sleep in
response to a touch event, thereby effectively disabling the interrupt
handling (which triggers on the falling edge).
Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
---
drivers/input/touchscreen/cyttsp5.c | 129 +++++++++++++++++++++++++++-
1 file changed, 128 insertions(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
index 01dd10a596ab..3e8387f6347c 100644
--- a/drivers/input/touchscreen/cyttsp5.c
+++ b/drivers/input/touchscreen/cyttsp5.c
@@ -43,6 +43,7 @@
#define HID_DESC_REG 0x1
#define HID_INPUT_REG 0x3
#define HID_OUTPUT_REG 0x4
+#define HID_COMMAND_REG 0x5
#define REPORT_ID_TOUCH 0x1
#define REPORT_ID_BTN 0x3
@@ -68,6 +69,7 @@
#define HID_APP_OUTPUT_REPORT_ID 0x2F
#define HID_BL_RESPONSE_REPORT_ID 0x30
#define HID_BL_OUTPUT_REPORT_ID 0x40
+#define HID_RESPONSE_REPORT_ID 0xF0
#define HID_OUTPUT_RESPONSE_REPORT_OFFSET 2
#define HID_OUTPUT_RESPONSE_CMD_OFFSET 4
@@ -78,9 +80,15 @@
#define HID_SYSINFO_BTN_MASK GENMASK(7, 0)
#define HID_SYSINFO_MAX_BTN 8
+#define HID_CMD_SET_POWER 0x8
+
+#define HID_POWER_ON 0x0
+#define HID_POWER_SLEEP 0x1
+
#define CY_HID_OUTPUT_TIMEOUT_MS 200
#define CY_HID_OUTPUT_GET_SYSINFO_TIMEOUT_MS 3000
#define CY_HID_GET_HID_DESCRIPTOR_TIMEOUT_MS 4000
+#define CY_HID_SET_POWER_TIMEOUT 500
/* maximum number of concurrent tracks */
#define TOUCH_REPORT_SIZE 10
@@ -100,6 +108,14 @@
#define TOUCH_REPORT_USAGE_PG_MIN 0xFF010063
#define TOUCH_COL_USAGE_PG 0x000D0022
+#define SET_CMD_LOW(byte, bits) \
+ ((byte) = (((byte) & 0xF0) | ((bits) & 0x0F)))
+#define SET_CMD_HIGH(byte, bits)\
+ ((byte) = (((byte) & 0x0F) | ((bits) & 0xF0)))
+#define SET_CMD_OPCODE(byte, opcode) SET_CMD_LOW(byte, opcode)
+#define SET_CMD_REPORT_TYPE(byte, type) SET_CMD_HIGH(byte, ((type) << 4))
+#define SET_CMD_REPORT_ID(byte, id) SET_CMD_LOW(byte, id)
+
/* System Information interface definitions */
struct cyttsp5_sensing_conf_data_dev {
u8 electrodes_x;
@@ -179,6 +195,7 @@ struct cyttsp5_hid_desc {
struct cyttsp5 {
struct device *dev;
struct completion cmd_done;
+ struct completion cmd_command_done;
struct cyttsp5_sysinfo sysinfo;
struct cyttsp5_hid_desc hid_desc;
u8 cmd_buf[CYTTSP5_PREALLOCATED_CMD_BUFFER];
@@ -191,6 +208,7 @@ struct cyttsp5 {
struct regmap *regmap;
struct touchscreen_properties prop;
struct regulator *vdd;
+ bool is_wakeup_source;
};
/*
@@ -556,6 +574,84 @@ static int cyttsp5_hid_output_get_sysinfo(struct cyttsp5 *ts)
return cyttsp5_get_sysinfo_regs(ts);
}
+static int cyttsp5_enter_sleep(struct cyttsp5 *ts)
+{
+ int rc;
+ u8 cmd[2];
+ u16 crc;
+
+ memset(cmd, 0, sizeof(cmd));
+
+ SET_CMD_REPORT_TYPE(cmd[0], 0);
+ SET_CMD_REPORT_ID(cmd[0], HID_POWER_SLEEP);
+ SET_CMD_OPCODE(cmd[1], HID_CMD_SET_POWER);
+
+ rc = cyttsp5_write(ts, HID_COMMAND_REG, cmd, 2);
+ if (rc) {
+ dev_err(ts->dev, "Failed to write command %d", rc);
+ return rc;
+ }
+
+ rc = wait_for_completion_interruptible_timeout(&ts->cmd_command_done,
+ msecs_to_jiffies(CY_HID_SET_POWER_TIMEOUT));
+ if (rc <= 0) {
+ dev_err(ts->dev, "HID output cmd execution timed out\n");
+ rc = -ETIMEDOUT;
+ return rc;
+ }
+
+ /* validate */
+ if ((ts->response_buf[2] != HID_RESPONSE_REPORT_ID)
+ || ((ts->response_buf[3] & 0x3) != HID_POWER_SLEEP)
+ || ((ts->response_buf[4] & 0xF) != HID_CMD_SET_POWER)) {
+ rc = -EINVAL;
+ dev_err(ts->dev, "Validation of the sleep response failed\n");
+ return rc;
+ }
+
+ return 0;
+
+}
+
+static int cyttsp5_wakeup(struct cyttsp5 *ts)
+{
+ int rc;
+ u8 cmd[2];
+ u16 crc;
+
+ memset(cmd, 0, sizeof(cmd));
+
+ SET_CMD_REPORT_TYPE(cmd[0], 0);
+ SET_CMD_REPORT_ID(cmd[0], HID_POWER_ON);
+ SET_CMD_OPCODE(cmd[1], HID_CMD_SET_POWER);
+
+ rc = cyttsp5_write(ts, HID_COMMAND_REG, cmd, 2);
+ if (rc) {
+ dev_err(ts->dev, "Failed to write command %d", rc);
+ return rc;
+ }
+
+ rc = wait_for_completion_interruptible_timeout(&ts->cmd_command_done,
+ msecs_to_jiffies(CY_HID_SET_POWER_TIMEOUT));
+ if (rc <= 0) {
+ dev_err(ts->dev, "HID output cmd execution timed out\n");
+ rc = -ETIMEDOUT;
+ return rc;
+ }
+
+ /* validate */
+ if ((ts->response_buf[2] != HID_RESPONSE_REPORT_ID)
+ || ((ts->response_buf[3] & 0x3) != HID_POWER_ON)
+ || ((ts->response_buf[4] & 0xF) != HID_CMD_SET_POWER)) {
+ rc = -EINVAL;
+ dev_err(ts->dev, "Validation of the sleep response failed\n");
+ return rc;
+ }
+
+ return 0;
+
+}
+
static int cyttsp5_hid_output_bl_launch_app(struct cyttsp5 *ts)
{
int rc;
@@ -670,6 +766,10 @@ static irqreturn_t cyttsp5_handle_irq(int irq, void *handle)
case HID_BTN_REPORT_ID:
cyttsp5_btn_attention(ts->dev);
break;
+ case HID_RESPONSE_REPORT_ID:
+ memcpy(ts->response_buf, ts->input_buf, size);
+ complete(&ts->cmd_command_done);
+ break;
default:
/* It is not an input but a command response */
memcpy(ts->response_buf, ts->input_buf, size);
@@ -784,6 +884,7 @@ static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
dev_set_drvdata(dev, ts);
init_completion(&ts->cmd_done);
+ init_completion(&ts->cmd_command_done);
/* Power up the device */
ts->vdd = devm_regulator_get(dev, "vdd");
@@ -830,8 +931,11 @@ static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
return error;
}
- if (device_property_read_bool(dev, "wakeup-source"))
+ if (device_property_read_bool(dev, "wakeup-source")) {
device_init_wakeup(dev, true);
+ ts->is_wakeup_source = true;
+ } else
+ ts->is_wakeup_source = false;
error = cyttsp5_startup(ts);
if (error) {
@@ -884,6 +988,29 @@ static const struct i2c_device_id cyttsp5_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, cyttsp5_i2c_id);
+static int __maybe_unused cyttsp5_suspend(struct device *dev)
+{
+ struct cyttsp5 *ts = dev_get_drvdata(dev);
+
+ if (!ts->is_wakeup_source)
+ cyttsp5_enter_sleep(ts);
+ return 0;
+}
+
+static int __maybe_unused cyttsp5_resume(struct device *dev)
+{
+ struct cyttsp5 *ts = dev_get_drvdata(dev);
+ struct i2c_client *client = to_i2c_client(dev);
+ int error;
+
+ if (!ts->is_wakeup_source)
+ cyttsp5_wakeup(ts);
+
+ return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(cyttsp5_pm, cyttsp5_suspend, cyttsp5_resume);
+
static struct i2c_driver cyttsp5_i2c_driver = {
.driver = {
.name = CYTTSP5_NAME,
--
2.39.2
^ permalink raw reply related
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