lkml.org 
[lkml]   [2020]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH/RFC v4 2/4] regulator: fixed: add regulator_ops members for suspend/resume
On Fri, Jun 26, 2020 at 06:32:20PM +0900, Yoshihiro Shimoda wrote:

> +static int reg_is_enabled(struct regulator_dev *rdev)
> +{
> + struct fixed_voltage_data *priv = rdev_get_drvdata(rdev);
> +
> + return !priv->disabled_in_suspend;
> +}

This is broken, the state of the regualtor during system runtime need
have no connection with the state of the regulator during system
suspend.

> +static int reg_prepare_disable(struct regulator_dev *rdev)
> +{
> + struct fixed_voltage_data *priv = rdev_get_drvdata(rdev);
> +
> + priv->disabled_in_suspend = true;
> +
> + return 0;
> +}

According to the changelog this is all about reflecting changes in the
system state done by firmware but there's no interaction with firmware
here which means this will be at best fragile. If we need to reflect
changes in firmware configuration I'd expect there to be some
interaction with firmware about how it is configured, or at least that
the configuration would come from the same source.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-06-26 16:41    [W:0.343 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site