lkml.org 
[lkml]   [2020]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] iio: sx9310: Enable regulator for svdd supply
From
Date
Quoting Doug Anderson (2020-07-24 13:25:01)
> On Thu, Jul 23, 2020 at 4:03 PM Stephen Boyd <swboyd@chromium.org> wrote:
> > /*
> > * Last reading of the proximity status for each channel.
> > * We only send an event to user space when this changes.
> > @@ -914,21 +916,31 @@ static int sx9310_probe(struct i2c_client *client,
> > mutex_init(&data->mutex);
> > init_completion(&data->completion);
> >
> > + data->supply = devm_regulator_get(&client->dev, "svdd");
> > + if (IS_ERR(data->supply))
> > + return PTR_ERR(data->supply);
> > +
> > data->regmap = devm_regmap_init_i2c(client, &sx9310_regmap_config);
> > if (IS_ERR(data->regmap))
> > return PTR_ERR(data->regmap);
> >
> > + ret = regulator_enable(data->supply);
> > + if (ret)
> > + return ret;
> > + /* Must wait for Tpor time after initial power up */
> > + usleep_range(1000, 1100);
>
> ret = devm_add_action_or_reset(&client->dev, sx9310_regulator_disable, supply);
> if (ret)
> return ret;
>
> static void sx9310_regulator_disable(void *regulator) {
> regulator_disable(regulator);
> }
>
> Then drop all changes below this line.

Ok. I originally had code to turn off the supply during suspend/resume
but I removed it because I wasn't sure that the device would be OK with
the IO interface dropping after the device went to sleep.

>
>
> Seems like you could add support for the other regulator listed in the
> bindings, too?
>

Sure. I will use the bulk APIs.

\
 
 \ /
  Last update: 2020-07-24 22:36    [W:0.064 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site