struct snd_soc_pcm_runtime *rtd = w->priv;
/* create control for links with > 1 config */
- if (rtd->dai_link->num_params <= 1)
+ if (rtd->dai_link->num_c2c_params <= 1)
return 0;
/* add kcontrol */
* either party on the link to alter the configuration if
* necessary
*/
- config = rtd->dai_link->params + rtd->params_select;
+ config = rtd->dai_link->c2c_params + rtd->c2c_params_select;
if (!config) {
dev_err(w->dapm->dev, "ASoC: link config missing\n");
ret = -EINVAL;
struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol);
struct snd_soc_pcm_runtime *rtd = w->priv;
- ucontrol->value.enumerated.item[0] = rtd->params_select;
+ ucontrol->value.enumerated.item[0] = rtd->c2c_params_select;
return 0;
}
if (w->power)
return -EBUSY;
- if (ucontrol->value.enumerated.item[0] == rtd->params_select)
+ if (ucontrol->value.enumerated.item[0] == rtd->c2c_params_select)
return 0;
- if (ucontrol->value.enumerated.item[0] >= rtd->dai_link->num_params)
+ if (ucontrol->value.enumerated.item[0] >= rtd->dai_link->num_c2c_params)
return -EINVAL;
- rtd->params_select = ucontrol->value.enumerated.item[0];
+ rtd->c2c_params_select = ucontrol->value.enumerated.item[0];
return 1;
}
static void
snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
unsigned long *private_value,
- int num_params,
+ int num_c2c_params,
const char **w_param_text)
{
int count;
if (!w_param_text)
return;
- for (count = 0 ; count < num_params; count++)
+ for (count = 0 ; count < num_c2c_params; count++)
devm_kfree(card->dev, (void *)w_param_text[count]);
devm_kfree(card->dev, w_param_text);
}
static struct snd_kcontrol_new *
snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card,
char *link_name,
- const struct snd_soc_pcm_stream *params,
- int num_params, const char **w_param_text,
+ const struct snd_soc_pcm_stream *c2c_params,
+ int num_c2c_params, const char **w_param_text,
unsigned long *private_value)
{
struct soc_enum w_param_enum[] = {
snd_soc_dapm_dai_link_put),
};
struct snd_kcontrol_new *kcontrol_news;
- const struct snd_soc_pcm_stream *config = params;
+ const struct snd_soc_pcm_stream *config = c2c_params;
int count;
- for (count = 0 ; count < num_params; count++) {
+ for (count = 0 ; count < num_c2c_params; count++) {
if (!config->stream_name) {
dev_warn(card->dapm.dev,
"ASoC: anonymous config %d for dai link %s\n",
config++;
}
- w_param_enum[0].items = num_params;
+ w_param_enum[0].items = num_c2c_params;
w_param_enum[0].texts = w_param_text;
*private_value =
return kcontrol_news;
outfree_w_param:
- snd_soc_dapm_free_kcontrol(card, private_value, num_params, w_param_text);
+ snd_soc_dapm_free_kcontrol(card, private_value, num_c2c_params, w_param_text);
return NULL;
}
w_param_text = NULL;
kcontrol_news = NULL;
num_kcontrols = 0;
- if (rtd->dai_link->num_params > 1) {
+ if (rtd->dai_link->num_c2c_params > 1) {
w_param_text = devm_kcalloc(card->dev,
- rtd->dai_link->num_params,
+ rtd->dai_link->num_c2c_params,
sizeof(char *), GFP_KERNEL);
if (!w_param_text)
goto param_fail;
num_kcontrols = 1;
kcontrol_news = snd_soc_dapm_alloc_kcontrol(card, link_name,
- rtd->dai_link->params,
- rtd->dai_link->num_params,
+ rtd->dai_link->c2c_params,
+ rtd->dai_link->num_c2c_params,
w_param_text, &private_value);
if (!kcontrol_news)
goto param_fail;
outfree_kcontrol_news:
devm_kfree(card->dev, (void *)template.kcontrol_news);
snd_soc_dapm_free_kcontrol(card, &private_value,
- rtd->dai_link->num_params, w_param_text);
+ rtd->dai_link->num_c2c_params, w_param_text);
param_fail:
devm_kfree(card->dev, link_name);
name_fail:
struct snd_pcm_str *streams = rtd->pcm->streams;
int stream;
- if (dai_link->params) {
+ if (dai_link->c2c_params) {
playback_cpu = snd_soc_dai_get_widget_capture(cpu_dai);
capture_cpu = snd_soc_dai_get_widget_playback(cpu_dai);
} else {
codec = snd_soc_dai_get_widget(codec_dai, stream);
if (playback_cpu && codec) {
- if (dai_link->params && !rtd->c2c_widget[stream]) {
+ if (dai_link->c2c_params && !rtd->c2c_widget[stream]) {
substream = streams[stream].substream;
dai = snd_soc_dapm_new_dai(card, substream, "playback");
if (IS_ERR(dai))
codec = snd_soc_dai_get_widget(codec_dai, stream);
if (codec && capture_cpu) {
- if (dai_link->params && !rtd->c2c_widget[stream]) {
+ if (dai_link->c2c_params && !rtd->c2c_widget[stream]) {
substream = streams[stream].substream;
dai = snd_soc_dapm_new_dai(card, substream, "capture");
if (IS_ERR(dai))
struct snd_soc_dai *codec_dai;
/* Adapt stream for codec2codec links */
- int cpu_capture = rtd->dai_link->params ?
+ int cpu_capture = rtd->dai_link->c2c_params ?
SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE;
- int cpu_playback = rtd->dai_link->params ?
+ int cpu_playback = rtd->dai_link->c2c_params ?
SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
for_each_rtd_codec_dais(rtd, i, codec_dai) {
int ret;
/* create the PCM */
- if (rtd->dai_link->params) {
+ if (rtd->dai_link->c2c_params) {
snprintf(new_name, sizeof(new_name), "codec2codec(%s)",
rtd->dai_link->stream_name);
* don't interface with the outside world or application layer
* we don't have to do any special handling on close.
*/
- if (!rtd->dai_link->params)
+ if (!rtd->dai_link->c2c_params)
rtd->close_delayed_work_func = snd_soc_close_delayed_work;
rtd->pcm = pcm;
pcm->private_data = rtd;
pcm->no_device_suspend = true;
- if (rtd->dai_link->no_pcm || rtd->dai_link->params) {
+ if (rtd->dai_link->no_pcm || rtd->dai_link->c2c_params) {
if (playback)
pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
if (capture)