@@ -291,10 +291,10 @@ static int sof_pcm_open(struct snd_pcm_substream *substream)
291291 /* set any runtime constraints based on topology */
292292 snd_pcm_hw_constraint_step (substream -> runtime , 0 ,
293293 SNDRV_PCM_HW_PARAM_BUFFER_SIZE ,
294- caps -> period_size_min );
294+ le32_to_cpu ( caps -> period_size_min ) );
295295 snd_pcm_hw_constraint_step (substream -> runtime , 0 ,
296296 SNDRV_PCM_HW_PARAM_PERIOD_SIZE ,
297- caps -> period_size_min );
297+ le32_to_cpu ( caps -> period_size_min ) );
298298
299299 /* set runtime config */
300300 runtime -> hw .info = SNDRV_PCM_INFO_MMAP |
@@ -303,12 +303,12 @@ static int sof_pcm_open(struct snd_pcm_substream *substream)
303303 SNDRV_PCM_INFO_PAUSE |
304304 SNDRV_PCM_INFO_RESUME |
305305 SNDRV_PCM_INFO_NO_PERIOD_WAKEUP ;
306- runtime -> hw .formats = caps -> formats ;
307- runtime -> hw .period_bytes_min = caps -> period_size_min ;
308- runtime -> hw .period_bytes_max = caps -> period_size_max ;
309- runtime -> hw .periods_min = caps -> periods_min ;
310- runtime -> hw .periods_max = caps -> periods_max ;
311- runtime -> hw .buffer_bytes_max = caps -> buffer_size_max ;
306+ runtime -> hw .formats = le64_to_cpu ( caps -> formats ) ;
307+ runtime -> hw .period_bytes_min = le32_to_cpu ( caps -> period_size_min ) ;
308+ runtime -> hw .period_bytes_max = le32_to_cpu ( caps -> period_size_max ) ;
309+ runtime -> hw .periods_min = le32_to_cpu ( caps -> periods_min ) ;
310+ runtime -> hw .periods_max = le32_to_cpu ( caps -> periods_max ) ;
311+ runtime -> hw .buffer_bytes_max = le32_to_cpu ( caps -> buffer_size_max ) ;
312312
313313 dev_dbg (sdev -> dev , "period min %zd max %zd bytes\n" ,
314314 runtime -> hw .period_bytes_min ,
@@ -398,8 +398,8 @@ static int sof_pcm_new(struct snd_soc_pcm_runtime *rtd)
398398
399399 ret = snd_pcm_lib_preallocate_pages (pcm -> streams [stream ].substream ,
400400 SNDRV_DMA_TYPE_DEV_SG , sdev -> parent ,
401- caps -> buffer_size_min ,
402- caps -> buffer_size_max );
401+ le32_to_cpu ( caps -> buffer_size_min ) ,
402+ le32_to_cpu ( caps -> buffer_size_max ) );
403403 if (ret ) {
404404 dev_err (sdev -> dev , "error: can't alloc DMA buffer size 0x%x/0x%x for %s %d\n" ,
405405 caps -> buffer_size_min , caps -> buffer_size_max ,
@@ -431,8 +431,8 @@ static int sof_pcm_new(struct snd_soc_pcm_runtime *rtd)
431431
432432 ret = snd_pcm_lib_preallocate_pages (pcm -> streams [stream ].substream ,
433433 SNDRV_DMA_TYPE_DEV_SG , sdev -> parent ,
434- caps -> buffer_size_min ,
435- caps -> buffer_size_max );
434+ le32_to_cpu ( caps -> buffer_size_min ) ,
435+ le32_to_cpu ( caps -> buffer_size_max ) );
436436 if (ret ) {
437437 dev_err (sdev -> dev , "error: can't alloc DMA buffer size 0x%x/0x%x for %s %d\n" ,
438438 caps -> buffer_size_min , caps -> buffer_size_max ,
@@ -506,7 +506,7 @@ static int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd,
506506 channels -> max = 2 ;
507507
508508 snd_mask_none (fmt );
509- snd_mask_set (fmt , SNDRV_PCM_FORMAT_S16_LE );
509+ snd_mask_set (fmt , ( __force int ) SNDRV_PCM_FORMAT_S16_LE );
510510
511511 return 0 ;
512512 }
@@ -516,13 +516,13 @@ static int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd,
516516
517517 switch (dai -> comp_dai .config .frame_fmt ) {
518518 case SOF_IPC_FRAME_S16_LE :
519- snd_mask_set (fmt , SNDRV_PCM_FORMAT_S16_LE );
519+ snd_mask_set (fmt , ( __force int ) SNDRV_PCM_FORMAT_S16_LE );
520520 break ;
521521 case SOF_IPC_FRAME_S24_4LE :
522- snd_mask_set (fmt , SNDRV_PCM_FORMAT_S24_LE );
522+ snd_mask_set (fmt , ( __force int ) SNDRV_PCM_FORMAT_S24_LE );
523523 break ;
524524 case SOF_IPC_FRAME_S32_LE :
525- snd_mask_set (fmt , SNDRV_PCM_FORMAT_S32_LE );
525+ snd_mask_set (fmt , ( __force int ) SNDRV_PCM_FORMAT_S32_LE );
526526 break ;
527527 default :
528528 dev_err (sdev -> dev , "No available DAI format!\n" );
0 commit comments