2021-11-02 18:42:05

by Matthias Kaehlcke

[permalink] [raw]
Subject: [PATCH] HID: i2c-hid: Report wakeup events

The i2c-hid driver generally supports wakeup, bit it currently
doesn't report wakeup events to the PM subsystem. Change that.

Signed-off-by: Matthias Kaehlcke <[email protected]>
---

drivers/hid/i2c-hid/i2c-hid-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 517141138b00..68d9a089e3e8 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -522,9 +522,12 @@ static void i2c_hid_get_input(struct i2c_hid *ihid)

i2c_hid_dbg(ihid, "input: %*ph\n", ret_size, ihid->inbuf);

- if (test_bit(I2C_HID_STARTED, &ihid->flags))
+ if (test_bit(I2C_HID_STARTED, &ihid->flags)) {
+ pm_wakeup_event(&ihid->client->dev, 0);
+
hid_input_report(ihid->hid, HID_INPUT_REPORT, ihid->inbuf + 2,
ret_size - 2, 1);
+ }

return;
}
--
2.33.1.1089.g2158813163f-goog


2021-11-02 19:03:53

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH] HID: i2c-hid: Report wakeup events

Hi,

On 11/2/21 19:40, Matthias Kaehlcke wrote:
> The i2c-hid driver generally supports wakeup, bit it currently
> doesn't report wakeup events to the PM subsystem. Change that.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>

Thanks, this looks reasonable to me:

Acked-by: Hans de Goede <[email protected]>

Regards,

Hans

> ---
>
> drivers/hid/i2c-hid/i2c-hid-core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
> index 517141138b00..68d9a089e3e8 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-core.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
> @@ -522,9 +522,12 @@ static void i2c_hid_get_input(struct i2c_hid *ihid)
>
> i2c_hid_dbg(ihid, "input: %*ph\n", ret_size, ihid->inbuf);
>
> - if (test_bit(I2C_HID_STARTED, &ihid->flags))
> + if (test_bit(I2C_HID_STARTED, &ihid->flags)) {
> + pm_wakeup_event(&ihid->client->dev, 0);
> +
> hid_input_report(ihid->hid, HID_INPUT_REPORT, ihid->inbuf + 2,
> ret_size - 2, 1);
> + }
>
> return;
> }
>

2021-11-19 14:50:48

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH] HID: i2c-hid: Report wakeup events

On Tue, 2 Nov 2021, Matthias Kaehlcke wrote:

> The i2c-hid driver generally supports wakeup, bit it currently
> doesn't report wakeup events to the PM subsystem. Change that.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>

Goot catch. Applied, thanks.

--
Jiri Kosina
SUSE Labs