From: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: "broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
<broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"sbkim73-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
<sbkim73-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Kyungmin Park
<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH 1/2] regulator: s5m8767: Modify parse_dt function to parse data related to ramp
Date: Thu, 10 Oct 2013 20:10:53 +0900 [thread overview]
Message-ID: <52568B3D.7020209@samsung.com> (raw)
In-Reply-To: <20131010102826.GG26954-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
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.
>
>>
>> Signed-off-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Signed-off-by: Kyungmin Park <kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> ---
>> 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.
>
> 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.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Mark Rutland <mark.rutland@arm.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 20:10:53 +0900 [thread overview]
Message-ID: <52568B3D.7020209@samsung.com> (raw)
In-Reply-To: <20131010102826.GG26954@e106331-lin.cambridge.arm.com>
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.
>
>>
>> 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.
>
> 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.
next prev parent reply other threads:[~2013-10-10 11:10 UTC|newest]
Thread overview: 13+ 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
2013-10-10 1:41 ` 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 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 [this message]
2013-10-10 11:10 ` Chanwoo Choi
2013-10-10 16:51 ` Mark Rutland
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=52568B3D.7020209@samsung.com \
--to=cw00.choi-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=sbkim73-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
/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.