diff mbox

[V2,7/8] ARM: dts: wm8994: Add wm8994 support on smdk5420

Message ID 1374845812-7803-8-git-send-email-padma.v@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Padmavathi Venna July 26, 2013, 1:36 p.m. UTC
This patch adds wm8994 codec node on i2c bus1 and the required
regulator supplies and properties on smdk5420 board.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 arch/arm/boot/dts/exynos5420-smdk5420.dts |   50 +++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)

Comments

Mark Brown July 26, 2013, 3:19 p.m. UTC | #1
On Fri, Jul 26, 2013 at 07:06:51PM +0530, Padmavathi Venna wrote:
> This patch adds wm8994 codec node on i2c bus1 and the required
> regulator supplies and properties on smdk5420 board.

This isn't a device tree patch for WM8994, it's a patch for the
SMDK5420.

> +	vdd: fixed-regulator@0 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vdd-supply";

These names look wrong - they should reflect the names in the schematic
as they're for human comprehensibility.  This may just be a case of
dropping the -supply.

> +		wm8994: wm8994@1a {
> +			compatible = "wlf,wm8994";
> +			reg = <0x1a>;
> +
> +			gpio-controller;
> +			#gpio-cells = <2>;
> +
> +			AVDD2-supply = <&vdd>;
> +			CPVDD-supply = <&vdd>;
> +			DBVDD-supply = <&dbvdd>;
> +			SPKVDD1-supply = <&spkvdd>;
> +			SPKVDD2-supply = <&spkvdd>;
> +		};

