diff mbox

[RFC,5/7] ASoC: Add Odroid sound DT bindings documentation

Message ID 1492795191-31298-6-git-send-email-s.nawrocki@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

This patch adds DT binding documentation for Odroid XU3/4
sound subsystem.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 .../devicetree/bindings/sound/samsung,odroid.txt   | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/samsung,odroid.txt

Comments

Mark Brown April 21, 2017, 5:58 p.m. UTC | #1
On Fri, Apr 21, 2017 at 07:31:42PM +0200, Krzysztof Kozlowski wrote:

> Although Sylwester is known of writing good quality code and can be
> trusted but he posted it just 9 minutes ago. Isn't it a little bit too
> fast to apply? I just finished reading cover letter but didn't manage
> to start looking at the rest. :)

It's pretty standard boilerplate stuff, there's not much in there to
review and Sylwester is one of the maintainers listed for this code so I
wasn't particularly expecting extra review.
Krzysztof Kozlowski April 21, 2017, 6:01 p.m. UTC | #2
On Fri, Apr 21, 2017 at 06:58:00PM +0100, Mark Brown wrote:
> On Fri, Apr 21, 2017 at 07:31:42PM +0200, Krzysztof Kozlowski wrote:
> 
> > Although Sylwester is known of writing good quality code and can be
> > trusted but he posted it just 9 minutes ago. Isn't it a little bit too
> > fast to apply? I just finished reading cover letter but didn't manage
> > to start looking at the rest. :)
> 
> It's pretty standard boilerplate stuff, there's not much in there to
> review and Sylwester is one of the maintainers listed for this code so I
> wasn't particularly expecting extra review.

Okay then. Probably it was one of fastest applies. :)

Best regards,
Krzysztof
Krzysztof Kozlowski April 21, 2017, 6:07 p.m. UTC | #3
On Fri, Apr 21, 2017 at 06:58:00PM +0100, Mark Brown wrote:
> On Fri, Apr 21, 2017 at 07:31:42PM +0200, Krzysztof Kozlowski wrote:
> 
> > Although Sylwester is known of writing good quality code and can be
> > trusted but he posted it just 9 minutes ago. Isn't it a little bit too
> > fast to apply? I just finished reading cover letter but didn't manage
> > to start looking at the rest. :)
> 
> It's pretty standard boilerplate stuff, there's not much in there to
> review and Sylwester is one of the maintainers listed for this code so I
> wasn't particularly expecting extra review.

Off the list, off-topic,

Mutt is complaining that your key used to sign the mails has expired:
	gpg: Note: This key has expired!
	Primary key fingerprint: 3F25 68AA C269 98F9 E813  A1C5 C3F4 36CA 30F5 D8EB
	Subkey fingerprint: ADE6 68AA 6757 18B5 9FE2  9FEA 24D6 8B72 5D54 87D0

Best regards,
Krzysztof
Mark Brown April 24, 2017, 9:57 a.m. UTC | #4
On Fri, Apr 21, 2017 at 08:07:10PM +0200, Krzysztof Kozlowski wrote:

> Mutt is complaining that your key used to sign the mails has expired:
> 	gpg: Note: This key has expired!
> 	Primary key fingerprint: 3F25 68AA C269 98F9 E813  A1C5 C3F4 36CA 30F5 D8EB
> 	Subkey fingerprint: ADE6 68AA 6757 18B5 9FE2  9FEA 24D6 8B72 5D54 87D0

gpg --refresh-keys should fix that.
Rob Herring April 28, 2017, 5:03 p.m. UTC | #5
On Fri, Apr 21, 2017 at 07:19:49PM +0200, Sylwester Nawrocki wrote:
> This patch adds DT binding documentation for Odroid XU3/4
> sound subsystem.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
>  .../devicetree/bindings/sound/samsung,odroid.txt   | 57 ++++++++++++++++++++++
>  1 file changed, 57 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/samsung,odroid.txt
> 
> diff --git a/Documentation/devicetree/bindings/sound/samsung,odroid.txt b/Documentation/devicetree/bindings/sound/samsung,odroid.txt
> new file mode 100644
> index 0000000..c1ac70c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/samsung,odroid.txt
> @@ -0,0 +1,57 @@
> +Samsung Exynos Odroid XU3/XU4 audio complex with MAX98090 codec
> +
> +Required properties:
> +
> + - compatible - "samsung,odroidxu3-audio" - for Odroid XU3 board,
> +		"samsung,odroidxu4-audio" - for Odroid XU4 board
> + - model - the user-visible name of this sound complex

ASoC will support "label" soon (see graph support). Use that instead.

> + - '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 corresponding to the MAX98090
> +    CODEC and the second entry must be the phandle of the HDMI IP block node

These are not properties, so move them to a sub-node section.

> + - clocks - should contain entries matching clock names in the clock-names
> +    property
> + - clock-names - should contain following entries:
> +    - "epll" - indicating the EPLL output clock
> +    - "i2s_rclk" - indicating the RCLK (root) clock of the I2S0 controller

At least the 2nd one should be in the i2s node. This node isn't really a 
h/w block, so it shouldn't have clocks IMO.

