diff options
author | Sebastien Guiriec <sebastien.guiriec@intel.com> | 2015-12-17 21:35:39 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-12-19 06:49:56 -0500 |
commit | 3f27dedda463347e98d406fc97ff6767ac59ea05 (patch) | |
tree | 9ba21e8a04e009fd1a2b399e4907579face9ab12 | |
parent | d2c7db854ed07548ca7d01118eee67fd6a78a2be (diff) |
ASoC: Intel: bytcr_rt5640: set SSP to I2S mode 2ch
Using the hw_fixup function in order to overwrite the default SSP
setting for Audio DSP port connected to the codec. Instead of
TDM 4ch use I2S 2ch 24 bits.
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/boards/bytcr_rt5640.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 7a5c9a36c1db..66d37b0e64d1 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c | |||
@@ -107,6 +107,7 @@ static int byt_codec_fixup(struct snd_soc_pcm_runtime *rtd, | |||
107 | SNDRV_PCM_HW_PARAM_RATE); | 107 | SNDRV_PCM_HW_PARAM_RATE); |
108 | struct snd_interval *channels = hw_param_interval(params, | 108 | struct snd_interval *channels = hw_param_interval(params, |
109 | SNDRV_PCM_HW_PARAM_CHANNELS); | 109 | SNDRV_PCM_HW_PARAM_CHANNELS); |
110 | int ret; | ||
110 | 111 | ||
111 | /* The DSP will covert the FE rate to 48k, stereo, 24bits */ | 112 | /* The DSP will covert the FE rate to 48k, stereo, 24bits */ |
112 | rate->min = rate->max = 48000; | 113 | rate->min = rate->max = 48000; |
@@ -114,6 +115,28 @@ static int byt_codec_fixup(struct snd_soc_pcm_runtime *rtd, | |||
114 | 115 | ||
115 | /* set SSP2 to 24-bit */ | 116 | /* set SSP2 to 24-bit */ |
116 | params_set_format(params, SNDRV_PCM_FORMAT_S24_LE); | 117 | params_set_format(params, SNDRV_PCM_FORMAT_S24_LE); |
118 | |||
119 | /* | ||
120 | * Default mode for SSP configuration is TDM 4 slot, override config | ||
121 | * with explicit setting to I2S 2ch 24-bit. The word length is set with | ||
122 | * dai_set_tdm_slot() since there is no other API exposed | ||
123 | */ | ||
124 | ret = snd_soc_dai_set_fmt(rtd->cpu_dai, | ||
125 | SND_SOC_DAIFMT_I2S | | ||
126 | SND_SOC_DAIFMT_NB_IF | | ||
127 | SND_SOC_DAIFMT_CBS_CFS | ||
128 | ); | ||
129 | if (ret < 0) { | ||
130 | dev_err(rtd->dev, "can't set format to I2S, err %d\n", ret); | ||
131 | return ret; | ||
132 | } | ||
133 | |||
134 | ret = snd_soc_dai_set_tdm_slot(rtd->cpu_dai, 0x3, 0x3, 2, 24); | ||
135 | if (ret < 0) { | ||
136 | dev_err(rtd->dev, "can't set I2S config, err %d\n", ret); | ||
137 | return ret; | ||
138 | } | ||
139 | |||
117 | return 0; | 140 | return 0; |
118 | } | 141 | } |
119 | 142 | ||