[alsa-devel] [PATCH 3/3 v5] ASoC: simple-card: add Device Tree support

Stephen Warren swarren at wwwdotorg.org
Thu Feb 14 00:30:33 CET 2013


On 02/11/2013 09:48 PM, Kuninori Morimoto wrote:
> 
> Hi Stephen
> 
>>> +sound {
>>> +	compatible = "simple-audio";
>> ...
>>> +	simple-audio,codec,dai = <&ak4648 0>;
>> ...
>>> +sh_fsi2: sh_fsi2 at 0xec230000 {
>>> +	compatible = "renesas,sh_fsi2";
>>> +	reg = <0xec230000 0x400>;
>>> +	interrupt-parent = <&gic>;
>>> +	interrupts = <0 146 0x4>;
>>> +};
>>
>> Note that the DT binding documentation for renesas,sh_fsi2 needs to define:
>>
>> a) The value of the #sound-dai-cells property that's missing from the
>> sh_fsi2 node.
>>
>> b) The legal values for the "0" in the "simple-audio,codec,dai" property
>> in the "sound" node above, and which DAI on the device each value
>> represents.
> 
> Sorry, I couldn't understand this.
> Do you mean like this ?
> 
> This example is assuming like this, and shows FSI-ak4642 sound
> 
> FSI port A -- ak4642
>     port B -- HDMI
> 
> sh_fsi2 has #sound-dai-cells, and ak4642 doesn't have it.
> Does this solved a) ?

There should be a file in Documentation/devicetree/bindings that
describes how to create a "renesas,sh_fsi2" node. The document should
specify what value that node's #sound-dai-cells property must contain.

> Do you mean sh_fsi2 needs something like "port-a = xxx" settings for b) ??

The binding documentation must specify what values go into the "DAI
specifier" DT cells. Something like:

Required properties:
- #sound-dai-cells Integer, must be 1.
  Valid values for the DAI specifier are:
  0: FSI port A
  1: FSI port B

> sound {
> 	compatible = "simple-audio";
> 
> 	simple-audio,card-name = "FSI2A-AK4648";
> 	simple-audio,format = "left_j";
> 	simple-audio,cpu,dai = <&sh_fsi2 0>;
> 	simple-audio,codec,dai = <&ak4648>;
> 	simple-audio,codec,bitclock-master;
> 	simple-audio,codec,frame-master;
> 	simple-audio,codec,system-clock-frequency = <11289600>;
> };
> 
> &i2c0 {
> 	ak4648: ak4648 at 0x12 {
> 		compatible = "asahi-kasei,ak4648";
> 		reg = <0x12>;

There should be a #sound-dai-cells property in this node too, since it
needs to be linked into the sound node.

Does this HW only have a single DAI? If so, the value of
#sound-dai-cells can be 0, since there's no need to distinguish between
different DAIs.

> 	};
> };
> 
> sh_fsi2: sh_fsi2 at 0xec230000 {
> 	#sound-dai-cells = <2>;

Shouldn't that be 1? This is specifying the number of cells that appear
after the phandle in the simple-audio,cpu,dai property above, not the
number of valid values that you could put into the cell.

> 	compatible = "renesas,sh_fsi2";
> 	reg = <0xec230000 0x400>;
> 	interrupt-parent = <&gic>;
> 	interrupts = <0 146 0x4>;
> };



More information about the Alsa-devel mailing list