Message ID | 1427771784-29950-2-git-send-email-sbranden@broadcom.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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.
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.
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.
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.
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.
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"; + }; + };