public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Masney <masneyb@onstation.org>
To: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Chuhong Yuan <hslester96@gmail.com>,
	Jonathan Cameron <jic23@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: tsl2772: Use device-managed API
Date: Mon, 29 Jul 2019 09:51:13 -0400	[thread overview]
Message-ID: <20190729135113.GA3049@onstation.org> (raw)
In-Reply-To: <20190729120802.000025e8@huawei.com>

On Mon, Jul 29, 2019 at 12:08:02PM +0100, Jonathan Cameron wrote:
> On Mon, 29 Jul 2019 04:03:07 -0400
> Brian Masney <masneyb@onstation.org> 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

      parent reply	other threads:[~2019-07-29 13:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26 12:30 [PATCH] iio: tsl2772: Use device-managed API Chuhong Yuan
2019-07-27 11:57 ` Jonathan Cameron
2019-07-28  8:31   ` Brian Masney
2019-07-29  3:03     ` Chuhong Yuan
2019-07-29  8:03       ` Brian Masney
2019-07-29 11:08         ` Jonathan Cameron
2019-07-29 13:02           ` Chuhong Yuan
2019-07-29 13:51           ` Brian Masney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190729135113.GA3049@onstation.org \
    --to=masneyb@onstation.org \
    --cc=hslester96@gmail.com \
    --cc=jic23@kernel.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox