From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDDC8C33CB6 for ; Thu, 16 Jan 2020 13:32:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD2FA214AF for ; Thu, 16 Jan 2020 13:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726362AbgAPNc0 (ORCPT ); Thu, 16 Jan 2020 08:32:26 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:48367 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbgAPNc0 (ORCPT ); Thu, 16 Jan 2020 08:32:26 -0500 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1is5G1-0003HQ-6w; Thu, 16 Jan 2020 14:32:21 +0100 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1is5Fz-0000kB-QS; Thu, 16 Jan 2020 14:32:19 +0100 Date: Thu, 16 Jan 2020 14:32:19 +0100 From: Marco Felsch To: Dmitry Torokhov Cc: devicetree@vger.kernel.org, alexandre.belloni@bootlin.com, simon.budig@kernelconcepts.de, mripard@kernel.org, bparrot@ti.com, hdegoede@redhat.com, andy.shevchenko@gmail.com, robh+dt@kernel.org, kernel@pengutronix.de, linux-input@vger.kernel.org, andriy.shevchenko@linux.intel.com, shawnguo@kernel.org, fcooper@ti.com Subject: Re: [PATCH v3 6/6] Input: edt-ft5x06 - improve power management operations Message-ID: <20200116133219.xtp3wkkcefbcumca@pengutronix.de> References: <20200108111050.19001-1-m.felsch@pengutronix.de> <20200108111050.19001-7-m.felsch@pengutronix.de> <20200110010957.GP8314@dtor-ws> <20200110071606.g42csvhgtriddqj4@pengutronix.de> <20200110071847.h5hqfb7ujnahuuus@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200110071847.h5hqfb7ujnahuuus@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 14:28:33 up 62 days, 4:47, 53 users, load average: 0.01, 0.02, 0.00 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Hi Dmitry, On 20-01-10 08:18, Marco Felsch wrote: > On 20-01-10 08:16, Marco Felsch wrote: > > Hi Dmitry, > > > > On 20-01-09 17:09, Dmitry Torokhov wrote: > > > Hi Marco, > > > > > > On Wed, Jan 08, 2020 at 12:10:50PM +0100, Marco Felsch wrote: > > > > +static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev) > > > > +{ > > > > + struct i2c_client *client = to_i2c_client(dev); > > > > + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); > > > > + int ret; > > > > + > > > > + if (device_may_wakeup(dev)) > > > > + return 0; > > > > + > > > > + ret = regulator_enable(tsdata->vcc); > > > > + if (ret) > > > > + dev_warn(dev, "Failed to enable vcc\n"); > > > > > > I wonder if we should not return error here instead of continuing. If > > > device is not powered up properly we'll have hard time communicating > > > with it. > > > > That's a reasonable point. > > > > > The same is for suspend: maybe we should abort if we can't switch off > > > regulator or write to the device. > > > > I have no strong opinion about that case but IMHO it's okay to go further > > if we can't switch it off. Instead we should print a warning. > > I just noticed that we do that already.. So the suspend case should be > okay. Is it okay to check the return val for the resume case only? I want to prepare a v4 of this patch to get this done. Regards, Marco > > > Regards, > > Marco > > > > > Thanks. > > > > > > -- > > > Dmitry > > > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |