On 03/24/2014 02:05 AM, Kuninori Morimoto wrote:
Hi Jyri
The properties like format, bitclock-master, frame-master, bitclock-inversion, and frame-inversion should be common to the dais connected with a dai-link. For bitclock-master and frame-master properties to be unambiguous they need to indicate the mastering dai node with a phandle.
Signed-off-by: Jyri Sarha jsarha@ti.com
(snip)
/*
* bitclock-inversion, frame-inversion
* bitclock-master, frame-master
* and specific "format" if it has
*/
- dai->fmt = snd_soc_of_parse_daifmt(np, NULL);
- dai->fmt |= daifmt;
- /*
- dai->sysclk come from
- "clocks = <&xxx>" (if system has common clock)
- or "system-clock-frequency = <xxx>"
[1/2] patch exchanged snd_soc_of_parse_daifmt() parameter, but, user code exchanged in [2/2]. It breaks git-bisect.
Fixed that. Thanks!
- dai_props->cpu_dai.fmt = daifmt;
- switch (((np == bitclkmaster)<<4)|(np == framemaster)) {
- case 0x11:
dai_props->cpu_dai.fmt |= SND_SOC_DAIFMT_CBS_CFS;
break;
- case 0x10:
dai_props->cpu_dai.fmt |= SND_SOC_DAIFMT_CBS_CFM;
break;
- case 0x01:
dai_props->cpu_dai.fmt |= SND_SOC_DAIFMT_CBM_CFS;
break;
- default:
dai_props->cpu_dai.fmt |= SND_SOC_DAIFMT_CBM_CFM;
break;
- }
The user of snd_soc_of_parse_daifmt() is only simple-card (?) I think SND_SOC_DAIFMT_CBxx_CFx cared by snd_soc_of_parse_daifmt() somehow is very reasonable.
Yes, that is what git grep tells me. snd_soc_of_parse_daifmt() can still take care of SND_SOC_DAIFMT_CB?_CF? parsing in simple cases. I just felt that adding the full phandle parsing to the function would break its genericity and make the function parameters hard to understand.
Best regards, Jyri