Commit e4b7e6a8 authored by Oder Chiou's avatar Oder Chiou Committed by Mark Brown

ASoC: rt5677: Use the regmap functions instead of the snd_soc functions

The patch uses the regmap functions instead of the snd_soc functions in some
cases.
Signed-off-by: default avatarOder Chiou <oder_chiou@realtek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 277880a3
...@@ -924,6 +924,8 @@ static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source, ...@@ -924,6 +924,8 @@ static int is_sys_clk_from_pll(struct snd_soc_dapm_widget *source,
static int is_using_asrc(struct snd_soc_dapm_widget *source, static int is_using_asrc(struct snd_soc_dapm_widget *source,
struct snd_soc_dapm_widget *sink) struct snd_soc_dapm_widget *sink)
{ {
struct snd_soc_codec *codec = source->codec;
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
unsigned int reg, shift, val; unsigned int reg, shift, val;
if (source->reg == RT5677_ASRC_1) { if (source->reg == RT5677_ASRC_1) {
...@@ -990,7 +992,9 @@ static int is_using_asrc(struct snd_soc_dapm_widget *source, ...@@ -990,7 +992,9 @@ static int is_using_asrc(struct snd_soc_dapm_widget *source,
} }
} }
val = (snd_soc_read(source->codec, reg) >> shift) & 0xf; regmap_read(rt5677->regmap, reg, &val);
val = (val >> shift) & 0xf;
switch (val) { switch (val) {
case 1 ... 6: case 1 ... 6:
return 1; return 1;
...@@ -4087,6 +4091,7 @@ static int rt5677_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, ...@@ -4087,6 +4091,7 @@ static int rt5677_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
unsigned int rx_mask, int slots, int slot_width) unsigned int rx_mask, int slots, int slot_width)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec;
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
unsigned int val = 0; unsigned int val = 0;
if (rx_mask || tx_mask) if (rx_mask || tx_mask)
...@@ -4124,10 +4129,12 @@ static int rt5677_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, ...@@ -4124,10 +4129,12 @@ static int rt5677_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
switch (dai->id) { switch (dai->id) {
case RT5677_AIF1: case RT5677_AIF1:
snd_soc_update_bits(codec, RT5677_TDM1_CTRL1, 0x1f00, val); regmap_update_bits(rt5677->regmap, RT5677_TDM1_CTRL1, 0x1f00,
val);
break; break;
case RT5677_AIF2: case RT5677_AIF2:
snd_soc_update_bits(codec, RT5677_TDM2_CTRL1, 0x1f00, val); regmap_update_bits(rt5677->regmap, RT5677_TDM2_CTRL1, 0x1f00,
val);
break; break;
default: default:
break; break;
......
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