Skip to contentSkip to conversation

ASoC: simple-card: remove snd_link and snd_card from struct asoc_xx_info

PATCH In review Xiubo Li 2 participants 3 messages Jan 10, 2014 – Jan 13, 2014

Subsystems (3)
lore
Share & tools
lore

Xiubo Li

author
#0 lore raw

PATCH 1/1 ASoC: simple-card: remove snd_link and snd_card from struct asoc_xx_info

Whether the dt is used or not, almost all the simple card information for the DAI link and sound card are initialized in the simple card driver.

And for the platform caller, the snd_link and snd_card are of no use, so remove it from struct asoc_simple_card_info, and let them to be the simple card driver's global data.

This is also fix one bug about writing to the platform data directly, for it should be constant.

And now only one DAI link is supported for simple card.

---

This patch maybe not very perfect, such as supporting many DAI links, etc. And there still need followed patches to fulfil these.

 include/sound/simple_card.h     |  4 ---
 sound/soc/generic/simple-card.c | 54 +++++++++++++++++++++++------------------
 2 files changed, 30 insertions(+), 28 deletions(-)
include/sound/simple_card.h +0 -4
index 6c74527..e1ac996 100644
@@ -29,10 +29,6 @@ struct asoc_simple_card_info {
 	unsigned int daifmt;
 	struct asoc_simple_dai cpu_dai;
 	struct asoc_simple_dai codec_dai;
-
-	/* used in simple-card.c */
-	struct snd_soc_dai_link snd_link;
-	struct snd_soc_card snd_card;
 };
 
 #endif /* __SIMPLE_CARD_H */
sound/soc/generic/simple-card.c +30 -24

101 lines not on this page · raw message

Signature · 1 line
1.8.4
#1 lore raw
Quoted 10 lines · On Fri, 10 Jan 2014 20:55:57 +0800 Xiubo Li <[email protected]> wrote:

Whether the dt is used or not, almost all the simple card information for the DAI link and sound card are initialized in the simple card driver.

And for the platform caller, the snd_link and snd_card are of no use, so remove it from struct asoc_simple_card_info, and let them to be the simple card driver's global data.

This is also fix one bug about writing to the platform data directly, for it should be constant.

Quoted 7 lines

And now only one DAI link is supported for simple card.

---

This patch maybe not very perfect, such as supporting many DAI links, etc. And there still need followed patches to fulfil these.

	[snip]

Xiubo,

I don't agree your code: you should not use the cinfo anymore, but rather move the information it contains to the sound card structure.

Then, you use a static variable as the card structure. It is not possible to extend this table to handle many DAI links, and, as not re-entrant, the driver cannot create many sound cards.

Signature · 6 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#2 lore raw
Quoted 8 lines

I don't agree your code: you should not use the cinfo anymore, but rather move the information it contains to the sound card structure.

Then, you use a static variable as the card structure. It is not possible to extend this table to handle many DAI links, and, as not re-entrant, the driver cannot create many sound cards.

Yes, that's right.

Thanks,

--
Best Regards,
Xiubo