* [PATCH v2] HID: i2c-hid: set power sleep before shutdown
@ 2016-06-21 10:27 Guohua Zhong
2016-06-21 11:09 ` Jiri Kosina
0 siblings, 1 reply; 4+ messages in thread
From: Guohua Zhong @ 2016-06-21 10:27 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Mika Westerberg,
Dmitry Torokhov, Benson Leung, Andrew Duggan
Cc: linux-input, linux-kernel, Guohua Zhong
Add i2c_hid_shutdown for i2c-hid driver to send suspend cmd & free
irq before device shutdown.
Some HW design (i.e. Umaro, a chromebook model) is that the power to
i2c hid device won't down after device shutdown. Also the i2c-hid driver
do not send suspend cmd to the hid i2c device and free its irq before
shutdown.So if We touch the touchscreen or some other i2c hid device,
the power consumtion will be go up even when the device is in shutdown
state.
Though the root cause maybe a HW issue. But it seems that it is a
good pratice to set power sleep for i2c-hid device before shutdown.
Signed-off-by: Guohua Zhong <ghzhong@yifangdigital.com>
---
drivers/hid/i2c-hid/i2c-hid.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 2e021ba..79406ae 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -1106,6 +1106,14 @@ static int i2c_hid_remove(struct i2c_client *client)
return 0;
}
+static void i2c_hid_shutdown(struct i2c_client *client)
+{
+ struct i2c_hid *ihid = i2c_get_clientdata(client);
+
+ i2c_hid_set_power(client, I2C_HID_PWR_SLEEP);
+ free_irq(client->irq, ihid);
+}
+
#ifdef CONFIG_PM_SLEEP
static int i2c_hid_suspend(struct device *dev)
{
@@ -1230,7 +1238,7 @@ static struct i2c_driver i2c_hid_driver = {
.probe = i2c_hid_probe,
.remove = i2c_hid_remove,
-
+ .shutdown = i2c_hid_shutdown,
.id_table = i2c_hid_id_table,
};
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] HID: i2c-hid: set power sleep before shutdown
2016-06-21 10:27 [PATCH v2] HID: i2c-hid: set power sleep before shutdown Guohua Zhong
@ 2016-06-21 11:09 ` Jiri Kosina
2016-06-22 11:15 ` ghzhong
0 siblings, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2016-06-21 11:09 UTC (permalink / raw)
To: Guohua Zhong
Cc: Benjamin Tissoires, Mika Westerberg, Dmitry Torokhov,
Benson Leung, Andrew Duggan, linux-input, linux-kernel
On Tue, 21 Jun 2016, Guohua Zhong wrote:
> Add i2c_hid_shutdown for i2c-hid driver to send suspend cmd & free
> irq before device shutdown.
>
> Some HW design (i.e. Umaro, a chromebook model) is that the power to
> i2c hid device won't down after device shutdown. Also the i2c-hid driver
> do not send suspend cmd to the hid i2c device and free its irq before
> shutdown.So if We touch the touchscreen or some other i2c hid device,
> the power consumtion will be go up even when the device is in shutdown
> state.
>
> Though the root cause maybe a HW issue. But it seems that it is a
> good pratice to set power sleep for i2c-hid device before shutdown.
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] HID: i2c-hid: set power sleep before shutdown
2016-06-21 11:09 ` Jiri Kosina
@ 2016-06-22 11:15 ` ghzhong
2016-06-22 11:23 ` Jiri Kosina
0 siblings, 1 reply; 4+ messages in thread
From: ghzhong @ 2016-06-22 11:15 UTC (permalink / raw)
To: Jiri Kosina
Cc: Benjamin Tissoires, Mika Westerberg, Dmitry Torokhov,
Benson Leung, Andrew Duggan, linux-input, linux-kernel
On 06/21/2016 07:09 PM, Jiri Kosina wrote:
> On Tue, 21 Jun 2016, Guohua Zhong wrote:
>
>> Add i2c_hid_shutdown for i2c-hid driver to send suspend cmd & free
>> irq before device shutdown.
>>
>> Some HW design (i.e. Umaro, a chromebook model) is that the power to
>> i2c hid device won't down after device shutdown. Also the i2c-hid driver
>> do not send suspend cmd to the hid i2c device and free its irq before
>> shutdown.So if We touch the touchscreen or some other i2c hid device,
>> the power consumtion will be go up even when the device is in shutdown
>> state.
>>
>> Though the root cause maybe a HW issue. But it seems that it is a
>> good pratice to set power sleep for i2c-hid device before shutdown.
> Applied, thanks.
>
Do you mean that the Patch V2 has been reviewed & approved? Or I make something wrong and need to do something else?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] HID: i2c-hid: set power sleep before shutdown
2016-06-22 11:15 ` ghzhong
@ 2016-06-22 11:23 ` Jiri Kosina
0 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2016-06-22 11:23 UTC (permalink / raw)
To: ghzhong
Cc: Benjamin Tissoires, Mika Westerberg, Dmitry Torokhov,
Benson Leung, Andrew Duggan, linux-input, linux-kernel
On Wed, 22 Jun 2016, ghzhong wrote:
> Do you mean that the Patch V2 has been reviewed & approved? Or I make
> something wrong and need to do something else?
It's queued in for-4.8/i2c-hid branch of hid.git:
https://git.kernel.org/cgit/linux/kernel/git/jikos/hid.git/log/?h=for-4.8/i2c-hid
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-22 11:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-21 10:27 [PATCH v2] HID: i2c-hid: set power sleep before shutdown Guohua Zhong
2016-06-21 11:09 ` Jiri Kosina
2016-06-22 11:15 ` ghzhong
2016-06-22 11:23 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®