Commit fa129ebe authored by Mark Brown's avatar Mark Brown

ASoC: 88pm60x: Don't use control data for i2c

In preparation for using the regmap directly in the CODEC driver replace
references to the I2C client using control_data with references to the
driver private data.
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 272b98c6
...@@ -1166,6 +1166,7 @@ static int pm860x_i2s_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -1166,6 +1166,7 @@ static int pm860x_i2s_set_dai_fmt(struct snd_soc_dai *codec_dai,
static int pm860x_set_bias_level(struct snd_soc_codec *codec, static int pm860x_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
struct pm860x_priv *pm860x = snd_soc_codec_get_drvdata(codec);
int data; int data;
switch (level) { switch (level) {
...@@ -1179,17 +1180,17 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec, ...@@ -1179,17 +1180,17 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec,
if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
/* Enable Audio PLL & Audio section */ /* Enable Audio PLL & Audio section */
data = AUDIO_PLL | AUDIO_SECTION_ON; data = AUDIO_PLL | AUDIO_SECTION_ON;
pm860x_reg_write(codec->control_data, REG_MISC2, data); pm860x_reg_write(pm860x->i2c, REG_MISC2, data);
udelay(300); udelay(300);
data = AUDIO_PLL | AUDIO_SECTION_RESET data = AUDIO_PLL | AUDIO_SECTION_RESET
| AUDIO_SECTION_ON; | AUDIO_SECTION_ON;
pm860x_reg_write(codec->control_data, REG_MISC2, data); pm860x_reg_write(pm860x->i2c, REG_MISC2, data);
} }
break; break;
case SND_SOC_BIAS_OFF: case SND_SOC_BIAS_OFF:
data = AUDIO_PLL | AUDIO_SECTION_RESET | AUDIO_SECTION_ON; data = AUDIO_PLL | AUDIO_SECTION_RESET | AUDIO_SECTION_ON;
pm860x_set_bits(codec->control_data, REG_MISC2, data, 0); pm860x_set_bits(pm860x->i2c, REG_MISC2, data, 0);
break; break;
} }
codec->dapm.bias_level = level; codec->dapm.bias_level = level;
...@@ -1319,17 +1320,17 @@ int pm860x_hs_jack_detect(struct snd_soc_codec *codec, ...@@ -1319,17 +1320,17 @@ int pm860x_hs_jack_detect(struct snd_soc_codec *codec,
pm860x->det.lo_shrt = lo_shrt; pm860x->det.lo_shrt = lo_shrt;
if (det & SND_JACK_HEADPHONE) if (det & SND_JACK_HEADPHONE)
pm860x_set_bits(codec->control_data, REG_HS_DET, pm860x_set_bits(pm860x->i2c, REG_HS_DET,
EN_HS_DET, EN_HS_DET); EN_HS_DET, EN_HS_DET);
/* headset short detect */ /* headset short detect */
if (hs_shrt) { if (hs_shrt) {
data = CLR_SHORT_HS2 | CLR_SHORT_HS1; data = CLR_SHORT_HS2 | CLR_SHORT_HS1;
pm860x_set_bits(codec->control_data, REG_SHORTS, data, data); pm860x_set_bits(pm860x->i2c, REG_SHORTS, data, data);
} }
/* Lineout short detect */ /* Lineout short detect */
if (lo_shrt) { if (lo_shrt) {
data = CLR_SHORT_LO2 | CLR_SHORT_LO1; data = CLR_SHORT_LO2 | CLR_SHORT_LO1;
pm860x_set_bits(codec->control_data, REG_SHORTS, data, data); pm860x_set_bits(pm860x->i2c, REG_SHORTS, data, data);
} }
/* sync status */ /* sync status */
...@@ -1347,7 +1348,7 @@ int pm860x_mic_jack_detect(struct snd_soc_codec *codec, ...@@ -1347,7 +1348,7 @@ int pm860x_mic_jack_detect(struct snd_soc_codec *codec,
pm860x->det.mic_det = det; pm860x->det.mic_det = det;
if (det & SND_JACK_MICROPHONE) if (det & SND_JACK_MICROPHONE)
pm860x_set_bits(codec->control_data, REG_MIC_DET, pm860x_set_bits(pm860x->i2c, REG_MIC_DET,
MICDET_MASK, MICDET_MASK); MICDET_MASK, MICDET_MASK);
/* sync status */ /* sync status */
...@@ -1377,7 +1378,7 @@ static int pm860x_probe(struct snd_soc_codec *codec) ...@@ -1377,7 +1378,7 @@ static int pm860x_probe(struct snd_soc_codec *codec)
pm860x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); pm860x_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
ret = pm860x_bulk_read(codec->control_data, REG_CACHE_BASE, ret = pm860x_bulk_read(pm860x->i2c, REG_CACHE_BASE,
REG_CACHE_SIZE, codec->reg_cache); REG_CACHE_SIZE, codec->reg_cache);
if (ret < 0) { if (ret < 0) {
dev_err(codec->dev, "Failed to fill register cache: %d\n", dev_err(codec->dev, "Failed to fill register cache: %d\n",
......
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