linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] qcom: ipq4019: Add regulator support to DK04 device tree
@ 2016-04-04 21:08 Sreedhar Sambangi
  2016-04-05  5:59 ` Andy Gross
  2016-04-07 17:57 ` Rob Herring
  0 siblings, 2 replies; 5+ messages in thread
From: Sreedhar Sambangi @ 2016-04-04 21:08 UTC (permalink / raw)
  To: devicetree, andy.gross, linux-arm-msm
  Cc: david.brown, robh+dt, pawel.moll, mark.rutland, ijc+devicetree,
	galak, linux, linux-soc, linux-arm-kernel, linux-kernel,
	qca-upstream.external

    This adds the regulator nodes to DK04 device tree to support

Change-Id: I9c1df0e720a330bf6db1889fd2247f6a70ea6faa
Signed-off-by: Sreedhar Sambangi <ssambang@codeaurora.org>
---
 .../bindings/regulator/ipq4019-regulator.txt          | 19 +++++++++++++++++++
 arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi         | 11 +++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt

diff --git a/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
new file mode 100644
index 0000000..9d934a4
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
@@ -0,0 +1,19 @@
+* Qualcomm Technologies, Inc. IPQ4019 regulators
+
+Required properties:
+- compatible		: Must be "regulator-ipq4019".
+- states		: Selection of available voltages and corresponding values
+- reg			: Register address for controlling LDO
+- mask			: Mask value for switching voltages
+Example:
+
+	vccq_sd0: regulator@0 {
+		compatible = "qcom,regulator-ipq4019";
+		regulator-name = "SD0 VccQ";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <3000000>;
+		states = <3000000 0x3
+			1800000 0x1>;
+		reg = <0x01948000 0x4>;
+		mask = <0x3>;
+	};
diff --git a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi
index 9f3c864..566e239 100644
--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi
@@ -155,5 +155,16 @@
 		watchdog@b017000 {
 			status = "ok";
 		};
+
+		vccq_sd0: regulator@0 {
+			compatible = "qcom,regulator-ipq4019";
+			regulator-name = "SD0 VccQ";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3000000>;
+			states = <3000000 0x3
+				1800000 0x1>;
+			reg = <0x01948000 0x4>;
+			mask = <0x3>;
+		};
 	};
 };
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] qcom: ipq4019: Add regulator support to DK04 device tree
  2016-04-04 21:08 [PATCH 1/2] qcom: ipq4019: Add regulator support to DK04 device tree Sreedhar Sambangi
@ 2016-04-05  5:59 ` Andy Gross
  2016-04-06  4:55   ` Sreedhar Sambangi
  2016-04-07 17:57 ` Rob Herring
  1 sibling, 1 reply; 5+ messages in thread
From: Andy Gross @ 2016-04-05  5:59 UTC (permalink / raw)
  To: Sreedhar Sambangi
  Cc: devicetree, linux-arm-msm, david.brown, robh+dt, pawel.moll,
	mark.rutland, ijc+devicetree, galak, linux, linux-soc,
	linux-arm-kernel, linux-kernel, qca-upstream.external

On Mon, Apr 04, 2016 at 02:08:10PM -0700, Sreedhar Sambangi wrote:
>     This adds the regulator nodes to DK04 device tree to support
> 
> Change-Id: I9c1df0e720a330bf6db1889fd2247f6a70ea6faa
> Signed-off-by: Sreedhar Sambangi <ssambang@codeaurora.org>
> ---
>  .../bindings/regulator/ipq4019-regulator.txt          | 19 +++++++++++++++++++
>  arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi         | 11 +++++++++++
>  2 files changed, 30 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
> 
> diff --git a/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
> new file mode 100644
> index 0000000..9d934a4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
> @@ -0,0 +1,19 @@
> +* Qualcomm Technologies, Inc. IPQ4019 regulators
> +
> +Required properties:
> +- compatible		: Must be "regulator-ipq4019".
> +- states		: Selection of available voltages and corresponding values
> +- reg			: Register address for controlling LDO
> +- mask			: Mask value for switching voltages
> +Example:

How many LDOs are there on the IPQ4019?  Can you document all of the supplies?
You can figure this out by looking for the vdd pins in the chip documentation

> +
> +	vccq_sd0: regulator@0 {
> +		compatible = "qcom,regulator-ipq4019";
> +		regulator-name = "SD0 VccQ";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3000000>;
> +		states = <3000000 0x3
> +			1800000 0x1>;

So there are only 2 states?  No linear range from 1.8 to 3.3?

> +		reg = <0x01948000 0x4>;
> +		mask = <0x3>;
> +	};

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] qcom: ipq4019: Add regulator support to DK04 device tree
  2016-04-05  5:59 ` Andy Gross
@ 2016-04-06  4:55   ` Sreedhar Sambangi
  0 siblings, 0 replies; 5+ messages in thread
From: Sreedhar Sambangi @ 2016-04-06  4:55 UTC (permalink / raw)
  To: Andy Gross
  Cc: devicetree, linux-arm-msm, david.brown, robh+dt, pawel.moll,
	mark.rutland, ijc+devicetree, galak, linux, linux-soc,
	linux-arm-kernel, linux-kernel, qca-upstream.external

On 2016-04-04 22:59, Andy Gross wrote:
> On Mon, Apr 04, 2016 at 02:08:10PM -0700, Sreedhar Sambangi wrote:
>>     This adds the regulator nodes to DK04 device tree to support
>> 
>> Change-Id: I9c1df0e720a330bf6db1889fd2247f6a70ea6faa
>> Signed-off-by: Sreedhar Sambangi <ssambang@codeaurora.org>
>> ---
>>  .../bindings/regulator/ipq4019-regulator.txt          | 19 
>> +++++++++++++++++++
>>  arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi         | 11 
>> +++++++++++
>>  2 files changed, 30 insertions(+)
>>  create mode 100644 
>> Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
>> 
>> diff --git 
>> a/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt 
>> b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
>> new file mode 100644
>> index 0000000..9d934a4
>> --- /dev/null
>> +++ 
>> b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
>> @@ -0,0 +1,19 @@
>> +* Qualcomm Technologies, Inc. IPQ4019 regulators
>> +
>> +Required properties:
>> +- compatible		: Must be "regulator-ipq4019".
>> +- states		: Selection of available voltages and corresponding values
>> +- reg			: Register address for controlling LDO
>> +- mask			: Mask value for switching voltages
>> +Example:
> 
> How many LDOs are there on the IPQ4019?  Can you document all of the 
> supplies?
> You can figure this out by looking for the vdd pins in the chip 
> documentation
> 
In this Chip , We only have one Software programmable LDO used for SD 
/eMMC. The other LDO's are with fixed voltage.

>> +
>> +	vccq_sd0: regulator@0 {
>> +		compatible = "qcom,regulator-ipq4019";
>> +		regulator-name = "SD0 VccQ";
>> +		regulator-min-microvolt = <1800000>;
>> +		regulator-max-microvolt = <3000000>;
>> +		states = <3000000 0x3
>> +			1800000 0x1>;
> 
> So there are only 2 states?  No linear range from 1.8 to 3.3?

Currently this LDO can support [1.5, 1.8, 2.5 and 3] but for the SD / 
eMMC scenario, we use only two states.

> 
>> +		reg = <0x01948000 0x4>;
>> +		mask = <0x3>;
>> +	};

-- 
-Sree

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] qcom: ipq4019: Add regulator support to DK04 device tree
  2016-04-04 21:08 [PATCH 1/2] qcom: ipq4019: Add regulator support to DK04 device tree Sreedhar Sambangi
  2016-04-05  5:59 ` Andy Gross
@ 2016-04-07 17:57 ` Rob Herring
  2016-04-07 18:11   ` Andy Gross
  1 sibling, 1 reply; 5+ messages in thread
From: Rob Herring @ 2016-04-07 17:57 UTC (permalink / raw)
  To: Sreedhar Sambangi
  Cc: devicetree, andy.gross, linux-arm-msm, david.brown, pawel.moll,
	mark.rutland, ijc+devicetree, galak, linux, linux-soc,
	linux-arm-kernel, linux-kernel, qca-upstream.external

