Re: [PATCH] iio: tsl2772: Use device-managed API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx> 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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux