[alsa-devel] snd_soc_dai_link.init()

Timur Tabi timur at freescale.com
Thu May 31 00:34:29 CEST 2007


Why does the init() function pointer in the snd_soc_dai_link structure take a 
snd_soc_codec pointer?  Wouldn't it make more sense for it to take a snd_soc_dai_link 
pointer?  That way, I could use the init() function to initialize the structure.

I'm trying to write a function that will initialize the codec_dai pointer.  I thought I 
could use snd_soc_dai_link.init(), but I don't know how to get the pointer to the 
snd_soc_dai_link structure from a snd_soc_codec structure.

/* SoC machine DAI configuration, glues a codec and cpu DAI together */
struct snd_soc_dai_link  {
	char *name;			/* Codec name */
	char *stream_name;		/* Stream name */

	/* DAI */
	struct snd_soc_codec_dai *codec_dai;
	struct snd_soc_cpu_dai *cpu_dai;

	/* machine stream operations */
	struct snd_soc_ops *ops;

	/* codec/machine specific init - e.g. add machine controls */
	int (*init)(struct snd_soc_codec *codec);

Timur Tabi
Linux Kernel Developer @ Freescale

More information about the Alsa-devel mailing list