@@ -415,13 +415,13 @@ static void cs530x_add_34_adc_widgets(struct snd_soc_component *component)
415
415
ARRAY_SIZE (adc_ch3_4_routes ));
416
416
}
417
417
418
- static int cs530x_set_bclk (struct snd_soc_component * component )
418
+ static int cs530x_set_bclk (struct snd_soc_component * component , const int freq )
419
419
{
420
420
struct cs530x_priv * cs530x = snd_soc_component_get_drvdata (component );
421
421
struct regmap * regmap = cs530x -> regmap ;
422
422
unsigned int bclk_val ;
423
423
424
- switch (cs530x -> bclk ) {
424
+ switch (freq ) {
425
425
case 2822400 :
426
426
case 3072000 :
427
427
bclk_val = CS530X_BCLK_2P822_3P072 ;
@@ -439,11 +439,11 @@ static int cs530x_set_bclk(struct snd_soc_component *component)
439
439
bclk_val = CS530X_BCLK_24P5792_24P576 ;
440
440
break ;
441
441
default :
442
- dev_err (component -> dev , "Invalid BCLK %d\n" , cs530x -> bclk );
442
+ dev_err (component -> dev , "Invalid BCLK frequency %d\n" , freq );
443
443
return - EINVAL ;
444
444
}
445
445
446
- dev_dbg (component -> dev , "BCLK is %d\n" , cs530x -> bclk );
446
+ dev_dbg (component -> dev , "BCLK frequency is %d\n" , freq );
447
447
448
448
return regmap_update_bits (regmap , CS530X_ASP_CFG ,
449
449
CS530X_ASP_BCLK_FREQ_MASK , bclk_val );
@@ -489,7 +489,7 @@ static int cs530x_hw_params(struct snd_pcm_substream *substream,
489
489
struct snd_soc_component * component = dai -> component ;
490
490
struct cs530x_priv * cs530x = snd_soc_component_get_drvdata (component );
491
491
struct regmap * regmap = cs530x -> regmap ;
492
- int ret = 0 , fs = params_rate (params );
492
+ int ret = 0 , fs = params_rate (params ), bclk ;
493
493
unsigned int fs_val ;
494
494
495
495
@@ -531,22 +531,22 @@ static int cs530x_hw_params(struct snd_pcm_substream *substream,
531
531
CS530X_TDM_EN_MASK )) {
532
532
dev_dbg (component -> dev , "Configuring for %d %d bit TDM slots\n" ,
533
533
cs530x -> tdm_slots , cs530x -> tdm_width );
534
- cs530x -> bclk = snd_soc_tdm_params_to_bclk (params ,
535
- cs530x -> tdm_width ,
536
- cs530x -> tdm_slots ,
537
- 1 );
534
+ bclk = snd_soc_tdm_params_to_bclk (params ,
535
+ cs530x -> tdm_width ,
536
+ cs530x -> tdm_slots ,
537
+ 1 );
538
538
} else {
539
- cs530x -> bclk = snd_soc_params_to_bclk (params );
539
+ bclk = snd_soc_params_to_bclk (params );
540
540
}
541
541
542
542
if (!regmap_test_bits (regmap , CS530X_CLK_CFG_0 ,
543
543
CS530X_PLL_REFCLK_SRC_MASK )) {
544
- ret = cs530x_set_pll_refclk (component , cs530x -> bclk );
544
+ ret = cs530x_set_pll_refclk (component , bclk );
545
545
if (ret )
546
546
return ret ;
547
547
}
548
548
549
- return cs530x_set_bclk (component );
549
+ return cs530x_set_bclk (component , bclk );
550
550
}
551
551
552
552
static int cs530x_set_fmt (struct snd_soc_dai * dai , unsigned int fmt )
0 commit comments