};
-struct snd_soc_dai_driver cs42888_dai = {
+struct snd_soc_dai_driver cs42888_dai[] = {
+ {
.name = "CS42888",
.playback = {
.stream_name = "Playback",
.formats = CS42888_FORMATS,
},
.ops = &cs42888_dai_ops,
+ },
+ {
+ .name = "CS42888_ASRC",
+ .playback = {
+ .stream_name = "Playback",
+ .channels_min = 1,
+ .channels_max = 8,
+ .rates = SNDRV_PCM_RATE_8000_192000,
+ .formats = CS42888_FORMATS,
+ },
+ .ops = &cs42888_dai_ops,
+ },
};
/**
if (i2c_client->dev.platform_data) {
memcpy(&cs42888->pdata, i2c_client->dev.platform_data,
sizeof(cs42888->pdata));
- cs42888_dai.playback.rates = cs42888->pdata.rates;
- cs42888_dai.capture.rates = cs42888->pdata.rates;
+ cs42888_dai[0].playback.rates = cs42888->pdata.rates;
+ cs42888_dai[0].capture.rates = cs42888->pdata.rates;
}
i2c_set_clientdata(i2c_client, cs42888);
ret = snd_soc_register_codec(&i2c_client->dev,
- &cs42888_driver, &cs42888_dai, 1);
+ &cs42888_driver, cs42888_dai, 2);
if (ret) {
dev_err(&i2c_client->dev, "Failed to register codec:%d\n", ret);
kfree(cs42888);
{
struct snd_soc_codec *codec = rtd->codec;
- if (asrc_support) {
- struct snd_card *card = codec->card->snd_card;
- int i;
- int ret;
-
- for (i = 0; i < ARRAY_SIZE(asrc_controls); i++) {
- ret = snd_ctl_add(card,
- snd_soc_cnew(&asrc_controls[i],
- codec, asrc_controls[i].name,
- codec->name_prefix));
- if (ret < 0)
- return ret;
- }
- /*asrc_func is inited 0.
- * it means asrc would not
- * be called defaultly*/
- asrc_func = 0;
- asrc_esai_data.input_sample_rate = asrc_rates[asrc_func];
- }
-
snd_soc_dapm_new_controls(&codec->dapm, imx_3stack_dapm_widgets,
ARRAY_SIZE(imx_3stack_dapm_widgets));
-
snd_soc_dapm_add_routes(&codec->dapm, audio_map, ARRAY_SIZE(audio_map));
-
snd_soc_dapm_sync(&codec->dapm);
-
+ return 0;
+}
+static int imx_asrc_cs42888_init(struct snd_soc_pcm_runtime *rtd)
+{
return 0;
}
.init = imx_3stack_cs42888_init,
.ops = &imx_3stack_surround_ops,
},
+ {
+ .name = "HiFi_ASRC",
+ .stream_name = "HIFI_ASRC",
+ .codec_dai_name = "CS42888_ASRC",
+#ifdef CONFIG_SOC_IMX53
+ .codec_name = "cs42888.1-0048",
+#endif
+#ifdef CONFIG_SOC_IMX6Q
+ .codec_name = "cs42888.0-0048",
+#endif
+ .cpu_dai_name = "imx-esai.0",
+ .platform_name = "imx-pcm-audio.0",
+ .init = imx_asrc_cs42888_init,
+ .ops = &imx_3stack_surround_ops,
+ },
};
static struct snd_soc_card snd_soc_card_imx_3stack = {
return -EINVAL;
}
mclk_freq = plat_data->sysclk;
- if (plat_data->codec_name)
+ if (plat_data->codec_name) {
imx_3stack_dai[0].codec_name = plat_data->codec_name;
+ imx_3stack_dai[1].codec_name = plat_data->codec_name;
+ }
return 0;
}