diff mbox series

[U-Boot,2/3] sound: tegra: Add the binding file for tegra-audio

Message ID 20190424035625.57087-2-sjg@chromium.org
State Accepted
Commit 9944d753cbc616d7b1004a40a56146b8fb51544b
Delegated to: Tom Warren
Headers show
Series [U-Boot,1/3] sound: snow: Add the binding file for snow | expand

Commit Message

Simon Glass April 24, 2019, 3:56 a.m. UTC
This file was missed when adding the sound driver to U-Boot. Bring it in
from Linux 5.0.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 .../sound/nvidia,tegra-audio-max98090.txt     | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt

Comments

Jon Hunter April 24, 2019, 9:15 a.m. UTC | #1
On 24/04/2019 04:56, Simon Glass wrote:
> This file was missed when adding the sound driver to U-Boot. Bring it in
> from Linux 5.0.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  .../sound/nvidia,tegra-audio-max98090.txt     | 53 +++++++++++++++++++
>  1 file changed, 53 insertions(+)
>  create mode 100644 doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
> 
> diff --git a/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt b/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
> new file mode 100644
> index 00000000000..c3495beba35
> --- /dev/null
> +++ b/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
> @@ -0,0 +1,53 @@
> +NVIDIA Tegra audio complex, with MAX98090 CODEC

Does this work for all Tegra chips? I have noticed in some of our kernel
binding docs we don't really say specifically what Tegra devices this is
applicable for. If this is only verified for Tegra124 then it could be
worth mentioning that.

