diff mbox

[1/2] ASoC: cygnus-audio: adding device tree bindings

Message ID 1427771784-29950-2-git-send-email-sbranden@broadcom.com
State New, archived
Headers show

Commit Message

Scott Branden March 31, 2015, 3:16 a.m. UTC
From: Lori Hikichi <lhikichi@broadcom.com>

Add device tree binding documentation for the Cygnus SOC audio block

Reviewed-by: Jonathan Richardson <jonathar@broadcom.com>
Reviewed-by: Ray Jui <rjui@broadcom.com>
Signed-off-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Lori Hikichi <lhikichi@broadcom.com>
---
 .../bindings/sound/brcm,cygnus-audio.txt           | 68 ++++++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/brcm,cygnus-audio.txt

Comments

Mark Brown March 31, 2015, 5:58 a.m. UTC | #1
On Mon, Mar 30, 2015 at 08:16:23PM -0700, Scott Branden wrote:

> +SSP Subnode properties:
> +- dai-name: The name of the DAI registered with ASOC

ASoC.

Why is this in the DT - it sounds like this is just an internal
implementation detail for Linux, not a property of the hardware.

> +- mode: Controls if this port should be configured as I2S or TDM mode.
> +	Valid values are: "tdm" or "i2s"
> +- tdm-bits-per-frame:  only if mode is "tdm" then this property must set.
> +	Valid values are (128/256/512)

We'd normally leave these up to the machine driver to set as they're
link wide things for system integration.  The bits per frame in
particular looks like something that's not going to be fixed by the
hardware and could be varied at runtime.

> +- port-status: Controls if port is enabled or not
> +	Valid values "enabled" or "disabled"

This sounds like it's replicating the DT standard status property?

> +- channel-group: Control grouping of serial port
> +	Valid values are "2_0", "3_1", or "5_1"

What does this mean?  It looks like it's setting the number of channels
which again seems like a runtime thing.
Mark Brown March 31, 2015, 7 a.m. UTC | #2
On Mon, Mar 30, 2015 at 08:16:23PM -0700, Scott Branden wrote:

> +Required properties:
> +	- compatible : "brcm,cygnus-audio"
> +	- #address-cells: 32bit valued, 1 cell. <1>
> +	- #size-cells:  32bit valued, 1 cell. <1>
> +	- reg : Should contain audio registers location and length
> +	- interrupts: audio DMA interrupt number
> +
> +SSP Subnode properties:

This document does rather gloss over the fact that the binding requires
subnodes, it should mention this requirement and say what they mean.
Lars-Peter Clausen March 31, 2015, 7:26 a.m. UTC | #3
On 03/31/2015 05:16 AM, Scott Branden wrote:
[...]
> +- ssp-port-id: The ssp port interface to use
> +	Valid value are 0, 1, 2, or 3 (for spdif)

How about using 'reg' as the property name here. It is the standard property 
name for identifying or assigning an address to a sub-node.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lori Hikichi April 2, 2015, 6:47 p.m. UTC | #4
On 15-03-30 10:58 PM, Mark Brown wrote:
> On Mon, Mar 30, 2015 at 08:16:23PM -0700, Scott Branden wrote:
>
>> +SSP Subnode properties:
>> +- dai-name: The name of the DAI registered with ASOC
>
> ASoC.
>
Okay.

> Why is this in the DT - it sounds like this is just an internal
> implementation detail for Linux, not a property of the hardware.
>
Will move into the driver code.

>> +- mode: Controls if this port should be configured as I2S or TDM mode.
>> +	Valid values are: "tdm" or "i2s"
>> +- tdm-bits-per-frame:  only if mode is "tdm" then this property must set.
>> +	Valid values are (128/256/512)
>
> We'd normally leave these up to the machine driver to set as they're
> link wide things for system integration.  The bits per frame in
> particular looks like something that's not going to be fixed by the
> hardware and could be varied at runtime.
>
I was using the device tree to set some board specific properties of our 
audio serial port driver. The idea was that these properties would only 
need to be one value for a specific board.  Therefore, we could set them 
in the device tree and then not have to set them in the
machine file. I thought it would help keep the machine file
a little more basic.  Moving these to the machine file is reasonable and 
will allow for a more dynamic usage of our driver.  I will move them to 
machine file.

