Skip to content

Commit 0d1ebba

Browse files
Paul Handriganbroonie
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c62bec0 commit 0d1ebba

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

sound/soc/codecs/cs530x.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -415,13 +415,13 @@ static void cs530x_add_34_adc_widgets(struct snd_soc_component *component)
415415
ARRAY_SIZE(adc_ch3_4_routes));
416416
}
417417

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)
419419
{
420420
struct cs530x_priv *cs530x = snd_soc_component_get_drvdata(component);
421421
struct regmap *regmap = cs530x->regmap;
422422
unsigned int bclk_val;
423423

424-
switch (cs530x->bclk) {
424+
switch (freq) {
425425
case 2822400:
426426
case 3072000:
427427
bclk_val = CS530X_BCLK_2P822_3P072;
@@ -439,11 +439,11 @@ static int cs530x_set_bclk(struct snd_soc_component *component)
439439
bclk_val = CS530X_BCLK_24P5792_24P576;
440440
break;
441441
default:
442-
dev_err(component->dev, "Invalid BCLK %d\n", cs530x->bclk);
442+
dev_err(component->dev, "Invalid BCLK frequency %d\n", freq);
443443
return -EINVAL;
444444
}
445445

446-
dev_dbg(component->dev, "BCLK is %d\n", cs530x->bclk);
446+
dev_dbg(component->dev, "BCLK frequency is %d\n", freq);
447447

448448
return regmap_update_bits(regmap, CS530X_ASP_CFG,
449449
CS530X_ASP_BCLK_FREQ_MASK, bclk_val);
@@ -489,7 +489,7 @@ static int cs530x_hw_params(struct snd_pcm_substream *substream,
489489
struct snd_soc_component *component = dai->component;
490490
struct cs530x_priv *cs530x = snd_soc_component_get_drvdata(component);
491491
struct regmap *regmap = cs530x->regmap;
492-
int ret = 0, fs = params_rate(params);
492+
int ret = 0, fs = params_rate(params), bclk;
493493
unsigned int fs_val;
494494

495495

@@ -531,22 +531,22 @@ static int cs530x_hw_params(struct snd_pcm_substream *substream,
531531
CS530X_TDM_EN_MASK)) {
532532
dev_dbg(component->dev, "Configuring for %d %d bit TDM slots\n",
533533
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);
538538
} else {
539-
cs530x->bclk = snd_soc_params_to_bclk(params);
539+
bclk = snd_soc_params_to_bclk(params);
540540
}
541541

542542
if (!regmap_test_bits(regmap, CS530X_CLK_CFG_0,
543543
CS530X_PLL_REFCLK_SRC_MASK)) {
544-
ret = cs530x_set_pll_refclk(component, cs530x->bclk);
544+
ret = cs530x_set_pll_refclk(component, bclk);
545545
if (ret)
546546
return ret;
547547
}
548548

549-
return cs530x_set_bclk(component);
549+
return cs530x_set_bclk(component, bclk);
550550
}
551551

552552
static int cs530x_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)

sound/soc/codecs/cs530x.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ struct cs530x_priv {
211211

212212
int tdm_width;
213213
int tdm_slots;
214-
int bclk;
215214
int fs;
216215
int adc_pairs_count;
217216

0 commit comments

Comments
 (0)