All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>
To: "lee.jones@linaro.org" <lee.jones@linaro.org>
Cc: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	linux-power <linux-power@fi.rohmeurope.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 11/15] regulator: rohm-regulator: SNVS dvs and linear voltage support
Date: Fri, 15 Jan 2021 09:10:19 +0000	[thread overview]
Message-ID: <d5918dd3f7c39306dce17d0ec82823186e9ea0ed.camel@fi.rohmeurope.com> (raw)
In-Reply-To: <20210115082636.GF3975472@dell>

Hello Lee,

Thanks for carefull review! I do appreciate this!

On Fri, 2021-01-15 at 08:26 +0000, Lee Jones wrote:
> On Fri, 08 Jan 2021, Matti Vaittinen wrote:
> 
> > The helper for obtaining HW-state based DVS voltage levels
> > currently only
> > works for regulators using linear-ranges. Extend support to
> > regulators with
> > simple linear mappings and add also proper error path if pickable-
> > ranges
> > regulators call this.
> > 
> > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> > ---
> > @@ -27,7 +27,8 @@ enum {
> >  	ROHM_DVS_LEVEL_IDLE,
> >  	ROHM_DVS_LEVEL_SUSPEND,
> >  	ROHM_DVS_LEVEL_LPSR,
> > -	ROHM_DVS_LEVEL_MAX = ROHM_DVS_LEVEL_LPSR,
> > +	ROHM_DVS_LEVEL_SNVS,
> > +	ROHM_DVS_LEVEL_MAX = ROHM_DVS_LEVEL_SNVS,
> >  };
> 
> Does this actually work?
> 
> The code that consumes it looks like:
> 
>     for (i = 0; i < ROHM_DVS_LEVEL_MAX && !ret; i++)
> 
> So it will loop through like:
> 
> 0 (ROHM_DVS_LEVEL_IDLE)
> 1 (ROHM_DVS_LEVEL_SUSPEND)
> 2 (ROHM_DVS_LEVEL_LPSR)
> 3 (ROHM_DVS_LEVEL_SNVS)
> 
> Then break, since 'i' will be (== 4) not (< 4).
> 
> So the following will never be used:
> 
> 4 (ROHM_DVS_LEVEL_MAX = ROHM_DVS_LEVEL_SNVS)
> 
> Unless I'm missing something, I think MAX should be the last entry.

Good catch. I think you are correct. I will revise this for next
version (and add also fixes tag as it seems the current code is broken
for LPSR).

> 
> >  /**
> > @@ -66,6 +67,9 @@ struct rohm_dvs_config {
> >  	unsigned int lpsr_reg;
> >  	unsigned int lpsr_mask;
> >  	unsigned int lpsr_on_mask;
> > +	unsigned int snvs_reg;
> > +	unsigned int snvs_mask;
> > +	unsigned int snvs_on_mask;
> >  };
> >  
> >  #if IS_ENABLED(CONFIG_REGULATOR_ROHM)


  reply	other threads:[~2021-01-15  9:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 13:27 [PATCH 00/15] Support ROHM BD71815 PMIC Matti Vaittinen
2021-01-08 13:29 ` [PATCH 01/15] rtc: bd70528: Do not require parent data Matti Vaittinen
2021-01-08 13:31 ` [PATCH 02/15] clk: BD718x7: Do not depend on parent driver data Matti Vaittinen
2021-01-08 13:32 ` [PATCH 03/15] mfd: bd718x7: simplify by cleaning unnecessary device data Matti Vaittinen
2021-01-08 13:34 ` [PATCH 04/15] dt_bindings: bd71828: Add clock output mode Matti Vaittinen
2021-01-13 13:52   ` Rob Herring
2021-01-13 14:52     ` Matti Vaittinen
2021-01-13 15:52       ` Rob Herring
2021-01-08 13:34 ` [PATCH 05/15] dt_bindings: mfd: Add ROHM BD71815 PMIC Matti Vaittinen
2021-01-11 19:06   ` Rob Herring
2021-01-12  6:14     ` Vaittinen, Matti
2021-01-08 13:36 ` [PATCH 06/15] dt_bindings: regulator: Add ROHM BD71815 PMIC regulators Matti Vaittinen
2021-01-11 19:09   ` Rob Herring
2021-01-12  6:10     ` Matti Vaittinen
2021-01-13 13:53       ` Rob Herring
2021-01-13 14:23         ` Vaittinen, Matti
2021-01-13 15:47           ` Rob Herring
2021-01-08 13:37 ` [PATCH 07/15] mfd: Add ROHM BD71815 ID Matti Vaittinen
2021-01-08 13:37 ` [PATCH 08/15] mfd: Support for ROHM BD71815 PMIC core Matti Vaittinen
2021-01-08 13:39 ` [PATCH 09/15] gpio: support ROHM BD71815 GPOs Matti Vaittinen
2021-01-08 19:28   ` kernel test robot
2021-01-08 19:28     ` kernel test robot
2021-01-09  0:45   ` Linus Walleij
2021-01-11  6:15     ` Vaittinen, Matti
2021-01-11  7:26       ` Vaittinen, Matti
2021-01-08 13:41 ` [PATCH 10/15] regulator: helpers: Export helper voltage listing Matti Vaittinen
2021-01-08 13:42 ` [PATCH 11/15] regulator: rohm-regulator: SNVS dvs and linear voltage support Matti Vaittinen
2021-01-15  8:26   ` Lee Jones
2021-01-15  9:10     ` Vaittinen, Matti [this message]
2021-01-15  9:48     ` Matti Vaittinen
2021-01-08 13:43 ` [PATCH 12/15] regulator: Support ROHM BD71815 regulators Matti Vaittinen
2021-01-08 22:30   ` kernel test robot
2021-01-08 22:30     ` kernel test robot
2021-01-08 13:45 ` [PATCH 13/15] clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC Matti Vaittinen
2021-01-08 13:46 ` [PATCH 14/15] rtc: bd70528: Support RTC on ROHM BD71815 Matti Vaittinen
2021-01-08 13:46 ` [PATCH 15/15] MAINTAINERS: Add ROHM BD71815AGW Matti Vaittinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5918dd3f7c39306dce17d0ec82823186e9ea0ed.camel@fi.rohmeurope.com \
    --to=matti.vaittinen@fi.rohmeurope.com \
    --cc=broonie@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.