> +
> +Required properties:
> +- compatible : "nvidia,tegra-audio-max98090"
> +- clocks : Must contain an entry for each entry in clock-names.
> +  See ../clocks/clock-bindings.txt for details.
> +- clock-names : Must include the following entries:
> +  - pll_a
> +  - pll_a_out0
> +  - mclk (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
> +- nvidia,model : The user-visible name of this sound complex.
> +- nvidia,audio-routing : A list of the connections between audio components.
> +  Each entry is a pair of strings, the first being the connection's sink,
> +  the second being the connection's source. Valid names for sources and
> +  sinks are the MAX98090's pins (as documented in its binding), and the jacks
> +  on the board:
> +
> +  * Headphones
> +  * Speakers
> +  * Mic Jack
> +  * Int Mic

I don't see 'Int Mic' used anywhere in the example. Is this really a
physical jack?

> +
> +- nvidia,i2s-controller : The phandle of the Tegra I2S controller that's
> +  connected to the CODEC.
> +- nvidia,audio-codec : The phandle of the MAX98090 audio codec.
> +
> +Optional properties:
> +- nvidia,hp-det-gpios : The GPIO that detect headphones are plugged in
> +- nvidia,mic-det-gpios : The GPIO that detect microphones are plugged in
> +
> +Example:
> +
> +sound {
> +	compatible = "nvidia,tegra-audio-max98090-venice2",
> +		     "nvidia,tegra-audio-max98090";
> +	nvidia,model = "NVIDIA Tegra Venice2";
> +
> +	nvidia,audio-routing =
> +		"Headphones", "HPR",
> +		"Headphones", "HPL",
> +		"Speakers", "SPKR",
> +		"Speakers", "SPKL",
> +		"Mic Jack", "MICBIAS",
> +		"IN34", "Mic Jack";
> +
> +	nvidia,i2s-controller = <&tegra_i2s1>;
> +	nvidia,audio-codec = <&acodec>;
> +
> +	clocks = <&tegra_car TEGRA124_CLK_PLL_A>,
> +		 <&tegra_car TEGRA124_CLK_PLL_A_OUT0>,
> +		 <&tegra_car TEGRA124_CLK_EXTERN1>;
> +	clock-names = "pll_a", "pll_a_out0", "mclk";
> +};
> 

Otherwise LGTM.

Cheers
Jon
Simon Glass April 25, 2019, 1:11 a.m. UTC | #2
Hi Jon,

On Wed, 24 Apr 2019 at 03:15, Jon Hunter <jonathanh@nvidia.com> wrote:
>
>
> On 24/04/2019 04:56, Simon Glass wrote:
> > This file was missed when adding the sound driver to U-Boot. Bring it in
> > from Linux 5.0.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >  .../sound/nvidia,tegra-audio-max98090.txt     | 53 +++++++++++++++++++
> >  1 file changed, 53 insertions(+)
> >  create mode 100644 doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
> >
> > diff --git a/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt b/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
> > new file mode 100644
> > index 00000000000..c3495beba35
> > --- /dev/null
> > +++ b/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
> > @@ -0,0 +1,53 @@
> > +NVIDIA Tegra audio complex, with MAX98090 CODEC
>
> Does this work for all Tegra chips? I have noticed in some of our kernel
> binding docs we don't really say specifically what Tegra devices this is
> applicable for. If this is only verified for Tegra124 then it could be
> worth mentioning that.

This file comes from Linux so I would rather not modify it in U-Boot.
I believe this works for anything with a 'tegra audio' component and
that this is from tegra124 onwards, but then, you guys are the
experts!

>
> > +
> > +Required properties:
> > +- compatible : "nvidia,tegra-audio-max98090"
> > +- clocks : Must contain an entry for each entry in clock-names.
> > +  See ../clocks/clock-bindings.txt for details.
> > +- clock-names : Must include the following entries:
> > +  - pll_a
> > +  - pll_a_out0
> > +  - mclk (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
> > +- nvidia,model : The user-visible name of this sound complex.
> > +- nvidia,audio-routing : A list of the connections between audio components.
> > +  Each entry is a pair of strings, the first being the connection's sink,
> > +  the second being the connection's source. Valid names for sources and
> > +  sinks are the MAX98090's pins (as documented in its binding), and the jacks
> > +  on the board:
> > +
> > +  * Headphones
> > +  * Speakers
> > +  * Mic Jack
> > +  * Int Mic
>
> I don't see 'Int Mic' used anywhere in the example. Is this really a
> physical jack?

I suspect not, but it can still be routed.

>
> > +
> > +- nvidia,i2s-controller : The phandle of the Tegra I2S controller that's
> > +  connected to the CODEC.
> > +- nvidia,audio-codec : The phandle of the MAX98090 audio codec.
> > +
> > +Optional properties:
> > +- nvidia,hp-det-gpios : The GPIO that detect headphones are plugged in
> > +- nvidia,mic-det-gpios : The GPIO that detect microphones are plugged in
> > +
> > +Example:
> > +
> > +sound {
> > +     compatible = "nvidia,tegra-audio-max98090-venice2",
> > +                  "nvidia,tegra-audio-max98090";
> > +     nvidia,model = "NVIDIA Tegra Venice2";
> > +
> > +     nvidia,audio-routing =
> > +             "Headphones", "HPR",
> > +             "Headphones", "HPL",
> > +             "Speakers", "SPKR",
> > +             "Speakers", "SPKL",
> > +             "Mic Jack", "MICBIAS",
> > +             "IN34", "Mic Jack";
> > +
> > +     nvidia,i2s-controller = <&tegra_i2s1>;
> > +     nvidia,audio-codec = <&acodec>;
> > +
> > +     clocks = <&tegra_car TEGRA124_CLK_PLL_A>,
> > +              <&tegra_car TEGRA124_CLK_PLL_A_OUT0>,
> > +              <&tegra_car TEGRA124_CLK_EXTERN1>;
> > +     clock-names = "pll_a", "pll_a_out0", "mclk";
> > +};
> >
>
> Otherwise LGTM.

Regards,
Simon
Jon Hunter April 25, 2019, 8:48 a.m. UTC | #3
Hi Simon,

On 25/04/2019 02:11, Simon Glass wrote:
> Hi Jon,
> 
> On Wed, 24 Apr 2019 at 03:15, Jon Hunter <jonathanh@nvidia.com> wrote:
>>
>>
>> On 24/04/2019 04:56, Simon Glass wrote:
>>> This file was missed when adding the sound driver to U-Boot. Bring it in
>>> from Linux 5.0.
>>>
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>>  .../sound/nvidia,tegra-audio-max98090.txt     | 53 +++++++++++++++++++
>>>  1 file changed, 53 insertions(+)
>>>  create mode 100644 doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
>>>
>>> diff --git a/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt b/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
>>> new file mode 100644
>>> index 00000000000..c3495beba35
>>> --- /dev/null
>>> +++ b/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
>>> @@ -0,0 +1,53 @@
>>> +NVIDIA Tegra audio complex, with MAX98090 CODEC
>>
>> Does this work for all Tegra chips? I have noticed in some of our kernel
>> binding docs we don't really say specifically what Tegra devices this is
>> applicable for. If this is only verified for Tegra124 then it could be
>> worth mentioning that.
> 
> This file comes from Linux so I would rather not modify it in U-Boot.
> I believe this works for anything with a 'tegra audio' component and
> that this is from tegra124 onwards, but then, you guys are the
> experts!

Ah yes I see. I believe that at the time it was assumed that it would
but so far we don't have I2S support beyond T124 in upstream Linux at
the moment. We are working on this but unfortunately, I don't believe
that properties such as 'nvidia,i2s-controller' will be used.

>>
>>> +
>>> +Required properties:
>>> +- compatible : "nvidia,tegra-audio-max98090"
>>> +- clocks : Must contain an entry for each entry in clock-names.
>>> +  See ../clocks/clock-bindings.txt for details.
>>> +- clock-names : Must include the following entries:
>>> +  - pll_a
>>> +  - pll_a_out0
>>> +  - mclk (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
>>> +- nvidia,model : The user-visible name of this sound complex.
>>> +- nvidia,audio-routing : A list of the connections between audio components.
>>> +  Each entry is a pair of strings, the first being the connection's sink,
>>> +  the second being the connection's source. Valid names for sources and
>>> +  sinks are the MAX98090's pins (as documented in its binding), and the jacks
>>> +  on the board:
>>> +
>>> +  * Headphones
>>> +  * Speakers
>>> +  * Mic Jack
>>> +  * Int Mic
>>
>> I don't see 'Int Mic' used anywhere in the example. Is this really a
>> physical jack?
> 
> I suspect not, but it can still be routed.
> 
>>
>>> +
>>> +- nvidia,i2s-controller : The phandle of the Tegra I2S controller that's
>>> +  connected to the CODEC.
>>> +- nvidia,audio-codec : The phandle of the MAX98090 audio codec.
>>> +
>>> +Optional properties:
>>> +- nvidia,hp-det-gpios : The GPIO that detect headphones are plugged in
>>> +- nvidia,mic-det-gpios : The GPIO that detect microphones are plugged in
>>> +
>>> +Example:
>>> +
>>> +sound {
>>> +     compatible = "nvidia,tegra-audio-max98090-venice2",
>>> +                  "nvidia,tegra-audio-max98090";
>>> +     nvidia,model = "NVIDIA Tegra Venice2";
>>> +
>>> +     nvidia,audio-routing =
>>> +             "Headphones", "HPR",
>>> +             "Headphones", "HPL",
>>> +             "Speakers", "SPKR",
>>> +             "Speakers", "SPKL",
>>> +             "Mic Jack", "MICBIAS",
>>> +             "IN34", "Mic Jack";
>>> +
>>> +     nvidia,i2s-controller = <&tegra_i2s1>;
>>> +     nvidia,audio-codec = <&acodec>;
>>> +
>>> +     clocks = <&tegra_car TEGRA124_CLK_PLL_A>,
>>> +              <&tegra_car TEGRA124_CLK_PLL_A_OUT0>,
>>> +              <&tegra_car TEGRA124_CLK_EXTERN1>;
>>> +     clock-names = "pll_a", "pll_a_out0", "mclk";
>>> +};
>>>
>>
>> Otherwise LGTM.

So given this aligns with Linux this is fine with me.

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon
diff mbox series

Patch

diff --git a/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt b/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
new file mode 100644
index 00000000000..c3495beba35
--- /dev/null
+++ b/doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt
@@ -0,0 +1,53 @@ 
+NVIDIA Tegra audio complex, with MAX98090 CODEC
+
+Required properties:
+- compatible : "nvidia,tegra-audio-max98090"
+- clocks : Must contain an entry for each entry in clock-names.
+  See ../clocks/clock-bindings.txt for details.
+- clock-names : Must include the following entries:
+  - pll_a
+  - pll_a_out0
+  - mclk (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
+- nvidia,model : The user-visible name of this sound complex.
+- nvidia,audio-routing : A list of the connections between audio components.
+  Each entry is a pair of strings, the first being the connection's sink,
+  the second being the connection's source. Valid names for sources and
+  sinks are the MAX98090's pins (as documented in its binding), and the jacks
+  on the board:
+
+  * Headphones
+  * Speakers
+  * Mic Jack
+  * Int Mic
+
+- nvidia,i2s-controller : The phandle of the Tegra I2S controller that's
+  connected to the CODEC.
+- nvidia,audio-codec : The phandle of the MAX98090 audio codec.
+
+Optional properties:
+- nvidia,hp-det-gpios : The GPIO that detect headphones are plugged in
+- nvidia,mic-det-gpios : The GPIO that detect microphones are plugged in
+
+Example:
+
+sound {
+	compatible = "nvidia,tegra-audio-max98090-venice2",
+		     "nvidia,tegra-audio-max98090";
+	nvidia,model = "NVIDIA Tegra Venice2";
+
+	nvidia,audio-routing =
+		"Headphones", "HPR",
+		"Headphones", "HPL",
+		"Speakers", "SPKR",
+		"Speakers", "SPKL",
+		"Mic Jack", "MICBIAS",
+		"IN34", "Mic Jack";
+
+	nvidia,i2s-controller = <&tegra_i2s1>;
+	nvidia,audio-codec = <&acodec>;
+
+	clocks = <&tegra_car TEGRA124_CLK_PLL_A>,
+		 <&tegra_car TEGRA124_CLK_PLL_A_OUT0>,
+		 <&tegra_car TEGRA124_CLK_EXTERN1>;
+	clock-names = "pll_a", "pll_a_out0", "mclk";
+};