> + - samsung,audio-widgets - this property specifies off-codec audio elements
> +   like headphones or speakers, for details see widgets.txt
> + - samsung,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
> +
> +   For Odroid X2:
> +     "Headphone Jack", "Mic Jack", "DMIC"
> +
> +   For Odroid U3, XU3:
> +     "Headphone Jack", "Speakers"
> +
> +   For Odroid XU4:
> +     no entries
> +
> +Example:
> +
> +sound {
> +	compatible = "samsung,odroidxu3-audio";

> +	samsung,cpu-dai = <&i2s0>;
> +	samsung,codec-dai = <&max98090>;

Not documented. Nor needed?

> +	model = "Odroid-XU3";
> +	samsung,audio-routing =
> +		"Headphone Jack", "HPL",
> +		"Headphone Jack", "HPR",
> +		"IN1", "Mic Jack",
> +		"Mic Jack", "MICBIAS";
> +
> +	clocks = <&clock CLK_FOUT_EPLL>, <&i2s0 CLK_I2S_RCLK_SRC>;
> +	clock-names = "epll", "sclk_i2s";
> +
> +	cpu {
> +		sound-dai = <&i2s0 0>;
> +	};
> +	codec {
> +		sound-dai = <&hdmi>, <&max98090>;
> +	};
> +};
> -- 
> 1.9.1
>
On 04/28/2017 07:03 PM, Rob Herring wrote:
> On Fri, Apr 21, 2017 at 07:19:49PM +0200, Sylwester Nawrocki wrote:

>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/samsung,odroid.txt
>> @@ -0,0 +1,57 @@
>> +Samsung Exynos Odroid XU3/XU4 audio complex with MAX98090 codec
>> +
>> +Required properties:
>> +
>> + - compatible - "samsung,odroidxu3-audio" - for Odroid XU3 board,
>> +		"samsung,odroidxu4-audio" - for Odroid XU4 board
>> + - model - the user-visible name of this sound complex
>
> ASoC will support "label" soon (see graph support). Use that instead.

I could change that but it now might be too late since the patch has been
merged in v4.12-rc1. Sorry, I couldn't get back to this earlier.

>> + - clocks - should contain entries matching clock names in the clock-names
>> +    property
>> + - clock-names - should contain following entries:
>> +    - "epll" - indicating the EPLL output clock
>> +    - "i2s_rclk" - indicating the RCLK (root) clock of the I2S0 controller
>
> At least the 2nd one should be in the i2s node. This node isn't really a
> h/w block, so it shouldn't have clocks IMO.

"i2s_rclk" is a clock exposed by the I2S controller.

The RCLK clock has already assigned clock parent in DT:

&i2s0 {
	assigned-clocks = <&i2s0 CLK_I2S_RCLK_SRC>;
	assigned-clock-parents = <&clock_audss EXYNOS_SCLK_I2S>;
};

In fact the sound card is not a consumer of this clock, the clock is used
only internally in the I2S device.  I could try to drop it and use ASoC
internal API for CPU DAI clock setting.

But I have no idea what else could be done with the PLL, it belongs to
the audio card and the card driver must somehow get hold of that clock
to configure its frequency depending on audio sampling rate.

>> +Example:
>> +
>> +sound {
>> +	compatible = "samsung,odroidxu3-audio";
>
>> +	samsung,cpu-dai = <&i2s0>;
>> +	samsung,codec-dai = <&max98090>;
>
> Not documented. Nor needed?

Yes, I will remove these, that's a leftover from initial versions
of the binding.

--
Thanks,
Sylwester
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/sound/samsung,odroid.txt b/Documentation/devicetree/bindings/sound/samsung,odroid.txt
new file mode 100644
index 0000000..c1ac70c
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/samsung,odroid.txt
@@ -0,0 +1,57 @@ 
+Samsung Exynos Odroid XU3/XU4 audio complex with MAX98090 codec
+
+Required properties:
+
+ - compatible - "samsung,odroidxu3-audio" - for Odroid XU3 board,
+		"samsung,odroidxu4-audio" - for Odroid XU4 board
+ - model - the user-visible name of this sound complex
+ - '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 corresponding to the MAX98090
+    CODEC and the second entry must be the phandle of the HDMI IP block node
+ - clocks - should contain entries matching clock names in the clock-names
+    property
+ - clock-names - should contain following entries:
+    - "epll" - indicating the EPLL output clock
+    - "i2s_rclk" - indicating the RCLK (root) clock of the I2S0 controller
+ - samsung,audio-widgets - this property specifies off-codec audio elements
+   like headphones or speakers, for details see widgets.txt
+ - samsung,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
+
+   For Odroid X2:
+     "Headphone Jack", "Mic Jack", "DMIC"
+
+   For Odroid U3, XU3:
+     "Headphone Jack", "Speakers"
+
+   For Odroid XU4:
+     no entries
+
+Example:
+
+sound {
+	compatible = "samsung,odroidxu3-audio";
+	samsung,cpu-dai = <&i2s0>;
+	samsung,codec-dai = <&max98090>;
+	model = "Odroid-XU3";
+	samsung,audio-routing =
+		"Headphone Jack", "HPL",
+		"Headphone Jack", "HPR",
+		"IN1", "Mic Jack",
+		"Mic Jack", "MICBIAS";
+
+	clocks = <&clock CLK_FOUT_EPLL>, <&i2s0 CLK_I2S_RCLK_SRC>;
+	clock-names = "epll", "sclk_i2s";
+
+	cpu {
+		sound-dai = <&i2s0 0>;
+	};
+	codec {
+		sound-dai = <&hdmi>, <&max98090>;
+	};
+};