summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorDong Aisheng <b29396@freescale.com>2011-07-27 11:42:29 +0800
committerDong Aisheng <b29396@freescale.com>2011-07-27 15:05:18 +0800
commitfaf77f683f30dcba2dd98f8b91b4139c3c0ae338 (patch)
tree364d938c7d4da1d69c2cbefd026b8888f2e3451b /sound
parent0eec0f39da3bd8afbc556553e24a2a3ca287c0d3 (diff)
ENGR00153740-6 imx-cs42888: remove asrc code
The asrc code in imx-cs42888 driver will cause building fail. Further more, the current asrc driver does not support p2p mode, so remove it first. Signed-off-by: Dong Aisheng <b29396@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/imx/imx-cs42888.c141
1 files changed, 0 insertions, 141 deletions
diff --git a/sound/soc/imx/imx-cs42888.c b/sound/soc/imx/imx-cs42888.c
index fe6ae4e053b6..d9de9e63811b 100644
--- a/sound/soc/imx/imx-cs42888.c
+++ b/sound/soc/imx/imx-cs42888.c
@@ -33,37 +33,6 @@
#include "imx-esai.h"
#include "../codecs/cs42888.h"
-#if defined(CONFIG_MXC_ASRC) || defined(CONFIG_MXC_ASRC_MODULE)
-#include <linux/mxc_asrc.h>
-#endif
-
-#if defined(CONFIG_MXC_ASRC) || defined(CONFIG_MXC_ASRC_MODULE)
-static unsigned int asrc_rates[] = {
- 0,
- 8000,
- 11025,
- 16000,
- 22050,
- 32000,
- 44100,
- 48000,
- 64000,
- 88200,
- 96000,
- 176400,
- 192000,
-};
-
-struct asrc_esai {
- unsigned int cpu_dai_rates;
- unsigned int codec_dai_rates;
- enum asrc_pair_index asrc_index;
- unsigned int output_sample_rate;
-};
-
-static struct asrc_esai asrc_esai_data;
-
-#endif
struct imx_3stack_pcm_state {
int lr_clk_active;
@@ -75,37 +44,12 @@ unsigned int mclk_freq;
static int imx_3stack_startup(struct snd_pcm_substream *substream)
{
clk_state.lr_clk_active++;
-#if defined(CONFIG_MXC_ASRC) || defined(CONFIG_MXC_ASRC_MODULE)
- if (asrc_esai_data.output_sample_rate >= 32000) {
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
- asrc_esai_data.cpu_dai_rates = cpu_dai->playback.rates;
- asrc_esai_data.codec_dai_rates = codec_dai->playback.rates;
- cpu_dai->playback.rates =
- SNDRV_PCM_RATE_8000_192000 | SNDRV_PCM_RATE_KNOT;
- codec_dai->playback.rates =
- SNDRV_PCM_RATE_8000_192000 | SNDRV_PCM_RATE_KNOT;
- }
-#endif
return 0;
}
static void imx_3stack_shutdown(struct snd_pcm_substream *substream)
{
-#if defined(CONFIG_MXC_ASRC) || defined(CONFIG_MXC_ASRC_MODULE)
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
-
- if (asrc_esai_data.output_sample_rate >= 32000) {
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
- codec_dai->playback.rates = asrc_esai_data.codec_dai_rates;
- cpu_dai->playback.rates = asrc_esai_data.cpu_dai_rates;
- asrc_release_pair(asrc_esai_data.asrc_index);
- }
-#endif
-
clk_state.lr_clk_active--;
}
@@ -118,45 +62,9 @@ static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
unsigned int rate = params_rate(params);
u32 dai_format;
unsigned int lrclk_ratio = 0;
-#if defined(CONFIG_MXC_ASRC) || defined(CONFIG_MXC_ASRC_MODULE)
- unsigned int channel = params_channels(params);
-#endif
if (clk_state.lr_clk_active > 1)
return 0;
-#if defined(CONFIG_MXC_ASRC) || defined(CONFIG_MXC_ASRC_MODULE)
- if (asrc_esai_data.output_sample_rate >= 32000) {
- unsigned int asrc_input_rate = rate;
- struct mxc_runtime_data *pcm_data =
- substream->runtime->private_data;
- struct asrc_config config;
- int retVal = 0;;
-
- retVal = asrc_req_pair(channel, &asrc_esai_data.asrc_index);
- if (retVal < 0) {
- pr_err("Fail to request asrc pair\n");
- return -1;
- }
-
- config.pair = asrc_esai_data.asrc_index;
- config.channel_num = channel;
- config.input_sample_rate = asrc_input_rate;
- config.output_sample_rate = asrc_esai_data.output_sample_rate;
- config.inclk = INCLK_NONE;
- config.word_width = 32;
- config.outclk = OUTCLK_ESAI_TX;
- retVal = asrc_config_pair(&config);
- if (retVal < 0) {
- pr_err("Fail to config asrc\n");
- asrc_release_pair(asrc_esai_data.asrc_index);
- return retVal;
- }
- rate = asrc_esai_data.output_sample_rate;
- pcm_data->asrc_index = asrc_esai_data.asrc_index;
- pcm_data->asrc_enable = 1;
- }
-#endif
-
switch (rate) {
case 32000:
lrclk_ratio = 5;
@@ -244,58 +152,9 @@ static const struct snd_soc_dapm_route audio_map[] = {
{"AIN2R", NULL, "Line In Jack"},
};
-#if defined(CONFIG_MXC_ASRC) || defined(CONFIG_MXC_ASRC_MODULE)
-static int asrc_func;
-
-static const char *asrc_function[] = {
- "disable", "32KHz", "44.1KHz",
- "48KHz", "64KHz", "88.2KHz", "96KHz", "176.4KHz", "192KHz"
-};
-
-static const struct soc_enum asrc_enum[] = {
- SOC_ENUM_SINGLE_EXT(9, asrc_function),
-};
-
-static int asrc_get_rate(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- ucontrol->value.enumerated.item[0] = asrc_func;
- return 0;
-}
-
-static int asrc_set_rate(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
-{
- if (asrc_func == ucontrol->value.enumerated.item[0])
- return 0;
-
- asrc_func = ucontrol->value.enumerated.item[0];
- asrc_esai_data.output_sample_rate = asrc_rates[asrc_func + 4];
-
- return 1;
-}
-
-static const struct snd_kcontrol_new asrc_controls[] = {
- SOC_ENUM_EXT("ASRC", asrc_enum[0], asrc_get_rate,
- asrc_set_rate),
-};
-
-#endif
-
static int imx_3stack_cs42888_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
-#if defined(CONFIG_MXC_ASRC) || defined(CONFIG_MXC_ASRC_MODULE)
- int i;
- int ret;
- for (i = 0; i < ARRAY_SIZE(asrc_controls); i++) {
- ret = snd_ctl_add(codec->card,
- snd_soc_cnew(&asrc_controls[i], codec, NULL));
- if (ret < 0)
- return ret;
- }
- asrc_esai_data.output_sample_rate = asrc_rates[asrc_func + 4];
-#endif
snd_soc_dapm_new_controls(&codec->dapm, imx_3stack_dapm_widgets,
ARRAY_SIZE(imx_3stack_dapm_widgets));