diff options
| author | Axel Castaneda Gonzalez <x0055901@ti.com> | 2011-05-31 09:23:17 +0100 |
|---|---|---|
| committer | Andy Green <andy.green@linaro.org> | 2011-05-31 11:04:47 +0100 |
| commit | 3bd1239720df89783cf07d416982716791bf127b (patch) | |
| tree | c0f21437b3ab64c4a475a61ead6164c9110f74f3 /sound | |
| parent | 0fc3eb0654c13580a4a4d01306c41fa682101131 (diff) | |
ASoC: SDP4430: Set the pmdown_time for OMAP_ABE_BE_PDM_DL2
For HF playback stream pmdown_time was not set to 500ms,
5000ms was used as a default delay, which was causing
pops at the end of audio rendering because playback streams
were powered down after McPDM shutdown.
Change-Id: I1a8ca45229898ef1c1c9d6f04f3c985e790bbfb8
Signed-off-by: Axel Castaneda Gonzalez <x0055901@ti.com>
Diffstat (limited to 'sound')
| -rw-r--r-- | sound/soc/omap/sdp4430.c | 342 |
1 files changed, 9 insertions, 333 deletions
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c index e79cda09ae7..29536b90fe2 100644 --- a/sound/soc/omap/sdp4430.c +++ b/sound/soc/omap/sdp4430.c @@ -363,7 +363,7 @@ static const struct snd_soc_dapm_route audio_map[] = { {"AFMR", NULL, "Aux/FM Stereo In"}, }; -static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd) +static int sdp4430_twl6040_init_hs(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; struct snd_soc_dapm_context *dapm = &codec->dapm; @@ -424,337 +424,12 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd) return ret; } -static struct snd_soc_dai_link sdp4430_dai[] = { - -/* - * Frontend DAIs - i.e. userspace visible interfaces (ALSA PCMs) - */ - - { - .name = "SDP4430 Media", - .stream_name = "Multimedia", - - /* ABE components - MM-UL & MM_DL */ - .cpu_dai_name = "MultiMedia1", - .platform_name = "omap-pcm-audio", - - .dynamic = 1, /* BE is dynamic */ - .supported_be = mm1_be, - .num_be = ARRAY_SIZE(mm1_be), - .fe_playback_channels = 2, - .fe_capture_channels = 8, - .no_host_mode = SND_SOC_DAI_LINK_OPT_HOST, - }, - { - .name = "SDP4430 Media Capture", - .stream_name = "Multimedia Capture", - - /* ABE components - MM-UL2 */ - .cpu_dai_name = "MultiMedia2", - .platform_name = "omap-pcm-audio", - - .dynamic = 1, /* BE is dynamic */ - .supported_be = mm2_be, - .num_be = ARRAY_SIZE(mm2_be), - .fe_capture_channels = 2, - }, - { - .name = "SDP4430 Voice", - .stream_name = "Voice", - - /* ABE components - VX-UL & VX-DL */ - .cpu_dai_name = "Voice", - .platform_name = "omap-pcm-audio", - - .dynamic = 1, /* BE is dynamic */ - .supported_be = mm1_be, - .num_be = ARRAY_SIZE(mm1_be), - .fe_playback_channels = 2, - .fe_capture_channels = 2, - .no_host_mode = SND_SOC_DAI_LINK_OPT_HOST, - }, - { - .name = "SDP4430 Tones Playback", - .stream_name = "Tone Playback", - - /* ABE components - TONES_DL */ - .cpu_dai_name = "Tones", - .platform_name = "omap-pcm-audio", - - .dynamic = 1, /* BE is dynamic */ - .supported_be = tones_be, - .num_be = ARRAY_SIZE(tones_be), - .fe_playback_channels = 2, - }, - { - .name = "SDP4430 Vibra Playback", - .stream_name = "VIB-DL", - - .cpu_dai_name = "Vibra", - .platform_name = "omap-pcm-audio", - - .dynamic = 1, /* BE is dynamic */ - .supported_be = vib_be, - .num_be = ARRAY_SIZE(vib_be), - .fe_playback_channels = 2, - }, - { - .name = "SDP4430 MODEM", - .stream_name = "MODEM", - - /* ABE components - MODEM <-> McBSP2 */ - .cpu_dai_name = "MODEM", - .platform_name = "omap-aess-audio", - - .dynamic = 1, /* BE is dynamic */ - .supported_be = modem_be, - .num_be = ARRAY_SIZE(modem_be), - .fe_playback_channels = 2, - .fe_capture_channels = 2, - .no_host_mode = SND_SOC_DAI_LINK_NO_HOST, - .ignore_suspend = 1, - }, - { - .name = "SDP4430 Media LP", - .stream_name = "Multimedia", - - /* ABE components - MM-DL (mmap) */ - .cpu_dai_name = "MultiMedia1 LP", - .platform_name = "omap-aess-audio", - - .dynamic = 1, /* BE is dynamic */ - .supported_be = mm_lp_be, - .num_be = ARRAY_SIZE(mm_lp_be), - .fe_playback_channels = 2, - .no_host_mode = SND_SOC_DAI_LINK_OPT_HOST, - }, - { - .name = "Legacy McBSP", - .stream_name = "Multimedia", - - /* ABE components - MCBSP2 - MM-EXT */ - .cpu_dai_name = "omap-mcbsp-dai.1", - .platform_name = "omap-pcm-audio", - - /* FM */ - .codec_dai_name = "FM Digital", - - .no_codec = 1, /* TODO: have a dummy CODEC */ - .ops = &sdp4430_mcbsp_ops, - }, - { - .name = "Legacy McPDM", - .stream_name = "Headset Playback", - - /* ABE components - DL1 */ - .cpu_dai_name = "mcpdm-dl", - .platform_name = "omap-pcm-audio", - - /* Phoenix - DL1 DAC */ - .codec_dai_name = "twl6040-dl1", - .codec_name = "twl6040-codec", - - .ops = &sdp4430_mcpdm_ops, - .ignore_suspend = 1, - }, - { - .name = "Legacy DMIC", - .stream_name = "DMIC Capture", - - /* ABE components - DMIC0 */ - .cpu_dai_name = "omap-dmic-dai-0", - .platform_name = "omap-pcm-audio", - - /* DMIC codec */ - .codec_dai_name = "dmic-hifi", - .codec_name = "dmic-codec.0", - - .ops = &sdp4430_dmic_ops, - .ignore_suspend = 1, - }, - -/* - * Backend DAIs - i.e. dynamically matched interfaces, invisible to userspace. - * Matched to above interfaces at runtime, based upon use case. - */ - - { - .name = OMAP_ABE_BE_PDM_DL1, - .stream_name = "HS Playback", - - /* ABE components - DL1 */ - .cpu_dai_name = "mcpdm-dl1", - .platform_name = "omap-aess-audio", - - /* Phoenix - DL1 DAC */ - .codec_dai_name = "twl6040-dl1", - .codec_name = "twl6040-codec", - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .init = sdp4430_twl6040_init_hs, - .ops = &sdp4430_mcpdm_ops, - .be_id = OMAP_ABE_DAI_PDM_DL1, - .ignore_suspend = 1, - }, - { - .name = OMAP_ABE_BE_PDM_UL1, - .stream_name = "Analog Capture", - - /* ABE components - UL1 */ - .cpu_dai_name = "mcpdm-ul1", - .platform_name = "omap-aess-audio", - - /* Phoenix - UL ADC */ - .codec_dai_name = "twl6040-ul", - .codec_name = "twl6040-codec", - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .ops = &sdp4430_mcpdm_ops, - .be_id = OMAP_ABE_DAI_PDM_UL, - .ignore_suspend = 1, - }, - { - .name = OMAP_ABE_BE_PDM_DL2, - .stream_name = "HF Playback", - - /* ABE components - DL2 */ - .cpu_dai_name = "mcpdm-dl2", - .platform_name = "omap-aess-audio", - - /* Phoenix - DL2 DAC */ - .codec_dai_name = "twl6040-dl2", - .codec_name = "twl6040-codec", - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .init = sdp4430_twl6040_init_hf, - .ops = &sdp4430_mcpdm_ops, - .be_id = OMAP_ABE_DAI_PDM_DL2, - .ignore_suspend = 1, - }, - { - .name = OMAP_ABE_BE_PDM_VIB, - .stream_name = "Vibra", - - /* ABE components - VIB1 DL */ - .cpu_dai_name = "mcpdm-vib", - .platform_name = "omap-aess-audio", - - /* Phoenix - PDM to PWM */ - .codec_dai_name = "twl6040-vib", - .codec_name = "twl6040-codec", - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .ops = &sdp4430_mcpdm_ops, - .be_id = OMAP_ABE_DAI_PDM_VIB, - .ignore_suspend = 1, - }, - { - .name = OMAP_ABE_BE_BT_VX, - .stream_name = "BT", - - /* ABE components - MCBSP1 - BT-VX */ - .cpu_dai_name = "omap-mcbsp-dai.0", - .platform_name = "omap-aess-audio", - - /* Bluetooth */ - .codec_dai_name = "Bluetooth", - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .no_codec = 1, /* TODO: have a dummy CODEC */ - .be_hw_params_fixup = mcbsp_be_hw_params_fixup, - .ops = &sdp4430_mcbsp_ops, - .be_id = OMAP_ABE_DAI_BT_VX, - .ignore_suspend = 1, - }, - { - .name = OMAP_ABE_BE_MM_EXT0, - .stream_name = "FM", - - /* ABE components - MCBSP2 - MM-EXT */ - .cpu_dai_name = "omap-mcbsp-dai.1", - .platform_name = "omap-aess-audio", - - /* FM */ - .codec_dai_name = "FM Digital", - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .no_codec = 1, /* TODO: have a dummy CODEC */ - .be_hw_params_fixup = mcbsp_be_hw_params_fixup, - .ops = &sdp4430_mcbsp_ops, - .be_id = OMAP_ABE_DAI_MM_FM, - }, - { - .name = OMAP_ABE_BE_MM_EXT1, - .stream_name = "MODEM", - - /* ABE components - MCBSP2 - MM-EXT */ - .cpu_dai_name = "omap-mcbsp-dai.1", - .platform_name = "omap-aess-audio", - - /* MODEM */ - .codec_dai_name = "MODEM", - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .no_codec = 1, /* TODO: have a dummy CODEC */ - .be_hw_params_fixup = mcbsp_be_hw_params_fixup, - .ops = &sdp4430_mcbsp_ops, - .be_id = OMAP_ABE_DAI_MODEM, - .ignore_suspend = 1, - }, - { - .name = OMAP_ABE_BE_DMIC0, - .stream_name = "DMIC0", - - /* ABE components - DMIC UL 1 */ - .cpu_dai_name = "omap-dmic-abe-dai-0", - .platform_name = "omap-aess-audio", - - /* DMIC 0 */ - .codec_dai_name = "dmic-hifi", - .codec_name = "dmic-codec.0", - .ops = &sdp4430_dmic_ops, - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .be_hw_params_fixup = dmic_be_hw_params_fixup, - .be_id = OMAP_ABE_DAI_DMIC0, - .ignore_suspend = 1, - }, - { - .name = OMAP_ABE_BE_DMIC1, - .stream_name = "DMIC1", - - /* ABE components - DMIC UL 1 */ - .cpu_dai_name = "omap-dmic-abe-dai-1", - .platform_name = "omap-aess-audio", - - /* DMIC 1 */ - .codec_dai_name = "dmic-hifi", - .codec_name = "dmic-codec.1", - .ops = &sdp4430_dmic_ops, - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .be_hw_params_fixup = dmic_be_hw_params_fixup, - .be_id = OMAP_ABE_DAI_DMIC1, - .ignore_suspend = 1, - }, - { - .name = OMAP_ABE_BE_DMIC2, - .stream_name = "DMIC2", - - /* ABE components - DMIC UL 2 */ - .cpu_dai_name = "omap-dmic-abe-dai-2", - .platform_name = "omap-aess-audio", - - /* DMIC 2 */ - .codec_dai_name = "dmic-hifi", - .codec_name = "dmic-codec.2", - .ops = &sdp4430_dmic_ops, - - .no_pcm = 1, /* don't create ALSA pcm for this */ - .be_hw_params_fixup = dmic_be_hw_params_fixup, - .be_id = OMAP_ABE_DAI_DMIC2, - .ignore_suspend = 1, - }, +static int sdp4430_twl6040_init_hf(struct snd_soc_pcm_runtime *rtd) +{ + /* wait 500 ms before switching of HS power */ + rtd->pmdown_time = 500; + return 0; +} /* TODO: make this a separate BT CODEC driver or DUMMY */ static struct snd_soc_dai_driver dai[] = { @@ -1037,7 +712,7 @@ static struct snd_soc_dai_link sdp4430_dai[] = { .codec_name = "twl6040-codec", .no_pcm = 1, /* don't create ALSA pcm for this */ - .init = sdp4430_twl6040_init, + .init = sdp4430_twl6040_init_hs, .ops = &sdp4430_mcpdm_ops, .be_id = OMAP_ABE_DAI_PDM_DL1, .ignore_suspend = 1, @@ -1072,6 +747,7 @@ static struct snd_soc_dai_link sdp4430_dai[] = { .codec_name = "twl6040-codec", .no_pcm = 1, /* don't create ALSA pcm for this */ + .init = sdp4430_twl6040_init_hf, .ops = &sdp4430_mcpdm_ops, .be_id = OMAP_ABE_DAI_PDM_DL2, .ignore_suspend = 1, |
