@@ -169,6 +169,27 @@ static const struct snd_soc_ops avs_rt5682_ops = {
169
169
.hw_params = avs_rt5682_hw_params ,
170
170
};
171
171
172
+ static int
173
+ avs_rt5682_be_fixup (struct snd_soc_pcm_runtime * runtime , struct snd_pcm_hw_params * params )
174
+ {
175
+ struct snd_interval * rate , * channels ;
176
+ struct snd_mask * fmt ;
177
+
178
+ rate = hw_param_interval (params , SNDRV_PCM_HW_PARAM_RATE );
179
+ channels = hw_param_interval (params , SNDRV_PCM_HW_PARAM_CHANNELS );
180
+ fmt = hw_param_mask (params , SNDRV_PCM_HW_PARAM_FORMAT );
181
+
182
+ /* The ADSP will convert the FE rate to 48k, stereo */
183
+ rate -> min = rate -> max = 48000 ;
184
+ channels -> min = channels -> max = 2 ;
185
+
186
+ /* set SSPN to 24 bit */
187
+ snd_mask_none (fmt );
188
+ snd_mask_set_format (fmt , SNDRV_PCM_FORMAT_S24_LE );
189
+
190
+ return 0 ;
191
+ }
192
+
172
193
static int avs_create_dai_link (struct device * dev , const char * platform_name , int ssp_port ,
173
194
struct snd_soc_dai_link * * dai_link )
174
195
{
@@ -201,6 +222,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
201
222
dl -> id = 0 ;
202
223
dl -> init = avs_rt5682_codec_init ;
203
224
dl -> exit = avs_rt5682_codec_exit ;
225
+ dl -> be_hw_params_fixup = avs_rt5682_be_fixup ;
204
226
dl -> ops = & avs_rt5682_ops ;
205
227
dl -> nonatomic = 1 ;
206
228
dl -> no_pcm = 1 ;
0 commit comments