aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorEric Miao <eric.miao@linaro.org>2011-09-26 10:46:27 +0800
committerEric Miao <eric.miao@linaro.org>2011-12-19 11:24:46 +0800
commit26bbbf53a63a9bab7132c9afe720d78508d69853 (patch)
treec919be7a72103ab3323dfe7bba16552bd6ce65fc /sound
parent434d1fd591e36c1feb4d45c08e29b560e251ce6c (diff)
SAUCE: set correct rates before registering SPDIF codec DAI
BugLink: http://bugs.launchpad.net/bugs/855281 Playback/capture rates should be configured before the SPDIF codec DAI is registered, according to the parameters that passed in by the platform data. And this caused pulseaudio not working with the SPDIF sound card. Signed-off-by: Eric Miao <eric.miao@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/mxc_spdif.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/soc/codecs/mxc_spdif.c b/sound/soc/codecs/mxc_spdif.c
index 6774ed95426..fbcd7549420 100644
--- a/sound/soc/codecs/mxc_spdif.c
+++ b/sound/soc/codecs/mxc_spdif.c
@@ -1152,7 +1152,13 @@ static int __devinit mxc_spdif_probe(struct platform_device *pdev)
mxc_spdif_codec_dai.playback.stream_name = "Playback";
mxc_spdif_codec_dai.playback.channels_min = 2;
mxc_spdif_codec_dai.playback.channels_max = 2;
- mxc_spdif_codec_dai.playback.rates = MXC_SPDIF_RATES_PLAYBACK;
+
+ if (plat_data->spdif_clk_44100 >= 0)
+ mxc_spdif_codec_dai.playback.rates |= SNDRV_PCM_RATE_44100;
+ if (plat_data->spdif_clk_48000 >= 0)
+ mxc_spdif_codec_dai.playback.rates |= SNDRV_PCM_RATE_32000 |
+ SNDRV_PCM_RATE_48000;
+
mxc_spdif_codec_dai.playback.formats = MXC_SPDIF_FORMATS_PLAYBACK;
}
@@ -1160,7 +1166,13 @@ static int __devinit mxc_spdif_probe(struct platform_device *pdev)
mxc_spdif_codec_dai.capture.stream_name = "Capture";
mxc_spdif_codec_dai.capture.channels_min = 2;
mxc_spdif_codec_dai.capture.channels_max = 2;
- mxc_spdif_codec_dai.capture.rates = MXC_SPDIF_RATES_CAPTURE;
+
+ if (plat_data->spdif_clk_44100 >= 0)
+ mxc_spdif_codec_dai.capture.rates |= SNDRV_PCM_RATE_44100;
+ if (plat_data->spdif_clk_48000 >= 0)
+ mxc_spdif_codec_dai.capture.rates |= SNDRV_PCM_RATE_32000 |
+ SNDRV_PCM_RATE_48000;
+
mxc_spdif_codec_dai.capture.formats = MXC_SPDIF_FORMATS_CAPTURE;
}