Skip to contentSkip to conversation

ASoC: dapm: Avoid creating kcontrol for params

PATCH Superseded anish kumar 1 participant 2 messages Aug 26, 2017 – Sep 7, 2017

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover ASoC: dapm: Avoid creating kcontrol for params

Currently in codec to codec dai link if there are multiple params defined then dapm can use created kcontrol to decide which param to apply at runtime.

However, in case there is only single param configuration then there is no point in creating the kcontrol and also there is no point in allocating memory for kcontrol.

In the snd_soc_dapm_new_pcm function, there is memory allocation happening for kcontrol which is later used or not used based on num_param. It is better to not allocate memory when there is only a single configuration. This change is to remedy that anomaly.

This code change doesn't do much except just refactor snd_soc_dapm_new_pcm function. Now the part of allocating memory for kcontrol is allocated to a new function and it is called only in the case it is needed.

anish kumar (4):
ASoC: dapm: fix error path in snd_soc_dapm_new_pcm
ASoC: dapm: Refactor the code in snd_soc_dapm_new_pcm
ASoC: dapm: Avoid creating kcontrol for params
ASoC: dapm: Remove the redundant check

 sound/soc/soc-dapm.c | 123 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 67 insertions(+), 56 deletions(-)
Signature · 1 line
2.10.1 (Apple Git-78)
#1 lore raw

Ping.......

Quoted 14 lines · anish kumar

Currently in codec to codec dai link if there are multiple params defined then dapm can use created kcontrol to decide which param to apply at runtime.

However, in case there is only single param configuration then there is no point in creating the kcontrol and also there is no point in allocating memory for kcontrol.

In the snd_soc_dapm_new_pcm function, there is memory allocation happening for kcontrol which is later used or not used based on num_param. It is better to not allocate memory when there is only a single configuration. This change is to remedy that anomaly.

Quoted 7 lines

This code change doesn't do much except just refactor snd_soc_dapm_new_pcm function. Now the part of allocating memory for kcontrol is allocated to a new function and it is called only in the case it is needed.

anish kumar (4):
ASoC: dapm: fix error path in snd_soc_dapm_new_pcm

Below 3 patches are still not reviewed.

Quoted 12 lines

ASoC: dapm: Refactor the code in snd_soc_dapm_new_pcm
ASoC: dapm: Avoid creating kcontrol for params
ASoC: dapm: Remove the redundant check

 sound/soc/soc-dapm.c | 123 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 67 insertions(+), 56 deletions(-)

--
2.10.1 (Apple Git-78)