On 12/05/2012 12:55 AM, Kuninori Morimoto wrote:
Hi Stephen Cc Mark
Thank you for your reply
- ret |= __snd_soc_of_parse_daifmt(np, prefix, fmt,
"i2s", SND_SOC_DAIFMT_I2S);
- ret |= __snd_soc_of_parse_daifmt(np, prefix, fmt,
"right_j", SND_SOC_DAIFMT_RIGHT_J);
- ret |= __snd_soc_of_parse_daifmt(np, prefix, fmt,
"left_j", SND_SOC_DAIFMT_LEFT_J);
- ret |= __snd_soc_of_parse_daifmt(np, prefix, fmt,
"dsp_a", SND_SOC_DAIFMT_DSP_A);
- ret |= __snd_soc_of_parse_daifmt(np, prefix, fmt,
"dsp_b", SND_SOC_DAIFMT_DSP_B);
I'd expect to see something more like:
fmt = of_property_read_u32_array(np, "bit-format");
Ahh... I see.
Well, once a DT binding is created, you can't change the numbers, or you would break the ability for an old DT to work with a newer kernel.
OK. I understand.
How about to use string ?
snd.soc.daifmt.format = "left_j" snd.soc.daifmt.clock_gate = "cont" snd.soc.daifmt.inversion = "ib_nf" snd.soc.daifmt.hw_clock = "cbs_cfm"
That's probably the best we can do for now. Using a pre-processor would be best:
#define SND_SOC_DAIFMT_LEFT_J 3
snd.soc.daifmt.format = <SND_SOC_DAIFMT_LEFT_J>;
... but we can't do that yet...
Thank you.
I tried v2 of snd_soc_of_parse_daifmt() which is using "string" and "array" style
[prefix]snd,soc,daifmt = "i2c", "nb_if", "cbm_cfm";
I assume you mean i2s not i2c there.
That seems to be overloading one property so that it contains a lot of separate data items. I'd expect separate properties for the format, the bitclock inversion, the frame inversion, the bitclock master, and the frame master.