lkml.org 
[lkml]   [2022]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] iio: light: cm32181: Add PM support
On Wed, Jul 6, 2022 at 3:12 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Tue, Jul 5, 2022 at 2:31 PM Kai-Heng Feng
> <kai.heng.feng@canonical.com> wrote:
> >
> > The read on in_illuminance_input keeps at 0 after system sleep.
> >
> > So add proper suspend and resume callback to make the sensor keep
> > working after system sleep.
>
> ...
>
> > +static int cm32181_resume(struct device *dev)
> > +{
> > + struct i2c_client *client = to_i2c_client(dev);
> > + struct cm32181_chip *cm32181 = iio_priv(i2c_get_clientdata(client));
>
> Simply device_get_drvdata(dev) ?

iio_priv() is still needed to get the struct priv.

Kai-Heng

>
> > + return i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD,
> > + cm32181->conf_regs[CM32181_REG_ADDR_CMD]);
> > +}
>
> --
> With Best Regards,
> Andy Shevchenko

\
 
 \ /
  Last update: 2022-07-06 04:03    [W:0.066 / U:1.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site