@@ -117,6 +117,26 @@ static void avs_da7219_codec_exit(struct snd_soc_pcm_runtime *rtd)
117
117
snd_soc_component_set_jack (asoc_rtd_to_codec (rtd , 0 )-> component , NULL , NULL );
118
118
}
119
119
120
+ static int
121
+ avs_da7219_be_fixup (struct snd_soc_pcm_runtime * runrime , struct snd_pcm_hw_params * params )
122
+ {
123
+ struct snd_interval * rate , * channels ;
124
+ struct snd_mask * fmt ;
125
+
126
+ rate = hw_param_interval (params , SNDRV_PCM_HW_PARAM_RATE );
127
+ channels = hw_param_interval (params , SNDRV_PCM_HW_PARAM_CHANNELS );
128
+ fmt = hw_param_mask (params , SNDRV_PCM_HW_PARAM_FORMAT );
129
+
130
+ /* The ADSP will convert the FE rate to 48k, stereo */
131
+ rate -> min = rate -> max = 48000 ;
132
+ channels -> min = channels -> max = 2 ;
133
+
134
+ /* set SSP0 to 24 bit */
135
+ snd_mask_none (fmt );
136
+ snd_mask_set_format (fmt , SNDRV_PCM_FORMAT_S24_LE );
137
+ return 0 ;
138
+ }
139
+
120
140
static int avs_create_dai_link (struct device * dev , const char * platform_name , int ssp_port ,
121
141
struct snd_soc_dai_link * * dai_link )
122
142
{
@@ -148,6 +168,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
148
168
dl -> num_platforms = 1 ;
149
169
dl -> id = 0 ;
150
170
dl -> dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS ;
171
+ dl -> be_hw_params_fixup = avs_da7219_be_fixup ;
151
172
dl -> init = avs_da7219_codec_init ;
152
173
dl -> exit = avs_da7219_codec_exit ;
153
174
dl -> nonatomic = 1 ;
0 commit comments