devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Chanwoo Choi <cw00.choi@samsung.com>
Cc: "broonie@kernel.org" <broonie@kernel.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"sbkim73@samsung.com" <sbkim73@samsung.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH 1/2] regulator: s5m8767: Modify parse_dt function to parse data related to ramp
Date: Thu, 10 Oct 2013 17:51:00 +0100	[thread overview]
Message-ID: <20131010165100.GA3910@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <52568B3D.7020209@samsung.com>

On Thu, Oct 10, 2013 at 12:10:53PM +0100, Chanwoo Choi wrote:
> On 10/10/2013 07:28 PM, Mark Rutland wrote:
> > On Thu, Oct 10, 2013 at 02:41:35AM +0100, Chanwoo Choi wrote:
> >> This patch parse 'buck[2-4]_ramp_enable and buck_ramp_delay' platform data
> >> from dts file.
> > 
> > Why?
> > 
> > What do these describe? Why do we need them?
> 
> Turn on ramp control of buck2/3/4.

Ok, but why does this need to be in the dt?

> 
> > 
> >>
> >> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> >> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >> ---
> >>  drivers/regulator/s5m8767.c | 16 ++++++++++++++++
> >>  1 file changed, 16 insertions(+)
> >>
> >> diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
> >> index c24448b..cb6cdb3 100644
> >> --- a/drivers/regulator/s5m8767.c
> >> +++ b/drivers/regulator/s5m8767.c
> >> @@ -640,6 +640,22 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
> >>  		return -EINVAL;
> >>  	}
> >>  
> >> +	if (of_get_property(pmic_np, "s5m8767,pmic-buck2-ramp-enable", NULL))
> >> +		pdata->buck2_ramp_enable = true;
> > 
> > Please describe what this is and why we need it.
> 
> buck2/3/4_ramp_enable is used to protect the chip from the in-rush current.

Ok. Could we not always set these in the driver? Under what
circumstances do we need this?

> 
> > 
> > For reading boolean proeprties, use of_property_read_bool.
> 
> I'll fix it.
> 
> > 
> >> +
> >> +	if (of_get_property(pmic_np, "s5m8767,pmic-buck3-ramp-enable", NULL))
> >> +		pdata->buck3_ramp_enable = true;
> >> +
> >> +	if (of_get_property(pmic_np, "s5m8767,pmic-buck4-ramp-enable", NULL))
> >> +		pdata->buck4_ramp_enable = true;
> >> +
> >> +	if (pdata->buck2_ramp_enable || pdata->buck3_ramp_enable
> >> +			|| pdata->buck4_ramp_enable) {
> >> +		if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay",
> >> +				&pdata->buck_ramp_delay))
> >> +			pdata->buck_ramp_delay = 0;
> > 
> > Why not initialise pdata->buck_ramp_delay to 0 beforehand?
> > 
> > That way you don't need to check the return value of
> > of_property_read_u32 here.
> > 
> > I note that pdata->buck_ramp_delay is an int, not a u32. Please use a
> > u32 temporary variable.
> 
> I'll fix it
> 
> > 
> >> +	}
> >> +
> > 
> > NAK. None of these seem to be documented in mainline's
> > Documentation/devicetree/bindings/regulator/s5m8767-regulator.txt, nor
> > does documentation seem to be added here. Until there's some description
> > of what these are and why they're needed, I don't think they're
> > suitable.
> 
> I'll add description about this patch.

Cheers.

Mark.

  reply	other threads:[~2013-10-10 16:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10  1:41 [PATCH 1/2] regulator: s5m8767: Modify parse_dt function to parse data related to ramp Chanwoo Choi
     [not found] ` <1381369296-17101-1-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-10-10  1:41   ` [PATCH 2/2] regulator: s5m8767: Modify parsing method of the voltage table of buck2/3/4 Chanwoo Choi
     [not found]     ` <1381369296-17101-2-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-10-10 10:36       ` Mark Rutland
2013-10-10 11:46         ` Chanwoo Choi
2013-10-10 10:28 ` [PATCH 1/2] regulator: s5m8767: Modify parse_dt function to parse data related to ramp Mark Rutland
     [not found]   ` <20131010102826.GG26954-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-10-10 11:10     ` Chanwoo Choi
2013-10-10 16:51       ` Mark Rutland [this message]
2013-10-10 17:36         ` Mark Brown
2013-10-24 10:15 ` Mark Brown
2013-10-25  9:08   ` Chanwoo Choi

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=20131010165100.GA3910@e106331-lin.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=broonie@kernel.org \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sbkim73@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).