From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753949AbcFTKkz (ORCPT ); Mon, 20 Jun 2016 06:40:55 -0400 Received: from mga01.intel.com ([192.55.52.88]:52288 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbcFTKkp (ORCPT ); Mon, 20 Jun 2016 06:40:45 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,497,1459839600"; d="scan'208";a="1001455304" Date: Mon, 20 Jun 2016 13:39:54 +0300 From: Mika Westerberg To: Guohua Zhong Cc: Jiri Kosina , Benjamin Tissoires , Dmitry Torokhov , Benson Leung , Andrew Duggan , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: i2c-hid: set power sleep before shutdown Message-ID: <20160620103954.GG1739@lahna.fi.intel.com> References: <1466247030-23047-1-git-send-email-ghzhong@yifangdigital.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466247030-23047-1-git-send-email-ghzhong@yifangdigital.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 18, 2016 at 06:50:30PM +0800, Guohua Zhong wrote: > Add i2c_hid_shutdown for i2c-hid driver to send suspend cmd & > disable irq before device shutdown. > > Some HW design 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 disable 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 > --- > drivers/hid/i2c-hid/i2c-hid.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c > index 2e021ba..d6ea97b 100644 > --- a/drivers/hid/i2c-hid/i2c-hid.c > +++ b/drivers/hid/i2c-hid/i2c-hid.c > @@ -1106,6 +1106,12 @@ static int i2c_hid_remove(struct i2c_client *client) > return 0; > } > > +static void i2c_hid_shutdown(struct i2c_client *client) > +{ > + i2c_hid_set_power(client, I2C_HID_PWR_SLEEP); > + disable_irq(client->irq); Why not free_irq() instead? > +} > + > #ifdef CONFIG_PM_SLEEP > static int i2c_hid_suspend(struct device *dev) > { > @@ -1230,7 +1236,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 >