On Mon, Apr 04, 2016 at 02:08:10PM -0700, Sreedhar Sambangi wrote:
>     This adds the regulator nodes to DK04 device tree to support
> 
> Change-Id: I9c1df0e720a330bf6db1889fd2247f6a70ea6faa
> Signed-off-by: Sreedhar Sambangi <ssambang@codeaurora.org>
> ---
>  .../bindings/regulator/ipq4019-regulator.txt          | 19 +++++++++++++++++++
>  arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi         | 11 +++++++++++
>  2 files changed, 30 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
> 
> diff --git a/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
> new file mode 100644
> index 0000000..9d934a4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
> @@ -0,0 +1,19 @@
> +* Qualcomm Technologies, Inc. IPQ4019 regulators
> +
> +Required properties:
> +- compatible		: Must be "regulator-ipq4019".

Doesn't match your example which correctly has vendor prefix. Also, the 
preferred form is <vendor>,<soc>-<block>.

> +- states		: Selection of available voltages and corresponding values

Too generic of a name.

Is this not fixed by the h/w block?

> +- reg			: Register address for controlling LDO
> +- mask			: Mask value for switching voltages

What else is in this register? If something unrelated, then this is all 
wrong to the regulator. You can only define the register address in one 
place in the DT. Otherwise, you should know the mask from the compatible 
string.

Rob

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] qcom: ipq4019: Add regulator support to DK04 device tree
  2016-04-07 17:57 ` Rob Herring
@ 2016-04-07 18:11   ` Andy Gross
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Gross @ 2016-04-07 18:11 UTC (permalink / raw)
  To: Rob Herring
  Cc: Sreedhar Sambangi, mark.rutland, devicetree, linux, pawel.moll,
	ijc+devicetree, linux-arm-msm, linux-kernel,
	qca-upstream.external, david.brown, galak, linux-soc,
	linux-arm-kernel

On Thu, Apr 07, 2016 at 12:57:36PM -0500, Rob Herring wrote:
> On Mon, Apr 04, 2016 at 02:08:10PM -0700, Sreedhar Sambangi wrote:
> >     This adds the regulator nodes to DK04 device tree to support
> > 
> > Change-Id: I9c1df0e720a330bf6db1889fd2247f6a70ea6faa
> > Signed-off-by: Sreedhar Sambangi <ssambang@codeaurora.org>
> > ---
> >  .../bindings/regulator/ipq4019-regulator.txt          | 19 +++++++++++++++++++
> >  arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi         | 11 +++++++++++
> >  2 files changed, 30 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
> > new file mode 100644
> > index 0000000..9d934a4
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/regulator/ipq4019-regulator.txt
> > @@ -0,0 +1,19 @@
> > +* Qualcomm Technologies, Inc. IPQ4019 regulators
> > +
> > +Required properties:
> > +- compatible		: Must be "regulator-ipq4019".
> 
> Doesn't match your example which correctly has vendor prefix. Also, the 
> preferred form is <vendor>,<soc>-<block>.
> 
> > +- states		: Selection of available voltages and corresponding values
> 
> Too generic of a name.
> 
> Is this not fixed by the h/w block?

I'd put this info in the driver itself.  I believe it has 4 fixed states.

> 
> > +- reg			: Register address for controlling LDO
> > +- mask			: Mask value for switching voltages
> 
> What else is in this register? If something unrelated, then this is all 
> wrong to the regulator. You can only define the register address in one 
> place in the DT. Otherwise, you should know the mask from the compatible 
> string.

I agree.  All of this needs to be done inside the code itself.  All you need is
the register.  This is a TCSR register which means that it could have other bits
doing other things.  I would hope that the hw guys isolated only regulator bits
in here.


Regards,

Andy Gross

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-07 18:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-04 21:08 [PATCH 1/2] qcom: ipq4019: Add regulator support to DK04 device tree Sreedhar Sambangi
2016-04-05  5:59 ` Andy Gross
2016-04-06  4:55   ` Sreedhar Sambangi
2016-04-07 17:57 ` Rob Herring
2016-04-07 18:11   ` Andy Gross

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).