summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorBard liao <yung-chuan.liao@linux.intel.com>2019-03-13 09:49:43 -0400
committerMark Brown <broonie@kernel.org>2019-03-15 12:27:14 -0400
commit3789debfc379ac84b90e2db32d7a6b66d28a2c7c (patch)
treea0aa06fdf093f5cbc335bfba0276bf64c84d3b7a /sound
parent20b83421e8eea43e28cb7aeea3e3f865f86aa69d (diff)
ASoC: topology: create tlv before soc_tplg_init_kcontrol
Component driver may want to use tlv data. Create tlv before soc_tplg_init_kcontrol so component driver can use the tlv data in the control_load ops. Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-topology.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 25fca7055464..fbee4720b834 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -894,19 +894,20 @@ static int soc_tplg_dmixer_create(struct soc_tplg *tplg, unsigned int count,
894 continue; 894 continue;
895 } 895 }
896 896
897 /* create any TLV data */
898 soc_tplg_create_tlv(tplg, &kc, &mc->hdr);
899
897 /* pass control to driver for optional further init */ 900 /* pass control to driver for optional further init */
898 err = soc_tplg_init_kcontrol(tplg, &kc, 901 err = soc_tplg_init_kcontrol(tplg, &kc,
899 (struct snd_soc_tplg_ctl_hdr *) mc); 902 (struct snd_soc_tplg_ctl_hdr *) mc);
900 if (err < 0) { 903 if (err < 0) {
901 dev_err(tplg->dev, "ASoC: failed to init %s\n", 904 dev_err(tplg->dev, "ASoC: failed to init %s\n",
902 mc->hdr.name); 905 mc->hdr.name);
906 soc_tplg_free_tlv(tplg, &kc);
903 kfree(sm); 907 kfree(sm);
904 continue; 908 continue;
905 } 909 }
906 910
907 /* create any TLV data */
908 soc_tplg_create_tlv(tplg, &kc, &mc->hdr);
909
910 /* register control here */ 911 /* register control here */
911 err = soc_tplg_add_kcontrol(tplg, &kc, 912 err = soc_tplg_add_kcontrol(tplg, &kc,
912 &sm->dobj.control.kcontrol); 913 &sm->dobj.control.kcontrol);
@@ -1324,18 +1325,19 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(
1324 continue; 1325 continue;
1325 } 1326 }
1326 1327
1328 /* create any TLV data */
1329 soc_tplg_create_tlv(tplg, &kc[i], &mc->hdr);
1330
1327 /* pass control to driver for optional further init */ 1331 /* pass control to driver for optional further init */
1328 err = soc_tplg_init_kcontrol(tplg, &kc[i], 1332 err = soc_tplg_init_kcontrol(tplg, &kc[i],
1329 (struct snd_soc_tplg_ctl_hdr *)mc); 1333 (struct snd_soc_tplg_ctl_hdr *)mc);
1330 if (err < 0) { 1334 if (err < 0) {
1331 dev_err(tplg->dev, "ASoC: failed to init %s\n", 1335 dev_err(tplg->dev, "ASoC: failed to init %s\n",
1332 mc->hdr.name); 1336 mc->hdr.name);
1337 soc_tplg_free_tlv(tplg, &kc[i]);
1333 kfree(sm); 1338 kfree(sm);
1334 continue; 1339 continue;
1335 } 1340 }
1336
1337 /* create any TLV data */
1338 soc_tplg_create_tlv(tplg, &kc[i], &mc->hdr);
1339 } 1341 }
1340 return kc; 1342 return kc;
1341 1343