On 03/10/2014 01:09 PM, Mark Brown wrote:
On Mon, Mar 10, 2014 at 12:49:56PM +0200, Jyri Sarha wrote:
On 03/09/2014 10:11 AM, Mark Brown wrote:
No, it shouldn't do any inversion. If inversion is required one of the drivers is buggy, they are CODEC bit master and CPU bit master so for a CPU driver the sense should be inverted when parsing.
Yes, that is the problem. The same code in simple-card parses the codec node and cpu-dai node and they produce the same SND_SOC_DAIFMT_C??_C?? flags for both codec and cpu-dai drivers.
Sorry, thinko above - the master flags are specified in terms of the CODEC. Anything interpreting them that isn't a CODEC needs to be inverting the sense.
Exactly, CBM_CFM means that the codec is the master of both clocks. Codec is configured as master and the cpu side is configured as slave.
But the issue is that with simple card (when you want to have the codec as master for both clocks):
simple-audio-card,codec { sound-dai = <&aic3106>; bitclock-master; frame-master; };
simple-audio-card,cpu { sound-dai = <&mcasp1 0>; };
The codec will get CBM_CFM, however the cpu_dai will end up having CBS_CFS (since *-master is not specified in the dts).
So when the simple card parses the master/slave configuration it has to invert the cpu_dai settings it got back from snd_soc_of_parse_daifmt() to get it right.
Since:
simple-audio-card,codec { sound-dai = <&aic3106>; };
simple-audio-card,cpu { sound-dai = <&mcasp1 0>; bitclock-master; frame-master; };
Will end up as: codec is CBS_CFS and cpu_dai as CBM_CFM which means that both cpu and codec is supposed to be slave...