From c427131f969eba03f4efb3b0eed35b68ccfae8f9 Mon Sep 17 00:00:00 2001 From: Phani Kumar Uppalapati Date: Wed, 23 Oct 2013 18:53:25 -0700 Subject: ASoC: msm: Fixup number of channels for FM transmitter Backend during FM transmission supports only stereo channels. Fix up the number of channels to 2 for FM transmitter. CRs-fixed: 556019 Change-Id: I98e08432e66e5910edfa5472969e1c638c25ee2c Signed-off-by: Phani Kumar Uppalapati --- sound/soc/msm/msm8226.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'sound/soc/msm/msm8226.c') diff --git a/sound/soc/msm/msm8226.c b/sound/soc/msm/msm8226.c index 23b78b3696a2..aba9699afa9e 100644 --- a/sound/soc/msm/msm8226.c +++ b/sound/soc/msm/msm8226.c @@ -448,6 +448,22 @@ static int msm_btsco_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } +static int msm_be_fm_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, + struct snd_pcm_hw_params *params) +{ + struct snd_interval *rate = hw_param_interval(params, + SNDRV_PCM_HW_PARAM_RATE); + + struct snd_interval *channels = hw_param_interval(params, + SNDRV_PCM_HW_PARAM_CHANNELS); + + pr_debug("%s()\n", __func__); + rate->min = rate->max = 48000; + channels->min = channels->max = 2; + + return 0; +} + static int msm8226_auxpcm_rate_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { @@ -1366,7 +1382,7 @@ static struct snd_soc_dai_link msm8226_common_dai[] = { .codec_dai_name = "msm-stub-rx", .no_pcm = 1, .be_id = MSM_BACKEND_DAI_INT_FM_RX, - .be_hw_params_fixup = msm_be_hw_params_fixup, + .be_hw_params_fixup = msm_be_fm_hw_params_fixup, /* this dainlink has playback support */ .ignore_pmdown_time = 1, .ignore_suspend = 1, -- cgit v1.2.3