lkml.org 
[lkml]   [2019]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] io: accel: kxcjk1013: restore the range after resume.
On Thu, 21 Feb 2019 03:13:44 +0000
"He, Bo" <bo.he@intel.com> wrote:

> restore the range register in case kxcjk1013 power is off after suspend
>
> we see the issue on some laptops, after system suspend and resume,
> the CTRL_REG1 register changed from 0xc8 to 0x80, so acceleration range
> is changed, the patch is to restore the acceleration range after resume.
>
> Signed-off-by: he, bo <bo.he@intel.com>
> Signed-off-by: Chen, Hu <hu1.chen@intel.com>
Please don't do the ret += trick, it obscures the return value
which we may want to know if anything goes wrong.
Handle each error independently.

Thanks,

Jonathan

> ---
> drivers/iio/accel/kxcjk-1013.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
> index 7506bd9..c6bb3be 100644
> --- a/drivers/iio/accel/kxcjk-1013.c
> +++ b/drivers/iio/accel/kxcjk-1013.c
> @@ -1340,6 +1340,7 @@ static int kxcjk1013_resume(struct device *dev)
>
> mutex_lock(&data->mutex);
> ret = kxcjk1013_set_mode(data, OPERATION);
> + ret += kxcjk1013_set_range(data, data->range);
> mutex_unlock(&data->mutex);
>
> return ret;

\
 
 \ /
  Last update: 2019-03-03 17:18    [W:0.101 / U:4.264 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site