It would be helpful to also add a clock binding (I posted a binding
documentation update the other day, it's in my tree now) but it's not
essential and I suspect it needs some work on the clock driver side
still.
padma venkat July 27, 2013, 1:16 a.m. UTC | #2
Hi Mark,

On Fri, Jul 26, 2013 at 8:49 PM, Mark Brown <broonie@kernel.org> wrote:
> On Fri, Jul 26, 2013 at 07:06:51PM +0530, Padmavathi Venna wrote:
>> This patch adds wm8994 codec node on i2c bus1 and the required
>> regulator supplies and properties on smdk5420 board.
>
> This isn't a device tree patch for WM8994, it's a patch for the
> SMDK5420.

Yes. I will correct the subject.

>
>> +     vdd: fixed-regulator@0 {
>> +             compatible = "regulator-fixed";
>> +             regulator-name = "vdd-supply";
>
> These names look wrong - they should reflect the names in the schematic
> as they're for human comprehensibility.  This may just be a case of
> dropping the -supply.

OK.

>
>> +             wm8994: wm8994@1a {
>> +                     compatible = "wlf,wm8994";
>> +                     reg = <0x1a>;
>> +
>> +                     gpio-controller;
>> +                     #gpio-cells = <2>;
>> +
>> +                     AVDD2-supply = <&vdd>;
>> +                     CPVDD-supply = <&vdd>;
>> +                     DBVDD-supply = <&dbvdd>;
>> +                     SPKVDD1-supply = <&spkvdd>;
>> +                     SPKVDD2-supply = <&spkvdd>;
>> +             };
>
> It would be helpful to also add a clock binding (I posted a binding
> documentation update the other day, it's in my tree now) but it's not
> essential and I suspect it needs some work on the clock driver side
> still.

OK. I will check this.

Thanks
Padma
padma venkat July 29, 2013, 12:01 p.m. UTC | #3
Hi Mark,

On Sat, Jul 27, 2013 at 6:46 AM, Padma Venkat <padma.kvr@gmail.com> wrote:
> Hi Mark,
>
> On Fri, Jul 26, 2013 at 8:49 PM, Mark Brown <broonie@kernel.org> wrote:
>> On Fri, Jul 26, 2013 at 07:06:51PM +0530, Padmavathi Venna wrote:
>>> This patch adds wm8994 codec node on i2c bus1 and the required
>>> regulator supplies and properties on smdk5420 board.
>>
>> This isn't a device tree patch for WM8994, it's a patch for the
>> SMDK5420.
>
> Yes. I will correct the subject.
>
>>
>>> +     vdd: fixed-regulator@0 {
>>> +             compatible = "regulator-fixed";
>>> +             regulator-name = "vdd-supply";
>>
>> These names look wrong - they should reflect the names in the schematic
>> as they're for human comprehensibility.  This may just be a case of
>> dropping the -supply.
>

When I posted the same patch for smdk5250, you asked me to club all
the same supply regulators. So I clubbed AVDD2 and CPVDD. So any other
better name for representing both supplies?

> OK.
>
>>
>>> +             wm8994: wm8994@1a {
>>> +                     compatible = "wlf,wm8994";
>>> +                     reg = <0x1a>;
>>> +
>>> +                     gpio-controller;
>>> +                     #gpio-cells = <2>;
>>> +
>>> +                     AVDD2-supply = <&vdd>;
>>> +                     CPVDD-supply = <&vdd>;
>>> +                     DBVDD-supply = <&dbvdd>;
>>> +                     SPKVDD1-supply = <&spkvdd>;
>>> +                     SPKVDD2-supply = <&spkvdd>;
>>> +             };
>>
>> It would be helpful to also add a clock binding (I posted a binding
>> documentation update the other day, it's in my tree now) but it's not
>> essential and I suspect it needs some work on the clock driver side
>> still.
>
> OK. I will check this.

As per schemata, input clock to MCLK1 is an oscillator clock with
16.9MHz and MCLK2 not showing any input clock. So here I need to add a
fixed rate clock with 16.9MHz as MCLK1 in the smdk board file.

Is it correct?

Thanks
Padma
Mark Brown July 29, 2013, 1:43 p.m. UTC | #4
On Mon, Jul 29, 2013 at 05:31:16PM +0530, Padma Venkat wrote:
> On Sat, Jul 27, 2013 at 6:46 AM, Padma Venkat <padma.kvr@gmail.com> wrote:

> >>> +     vdd: fixed-regulator@0 {
> >>> +             compatible = "regulator-fixed";
> >>> +             regulator-name = "vdd-supply";

> >> These names look wrong - they should reflect the names in the schematic
> >> as they're for human comprehensibility.  This may just be a case of
> >> dropping the -supply.

> When I posted the same patch for smdk5250, you asked me to club all
> the same supply regulators. So I clubbed AVDD2 and CPVDD. So any other
> better name for representing both supplies?

No, I'd have told you to combine things taht come from the same supply
on the board - things like the speaker supplies for example aren't going
to be coming from separate places.  The names should reflect whatever
the names on the schemaric are, like I say that's probably just removing
the -supply.

> >> documentation update the other day, it's in my tree now) but it's not
> >> essential and I suspect it needs some work on the clock driver side
> >> still.

> > OK. I will check this.

> As per schemata, input clock to MCLK1 is an oscillator clock with
> 16.9MHz and MCLK2 not showing any input clock. So here I need to add a
> fixed rate clock with 16.9MHz as MCLK1 in the smdk board file.

> Is it correct?

Yes, in the DTS (or to XCLKOUT on the AP?).
padma venkat July 30, 2013, 3:28 a.m. UTC | #5
Hi Mark,

On Mon, Jul 29, 2013 at 7:13 PM, Mark Brown <broonie@kernel.org> wrote:
> On Mon, Jul 29, 2013 at 05:31:16PM +0530, Padma Venkat wrote:
>> On Sat, Jul 27, 2013 at 6:46 AM, Padma Venkat <padma.kvr@gmail.com> wrote:
>
>> >>> +     vdd: fixed-regulator@0 {
>> >>> +             compatible = "regulator-fixed";
>> >>> +             regulator-name = "vdd-supply";
>
>> >> These names look wrong - they should reflect the names in the schematic
>> >> as they're for human comprehensibility.  This may just be a case of
>> >> dropping the -supply.
>
>> When I posted the same patch for smdk5250, you asked me to club all
>> the same supply regulators. So I clubbed AVDD2 and CPVDD. So any other
>> better name for representing both supplies?
>
> No, I'd have told you to combine things taht come from the same supply
> on the board - things like the speaker supplies for example aren't going
> to be coming from separate places.  The names should reflect whatever
> the names on the schemaric are, like I say that's probably just removing
> the -supply.
>
>> >> documentation update the other day, it's in my tree now) but it's not
>> >> essential and I suspect it needs some work on the clock driver side
>> >> still.
>
>> > OK. I will check this.
>
>> As per schemata, input clock to MCLK1 is an oscillator clock with
>> 16.9MHz and MCLK2 not showing any input clock. So here I need to add a
>> fixed rate clock with 16.9MHz as MCLK1 in the smdk board file.
>
>> Is it correct?
>
> Yes, in the DTS (or to XCLKOUT on the AP?).

On smdk boards(atleast on smdk5250 and smdk5420) there is no XCLKOUT
funda. Codec MCLK can get clock from oscillator clock in codec master
mode or i2scdclk in codec slave mode. XCLKOUT is there in some other
variants of 5250 and 5420 where it is using other codecs than wm8994.
But the mux and divider of XCLKOUT is out of CMU. As Sylwester told it
is there in PMU registers.

Thanks
Padma
padma venkat Aug. 2, 2013, 10:45 a.m. UTC | #6
Hi Mark,

On Tue, Jul 30, 2013 at 8:58 AM, Padma Venkat <padma.kvr@gmail.com> wrote:
> Hi Mark,
>
> On Mon, Jul 29, 2013 at 7:13 PM, Mark Brown <broonie@kernel.org> wrote:
>> On Mon, Jul 29, 2013 at 05:31:16PM +0530, Padma Venkat wrote:
>>> On Sat, Jul 27, 2013 at 6:46 AM, Padma Venkat <padma.kvr@gmail.com> wrote:
>>
>>> >>> +     vdd: fixed-regulator@0 {
>>> >>> +             compatible = "regulator-fixed";
>>> >>> +             regulator-name = "vdd-supply";
>>
>>> >> These names look wrong - they should reflect the names in the schematic
>>> >> as they're for human comprehensibility.  This may just be a case of
>>> >> dropping the -supply.
>>
>>> When I posted the same patch for smdk5250, you asked me to club all
>>> the same supply regulators. So I clubbed AVDD2 and CPVDD. So any other
>>> better name for representing both supplies?
>>
>> No, I'd have told you to combine things taht come from the same supply
>> on the board - things like the speaker supplies for example aren't going
>> to be coming from separate places.  The names should reflect whatever
>> the names on the schemaric are, like I say that's probably just removing
>> the -supply.
>>
>>> >> documentation update the other day, it's in my tree now) but it's not
>>> >> essential and I suspect it needs some work on the clock driver side
>>> >> still.
>>
>>> > OK. I will check this.
>>
>>> As per schemata, input clock to MCLK1 is an oscillator clock with
>>> 16.9MHz and MCLK2 not showing any input clock. So here I need to add a
>>> fixed rate clock with 16.9MHz as MCLK1 in the smdk board file.
>>
>>> Is it correct?
>>
>> Yes, in the DTS (or to XCLKOUT on the AP?).
>
> On smdk boards(atleast on smdk5250 and smdk5420) there is no XCLKOUT
> funda. Codec MCLK can get clock from oscillator clock in codec master
> mode or i2scdclk in codec slave mode. XCLKOUT is there in some other
> variants of 5250 and 5420 where it is using other codecs than wm8994.
> But the mux and divider of XCLKOUT is out of CMU. As Sylwester told it
> is there in PMU registers.

Sorry for giving some what wrong info here. I verified the schemata.
There is a switch on the board which can be used to select the input
clock of codec MCLK1. We can either select oscillator clock which is
16.9MHz which is on the board or XCLKOUT which is from PMU or
i2scdclk(codec slave mode). Right now we are using oscillator clock as
input clock to MCLK1.

Thanks
Padma
Mark Brown Aug. 4, 2013, 5:22 p.m. UTC | #7
On Fri, Aug 02, 2013 at 04:15:28PM +0530, Padma Venkat wrote:

> Sorry for giving some what wrong info here. I verified the schemata.
> There is a switch on the board which can be used to select the input
> clock of codec MCLK1. We can either select oscillator clock which is
> 16.9MHz which is on the board or XCLKOUT which is from PMU or
> i2scdclk(codec slave mode). Right now we are using oscillator clock as
> input clock to MCLK1.

I agree that going with whatever the board ships with as default seems
sensible.  Might be worth putting in a comment with the XCLKOUT option
saying how it maps into the control on the board.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/exynos5420-smdk5420.dts b/arch/arm/boot/dts/exynos5420-smdk5420.dts
index d05de7a..28a6855 100644
--- a/arch/arm/boot/dts/exynos5420-smdk5420.dts
+++ b/arch/arm/boot/dts/exynos5420-smdk5420.dts
@@ -68,4 +68,54 @@ 
 			bus-width = <4>;
 		};
 	};
+
+	vdd: fixed-regulator@0 {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd-supply";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-always-on;
+	};
+
+	dbvdd: fixed-regulator@1 {
+		compatible = "regulator-fixed";
+		regulator-name = "dbvdd-supply";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
+
+	spkvdd: fixed-regulator@2 {
+		compatible = "regulator-fixed";
+		regulator-name = "spkvdd-supply";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
+	i2c@12C70000 {
+		status = "okay";
+		samsung,i2c-sda-delay = <100>;
+		samsung,i2c-max-bus-freq = <20000>;
+
+		eeprom@51 {
+			compatible = "samsung,s524ad0xd1";
+			reg = <0x51>;
+		};
+
+		wm8994: wm8994@1a {
+			compatible = "wlf,wm8994";
+			reg = <0x1a>;
+
+			gpio-controller;
+			#gpio-cells = <2>;
+
+			AVDD2-supply = <&vdd>;
+			CPVDD-supply = <&vdd>;
+			DBVDD-supply = <&dbvdd>;
+			SPKVDD1-supply = <&spkvdd>;
+			SPKVDD2-supply = <&spkvdd>;
+		};
+	};
+
 };