Skip to contentSkip to conversation

sound: snow: Add the binding file for snow

PATCH New Simon Glass 2 participants 6 messages Apr 24, 2019 – Apr 25, 2019 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 sound: snow: Add the binding file for snow

This file was missed when adding the sound driver to U-Boot. Bring it in from Linux 5.0.

---

 doc/device-tree-bindings/sound/snow.txt | 31 +++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 doc/device-tree-bindings/sound/snow.txt
doc/device-tree-bindings/sound/snow.txt new file +31 -0
new file mode 100644
index 00000000000..80fd9a87bb3
@@ -0,0 +1,31 @@
+Audio Binding for Snow boards
+
+Required properties:
+- compatible : Can be one of the following,
+			"google,snow-audio-max98090" or
+			"google,snow-audio-max98091" or
+			"google,snow-audio-max98095"
+- samsung,i2s-controller (deprecated): The phandle of the Samsung I2S controller
+- samsung,audio-codec (deprecated): The phandle of the audio codec
+
+Required sub-nodes:
+
+ - 'cpu' subnode with a 'sound-dai' property containing the phandle of the I2S
+    controller
+ - 'codec' subnode with a 'sound-dai' property containing list of phandles
+    to the CODEC nodes, first entry must be the phandle of the MAX98090,
+    MAX98091 or MAX98095 CODEC (exact device type is indicated by the compatible
+    string) and the second entry must be the phandle of the HDMI IP block node
+
+Optional:
+- samsung,model: The name of the sound-card
+
+Example:
+
+sound {
+		compatible = "google,snow-audio-max98095";
+
+		samsung,model = "Snow-I2S-MAX98095";
+		samsung,i2s-controller = <&i2s0>;
+		samsung,audio-codec = <&max98095>;
+};
Signature · 1 line
2.21.0.593.g511ec345e18-goog
#1 lore raw

PATCH 2/3 sound: tegra: Add the binding file for tegra-audio

This file was missed when adding the sound driver to U-Boot. Bring it in from Linux 5.0.

---

 .../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
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +53 -0
new file mode 100644
index 00000000000..c3495beba35
@@ -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";
+};
Signature · 1 line
2.21.0.593.g511ec345e18-goog
maintainer
#2 lore raw

PATCH 2/3 sound: tegra: Add the binding file for tegra-audio

Quoted 16 lines · Simon Glass

This file was missed when adding the sound driver to U-Boot. Bring it in from Linux 5.0.

---

 .../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
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +0 -0
new file mode 100644
index 00000000000..c3495beba35

doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt line 1

Quoted 1 line
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +1 -0
@@ -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.

Quoted 10 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +10 -0
+
+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.

doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt line 21

Quoted 10 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +10 -0
+- 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?

Quoted 23 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +22 -0
+
+- 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",

doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt line 53

Quoted 10 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +10 -0
+		"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

Signature · 1 line
nvpublic
#3 lore raw

PATCH 2/3 sound: tegra: Add the binding file for tegra-audio

Hi Jon,

Quoted 13 lines · Jon Hunter
Quoted 10 lines · Simon Glass

This file was missed when adding the sound driver to U-Boot. Bring it in from Linux 5.0.

---

 .../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
Quoted 12 lines

doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt line 1

Quoted 7 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +1 -0
new file mode 100644
index 00000000000..c3495beba35
@@ -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!

Quoted 16 lines
Quoted 16 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +15 -0
+
+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:
Quoted 8 lines

doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt line 21

Quoted 5 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +5 -0
+
+  * 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.

Quoted 28 lines
Quoted 28 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +27 -0
+
+- 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>;
+
Quoted 8 lines

doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt line 53

Quoted 6 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +5 -0
+     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

maintainer
#4 lore raw

PATCH 2/3 sound: tegra: Add the binding file for tegra-audio

Hi Simon,

Quoted 29 lines · Simon Glass

Hi Jon,

Quoted 13 lines · Jon Hunter
Quoted 10 lines · Simon Glass

This file was missed when adding the sound driver to U-Boot. Bring it in from Linux 5.0.

---

 .../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
Quoted 12 lines

doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt line 1

Quoted 7 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +1 -0
new file mode 100644
index 00000000000..c3495beba35
@@ -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.

Quoted 4 lines

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.

Quoted 25 lines
Quoted 16 lines
Quoted 16 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +15 -0
+
+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:
Quoted 8 lines

doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt line 21

Quoted 5 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +5 -0
+
+  * Headphones
+  * Speakers
+  * Mic Jack
+  * Int Mic

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

Quoted 38 lines

I suspect not, but it can still be routed.

Quoted 36 lines
Quoted 24 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +22 -0
+
+- 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",

doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt line 53

Quoted 10 lines
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt new file +10 -0
+             "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.

Cheers
Jon

Signature · 1 line
nvpublic
#5 lore raw

PATCH 3/3 sound: Add codec enable to the sound bindings

In reply to Simon Glass

For U-Boot we allow a GPIO to be specified to enable the codec. Add this to the relevant binding files.

---

 doc/device-tree-bindings/sound/intel-hda.txt                   | 1 +
 doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt | 1 +
 doc/device-tree-bindings/sound/snow.txt                        | 1 +
 3 files changed, 3 insertions(+)
doc/device-tree-bindings/sound/intel-hda.txt +1 -0
index fb2ce550063..aa96be06e9b 100644
@@ -12,6 +12,7 @@ Required properties:
 
 Optional properties
 - intel,beep-nid: Node ID to use for beep (will be detected if not provided)
+- codec-enable-gpio : The GPIO used to enable the audio codec
 
 Required subnodes:
 - codecs: Contains a list of codec nodes
doc/device-tree-bindings/sound/nvidia,tegra-audio-max98090.txt +1 -0
index c3495beba35..25c63eac628 100644
@@ -27,6 +27,7 @@ Required properties:
 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
+- codec-enable-gpio : The GPIO used to enable the audio codec
 
 Example:
 
doc/device-tree-bindings/sound/snow.txt +1 -0
index 80fd9a87bb3..fa06956e772 100644
@@ -19,6 +19,7 @@ Required sub-nodes:
 
 Optional:
 - samsung,model: The name of the sound-card
+- codec-enable-gpio : The GPIO used to enable the audio codec
 
 Example:
 
Signature · 1 line
2.21.0.593.g511ec345e18-goog