>> +- port-status: Controls if port is enabled or not
>> +	Valid values "enabled" or "disabled"
>
> This sounds like it's replicating the DT standard status property?
>
Okay. Will replace with "status"

>> +- channel-group: Control grouping of serial port
>> +	Valid values are "2_0", "3_1", or "5_1"
>
> What does this mean?  It looks like it's setting the number of channels
> which again seems like a runtime thing.
>
It is a configuration where we can link together two or three of the 
ports to allow for synchronized starts and stop. I will look into 
another method of configuring this operational mode.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lori Hikichi April 2, 2015, 10:44 p.m. UTC | #5
On 15-03-31 12:26 AM, Lars-Peter Clausen wrote:
> On 03/31/2015 05:16 AM, Scott Branden wrote:
> [...]
>> +- ssp-port-id: The ssp port interface to use
>> +    Valid value are 0, 1, 2, or 3 (for spdif)
>
> How about using 'reg' as the property name here. It is the standard
> property name for identifying or assigning an address to a sub-node.
>
Okay.  Thanks.  I will change.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/sound/brcm,cygnus-audio.txt b/Documentation/devicetree/bindings/sound/brcm,cygnus-audio.txt
new file mode 100644
index 0000000..5358cc3
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/brcm,cygnus-audio.txt
@@ -0,0 +1,68 @@ 
+BROADCOM Cygnus Audio I2S/TDM/SPDIF controller
+
+Required properties:
+	- compatible : "brcm,cygnus-audio"
+	- #address-cells: 32bit valued, 1 cell. <1>
+	- #size-cells:  32bit valued, 1 cell. <1>
+	- reg : Should contain audio registers location and length
+	- interrupts: audio DMA interrupt number
+
+SSP Subnode properties:
+- dai-name: The name of the DAI registered with ASOC
+- ssp-port-id: The ssp port interface to use
+	Valid value are 0, 1, 2, or 3 (for spdif)
+- mode: Controls if this port should be configured as I2S or TDM mode.
+	Valid values are: "tdm" or "i2s"
+- tdm-bits-per-frame:  only if mode is "tdm" then this property must set.
+	Valid values are (128/256/512)
+- port-status: Controls if port is enabled or not
+	Valid values "enabled" or "disabled"
+- channel-group: Control grouping of serial port
+	Valid values are "2_0", "3_1", or "5_1"
+
+Example:
+	cygnus_audio: audio@0x180ae000 {
+		compatible = "brcm,cygnus-audio";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x180ae000 0x1000>;
+
+		interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+
+		ssp0: ssp_port@0 {
+			dai-name = "cygnus-ssp0";
+			ssp-port-id = <0>;
+
+			mode = "i2s"; /* "i2s" or "tdm" */
+			channel-group = "2_0"; /* Use 2_0, 3_1, 5_1 */
+			port-status = "enabled";
+		};
+
+		ssp1: ssp_port@1 {
+			dai-name = "cygnus-ssp1";
+			ssp-port-id = <1>;
+
+			mode = "i2s"; /* "i2s" or "tdm" */
+			channel-group = "2_0"; /* Use 2_0, 3_1, 5_1 */
+			port-status = "disabled";
+		};
+
+		ssp2: ssp_port@2 {
+			dai-name = "cygnus-ssp2";
+			ssp-port-id = <2>;
+
+			mode = "tdm"; /* "i2s" or "tdm" */
+			tdm-bits-per-frame = <256>;
+			channel-group = "2_0"; /* Use 2_0, 3_1, 5_1 */
+			port-status = "disabled";
+		};
+
+		spdif: spdif_port@3 {
+			dai-name = "cygnus-spdif";
+			ssp-port-id = <3>;
+
+			mode = "i2s"; /* "i2s" or "tdm" */
+			channel-group = "2_0"; /* Use 2_0, 3_1, 5_1 */
+			port-status = "disabled";
+		};
+	};