Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs530x: Remove bclk from private structure

Remove the bclk int from the private structure and pass it into
the set_bclk function.

Signed-off-by: Paul Handrigan <paulha@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710160416.2617173-2-paulha@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Paul Handrigan and committed by
Mark Brown
0d1ebba7 c62bec0f

+12 -13
+12 -12
sound/soc/codecs/cs530x.c
··· 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 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 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 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)
-1
sound/soc/codecs/cs530x.h
··· 211 211 212 212 int tdm_width; 213 213 int tdm_slots; 214 - int bclk; 215 214 int fs; 216 215 int adc_pairs_count; 217 216