DBG_AIC3262("rk29_aic3262_init\n");
- ret = snd_soc_add_codec_controls(codec, rk29_aic326x_controls,
- ARRAY_SIZE(rk29_aic326x_controls));
-
- if (ret < 0) {
- printk("rk29_aic3262: Err snd_soc_add_codec_controls ret: %d\n", ret );
- return ret;
- }
-
- /* Add rk29 specific widgets */
- ret = snd_soc_dapm_new_controls(dapm, rk29_aic3262_dapm_widgets,
- ARRAY_SIZE(rk29_aic3262_dapm_widgets));
- if (ret)
- return ret;
-
- /* Set up rk29 specific audio path audio_map */
- snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
-
- ret = snd_soc_dapm_sync(dapm);
- if (ret)
- return ret;
-
/* Headset jack detection */
/*ret = snd_soc_jack_new(codec, "Headset Jack",
SND_JACK_HEADSET, &hs_jack);
.name = "RK_AIC3262",
.dai_link = rk29_dai,
.num_links = ARRAY_SIZE(rk29_dai),
+ .controls = rk29_aic326x_controls,
+ .num_controls = ARRAY_SIZE(rk29_aic326x_controls),
+ .dapm_widgets = rk29_aic3262_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(rk29_aic3262_dapm_widgets),
+ .dapm_routes = audio_map,
+ .num_dapm_routes = ARRAY_SIZE(audio_map),
};
static int rockchip_aic3262_audio_probe(struct platform_device *pdev)
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
- snd_soc_add_codec_controls(codec, rk_controls,
- ARRAY_SIZE(rk_controls));
-
- /* Add specific widgets */
- snd_soc_dapm_new_controls(dapm, rk_dapm_widgets,
- ARRAY_SIZE(rk_dapm_widgets));
- /* Set up specific audio path audio_mapnects */
- snd_soc_dapm_add_routes(dapm, rk_audio_map, ARRAY_SIZE(rk_audio_map));
-
mutex_lock(&dapm->card->dapm_mutex);
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
.name = "RK_RK3026",
.dai_link = rk_dai,
.num_links = 2,
+ .controls = rk_controls,
+ .num_controls = ARRAY_SIZE(rk_controls),
+ .dapm_widgets = rk_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(rk_dapm_widgets),
+ .dapm_routes = rk_audio_map,
+ .num_dapm_routes = ARRAY_SIZE(rk_audio_map),
};
static int rockchip_rk3026_audio_probe(struct platform_device *pdev)
struct snd_soc_dapm_context *dapm = &codec->dapm;
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
-#if 0
- snd_soc_add_codec_controls(codec, rk_controls,
- ARRAY_SIZE(rk_controls));
-
- /* Add specific widgets */
- snd_soc_dapm_new_controls(dapm, rk_dapm_widgets,
- ARRAY_SIZE(rk_dapm_widgets));
- /* Set up specific audio path audio_mapnects */
- snd_soc_dapm_add_routes(dapm, rk_audio_map, ARRAY_SIZE(rk_audio_map));
-
- mutex_lock(&dapm->card->dapm_mutex);
- snd_soc_dapm_enable_pin(dapm, "Mic Jack");
- snd_soc_dapm_enable_pin(dapm, "Headset Jack");
- snd_soc_dapm_enable_pin(dapm, "Ext Spk");
- snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
-
- mutex_unlock(&dapm->card->dapm_mutex);
-
- snd_soc_dapm_sync(dapm);
-#endif
return 0;
}
return false;
}
-static const struct snd_soc_dapm_widget rk_dapm_widgets[] = {
+static const struct snd_soc_dapm_widget rk_rk616_dapm_widgets[] = {
SND_SOC_DAPM_MIC("Mic Jack", NULL),
SND_SOC_DAPM_MIC("Headset Jack", NULL),
SND_SOC_DAPM_SPK("Ext Spk", NULL),
SND_SOC_DAPM_HP("Headphone Jack", NULL),
};
-static const struct snd_soc_dapm_route rk_audio_map[]={
+static const struct snd_soc_dapm_route rk_rk616_audio_map[]={
/* Mic Jack --> MIC_IN*/
{"Mic1 Bias", NULL, "Mic Jack"},
{"Headphone Jack", NULL, "HPOUTL"},
} ;
-static const struct snd_kcontrol_new rk_controls[] = {
+static const struct snd_kcontrol_new rk_rk616_controls[] = {
SOC_DAPM_PIN_SWITCH("Mic Jack"),
SOC_DAPM_PIN_SWITCH("Headset Jack"),
SOC_DAPM_PIN_SWITCH("Ext Spk"),
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
- snd_soc_add_codec_controls(codec, rk_controls,
- ARRAY_SIZE(rk_controls));
-
- /* Add specific widgets */
- snd_soc_dapm_new_controls(dapm, rk_dapm_widgets,
- ARRAY_SIZE(rk_dapm_widgets));
- /* Set up specific audio path audio_mapnects */
- snd_soc_dapm_add_routes(dapm, rk_audio_map, ARRAY_SIZE(rk_audio_map));
-
mutex_lock(&dapm->card->dapm_mutex);
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
.name = "RK_RK616",
.dai_link = rk_dai,
.num_links = 2,
+ .controls = rk_rk616_controls,
+ .num_controls = ARRAY_SIZE(rk_rk616_controls),
+ .dapm_widgets = rk_rk616_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(rk_rk616_dapm_widgets),
+ .dapm_routes = rk_rk616_audio_map,
+ .num_dapm_routes = ARRAY_SIZE(rk_rk616_audio_map),
};
/*
dts:
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
- snd_soc_add_codec_controls(codec, rockchip_rt3261_controls,
- ARRAY_SIZE(rockchip_rt3261_controls));
-
- /* Add specific widgets */
- snd_soc_dapm_new_controls(dapm, rockchip_rt3261_dapm_widgets,
- ARRAY_SIZE(rockchip_rt3261_dapm_widgets));
- /* Set up specific audio path audio_mapnects */
- snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
mutex_lock(&dapm->card->dapm_mutex);
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
.owner = THIS_MODULE,
.dai_link = rockchip_rt3261_dai,
.num_links = ARRAY_SIZE(rockchip_rt3261_dai),
+ .controls = rockchip_rt3261_controls,
+ .num_controls = ARRAY_SIZE(rockchip_rt3261_controls),
+ .dapm_widgets = rockchip_rt3261_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(rockchip_rt3261_dapm_widgets),
+ .dapm_routes = audio_map,
+ .num_dapm_routes = ARRAY_SIZE(audio_map),
};
/*
return 0;
}
-static const struct snd_soc_dapm_widget rt5631_dapm_widgets[] = {
+static const struct snd_soc_dapm_widget rk_rt5631_dapm_widgets[] = {
SND_SOC_DAPM_MIC("Mic Jack", NULL),
SND_SOC_DAPM_SPK("Ext Spk", NULL),
};
-static const struct snd_soc_dapm_route audio_map[]={
+static const struct snd_soc_dapm_route rk_rt5631_audio_map[]={
{"Headphone Jack", NULL, "HPOL"},
{"Headphone Jack", NULL, "HPOR"},
{"Ext Spk", NULL, "SPOL"},
{"MIC Bias1", NULL, "Mic Jack"},
} ;
//bard 7-5 s
-static const struct snd_kcontrol_new rk29_controls[] = {
+static const struct snd_kcontrol_new rk_rt5631_controls[] = {
SOC_DAPM_PIN_SWITCH("Mic Jack"),
SOC_DAPM_PIN_SWITCH("Ext Spk"),
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
struct snd_soc_dapm_context *dapm = &codec->dapm;
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
-//bard 7-5 s
- snd_soc_add_codec_controls(codec, rk29_controls,
- ARRAY_SIZE(rk29_controls));
-//bard 7-5 e
- /* Add specific widgets */
- snd_soc_dapm_new_controls(dapm, rt5631_dapm_widgets,
- ARRAY_SIZE(rt5631_dapm_widgets));
- /* Set up specific audio path audio_mapnects */
- snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
+
// snd_soc_dapm_nc_pin(dapm, "MONO");
// snd_soc_dapm_nc_pin(dapm, "MONOIN_RXN");
// snd_soc_dapm_nc_pin(dapm, "MONOIN_RXP");
.name = "RK_RT5631",
.dai_link = rk29_dai,
.num_links = 2,
+ .controls = rk_rt5631_controls,
+ .num_controls = ARRAY_SIZE(rk_rt5631_controls),
+ .dapm_widgets = rk_rt5631_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(rk_rt5631_dapm_widgets),
+ .dapm_routes = rk_rt5631_audio_map,
+ .num_dapm_routes = ARRAY_SIZE(rk_rt5631_audio_map),
};
static int rockchip_rt5631_audio_probe(struct platform_device *pdev)
return 0;
}
-static const struct snd_soc_dapm_widget rt5640_dapm_widgets[] = {
+static const struct snd_soc_dapm_widget rk_rt5640_dapm_widgets[] = {
SND_SOC_DAPM_MIC("Mic Jack", NULL),
SND_SOC_DAPM_MIC("Headset Jack", NULL),
SND_SOC_DAPM_SPK("Ext Spk", NULL),
SND_SOC_DAPM_HP("Headphone Jack", NULL),
};
-static const struct snd_soc_dapm_route audio_map[]={
+static const struct snd_soc_dapm_route rk_rt5640_audio_map[]={
/* Mic Jack --> MIC_IN*/
{"micbias1", NULL, "Mic Jack"},
{"Headphone Jack", NULL, "HPOR"},
} ;
-static const struct snd_kcontrol_new rk_controls[] = {
+static const struct snd_kcontrol_new rk_rt5640_controls[] = {
SOC_DAPM_PIN_SWITCH("Mic Jack"),
SOC_DAPM_PIN_SWITCH("Headset Jack"),
SOC_DAPM_PIN_SWITCH("Ext Spk"),
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
- snd_soc_add_codec_controls(codec, rk_controls,
- ARRAY_SIZE(rk_controls));
-
- /* Add specific widgets */
- snd_soc_dapm_new_controls(dapm, rt5640_dapm_widgets,
- ARRAY_SIZE(rt5640_dapm_widgets));
- /* Set up specific audio path audio_mapnects */
- snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
-
mutex_lock(&dapm->card->dapm_mutex);
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
.name = "RK_RT5640",
.dai_link = rk29_dai,
.num_links = 2,
+ .controls = rk_rt5640_controls,
+ .num_controls = ARRAY_SIZE(rk_rt5640_controls),
+ .dapm_widgets = rk_rt5640_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(rk_rt5640_dapm_widgets),
+ .dapm_routes = rk_rt5640_audio_map,
+ .num_dapm_routes = ARRAY_SIZE(rk_rt5640_audio_map),
};
static int rockchip_rt5640_audio_probe(struct platform_device *pdev)