Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3486082ybi; Mon, 29 Jul 2019 07:23:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuDQJz3hSlmhqvxm8tKNTDm1VeSb8So6tepGPdgOE2B7tLtetRuOCG6zhDN2XLM/WTBHwP X-Received: by 2002:aa7:957c:: with SMTP id x28mr36764883pfq.42.1564410204910; Mon, 29 Jul 2019 07:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564410204; cv=none; d=google.com; s=arc-20160816; b=TiGiO40JlU1I/ccoQV0oblbF44KhZ2g3YRdaMXIGkUDc0yCuEwWfw+dvN51L6svp4c ivTJEWiBh6wxTInn3woh3RnBb7zHtcAlEclDpNlvSnOpwkVtr8dRixdHyIQMliPO3wXy LAYVxTAmultJ+gm/caj+GJdcDn32ZlPtlyYxWFezOebsyEWKSAPPTnJG5NSu2+Bdduul pTb+vfrUXyBUDWoFTeI1YMG1Dat9dZopPiWfZuuJ6y5On180TF+HYQdrRiBkflLrKuZf fq/rW6GeO87/5yMHFxnQSAm7WDN/OGGPD/9LmeD36yipAtWJYYJMdadXcPHlEXyiVbaw mSUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=w83tmuf+iG8ixID/0LynlHctuiRL/fmhsBaNiBEYyMc=; b=T89D+JESfka0EFfYNV3qXuYx4iW4jwkK7z5/smWWn51s3z2kuJX3PJiim1ti5bbyBp gEC8thSeYiruKV7pi/vOkqFOnXlmCHRPU3nrczZD9JvflmWYjmdegA9ccx7HryoZ9GYX ry9D85JVkApp+8b14QIOyV8Cw8P6T3J+hMt6aCDU/LigzXQWxR9hWkLhoXekXRFCKAwQ Si0ANOP19mJKzElV6BbnKiT521+AJM9BqijCOZNSuDfcHkimProfpfbQYwbOQWH8MJjF eOD5GDjBxBdcYXjjbGD22QhijwK2vdCViTs2ZItOtOgxLLc7LsjYFPiEoNz3HnuPfGzQ BmkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@onstation.org header.s=default header.b=kbsI0aGk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si26700784pll.82.2019.07.29.07.23.08; Mon, 29 Jul 2019 07:23:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@onstation.org header.s=default header.b=kbsI0aGk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbfG2NvP (ORCPT + 99 others); Mon, 29 Jul 2019 09:51:15 -0400 Received: from onstation.org ([52.200.56.107]:35686 "EHLO onstation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726281AbfG2NvO (ORCPT ); Mon, 29 Jul 2019 09:51:14 -0400 Received: from localhost (c-98-239-145-235.hsd1.wv.comcast.net [98.239.145.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: masneyb) by onstation.org (Postfix) with ESMTPSA id EC8B83E910; Mon, 29 Jul 2019 13:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=onstation.org; s=default; t=1564408274; bh=89xXheC+LLFYyAGIZ9A+v7CcZyeg5IL9Z5vUpZcHPb8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kbsI0aGkwYytIrBOPD/CK+DXISYKi28m6BHuin/ZTIMgn3x17Vakg34uk1Wx0bumG K6AhnmXln3A7avFH4ZPkG2sIJBeVqWBfdw3u+IvSGH2HhCJ+49kmuUKSCQ4gzCwUzt quVBmys2OrnS790WbkkIQ9oMPDLtyjWRNLbG1pKU= Date: Mon, 29 Jul 2019 09:51:13 -0400 From: Brian Masney To: Jonathan Cameron Cc: Chuhong Yuan , Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: tsl2772: Use device-managed API Message-ID: <20190729135113.GA3049@onstation.org> References: <20190726123058.22915-1-hslester96@gmail.com> <20190727125749.63297c28@archlinux> <20190728083141.GA14194@onstation.org> <20190729080307.GA360@onstation.org> <20190729120802.000025e8@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190729120802.000025e8@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 29, 2019 at 12:08:02PM +0100, Jonathan Cameron wrote: > On Mon, 29 Jul 2019 04:03:07 -0400 > Brian Masney wrote: > > There are devm_regulator_*() variants of the regulator API available > > that you can use. Lots of other APIs in the kernel have devm variants > > to simply drivers. > I don't think there are any devm_ versions of regulator disable. > > IIRC the argument made when this last came up was that it was rarely correct > to be as course grained as a lot of IIO drivers are. We should probably > do runtime pm and turn these regulators off a lot more frequently. > > The reality is that it is an optimization that doesn't get done in > IIO drivers that often as we mostly just want them to work and many > usecases aren't actually power constrained, > > So we end up doing a lot of devm_add_action_or_reset to power down the > regulators. That makes sense. I have an out-of-tree patch where I started to add runtime pm support to the tsl2772 driver around the time I was working on the staging cleanup. I was unsure of how to do this when the user configures an interrupt threshold via sysfs since we don't want to completely power off the chip in that case. At the time, I couldn't find any other examples in IIO that showed how to do that. I should dust off that patch and send it out as a RFC to get some feedback. Brian