[alsa-devel] [RFC][PATCH 1/2] ASoC: add snd_soc_of_parse_daifmt()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Fri Nov 30 01:35:30 CET 2012


Hi Stephen

> I think it'd be more typical to represent as a single integer property,
> where the value is an enumeration indicating the type.

Sorry, I couldn't understand correctly this.
Do you mean like this ?

  snd.soc.daifmt.format      = <3> /* SND_SOC_DAIFMT_LEFT_J */
  snd.soc.daifmt.clock_gate  = <1> /* SND_SOC_DAIFMT_CONT */
  snd.soc.daifmt.inversion   = <3> /* SND_SOC_DAIFMT_IB_NF */
  snd.soc.daifmt.hw_clock    = <2> /* SND_SOC_DAIFMT_CBS_CFM */

I added SND_SOC_DAIFMT_xxx here,
but this style is not readable/understandable for me.
And it is difficult to keep compatible if the number was changed.
(never happen ? I'm not sure)

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"

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list