Commit a5db2ca5 authored by Tzung-Bi Shih's avatar Tzung-Bi Shih Committed by Mark Brown

ASoC: rt1015: remove unneeded variables in rt1015_priv

- `lrck' is only used in .hw_params callback so that it can be local.
- `bclk' is unused.
- `id' is unused.
- `amp_ver' is unused.
Signed-off-by: default avatarTzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201224100607.3006171-6-tzungbi@google.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3128f1c3
...@@ -704,11 +704,11 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream, ...@@ -704,11 +704,11 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream,
{ {
struct snd_soc_component *component = dai->component; struct snd_soc_component *component = dai->component;
struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
int pre_div, bclk_ms, frame_size; int pre_div, bclk_ms, frame_size, lrck;
unsigned int val_len = 0; unsigned int val_len = 0;
rt1015->lrck = params_rate(params); lrck = params_rate(params);
pre_div = rl6231_get_clk_info(rt1015->sysclk, rt1015->lrck); pre_div = rl6231_get_clk_info(rt1015->sysclk, lrck);
if (pre_div < 0) { if (pre_div < 0) {
dev_err(component->dev, "Unsupported clock rate\n"); dev_err(component->dev, "Unsupported clock rate\n");
return -EINVAL; return -EINVAL;
...@@ -722,13 +722,12 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream, ...@@ -722,13 +722,12 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream,
} }
bclk_ms = frame_size > 32; bclk_ms = frame_size > 32;
rt1015->bclk = rt1015->lrck * (32 << bclk_ms);
dev_dbg(component->dev, "bclk_ms is %d and pre_div is %d for iis %d\n", dev_dbg(component->dev, "bclk_ms is %d and pre_div is %d for iis %d\n",
bclk_ms, pre_div, dai->id); bclk_ms, pre_div, dai->id);
dev_dbg(component->dev, "lrck is %dHz and pre_div is %d for iis %d\n", dev_dbg(component->dev, "lrck is %dHz and pre_div is %d for iis %d\n",
rt1015->lrck, pre_div, dai->id); lrck, pre_div, dai->id);
switch (params_width(params)) { switch (params_width(params)) {
case 16: case 16:
......
...@@ -427,16 +427,12 @@ struct rt1015_priv { ...@@ -427,16 +427,12 @@ struct rt1015_priv {
struct regmap *regmap; struct regmap *regmap;
int sysclk; int sysclk;
int sysclk_src; int sysclk_src;
int lrck;
int bclk;
int bclk_ratio; int bclk_ratio;
int id;
int pll_src; int pll_src;
int pll_in; int pll_in;
int pll_out; int pll_out;
int boost_mode; int boost_mode;
int bypass_boost; int bypass_boost;
int amp_ver;
int dac_is_used; int dac_is_used;
int cali_done; int cali_done;
int hw_config; int hw_config;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment