ASoC: cq93vc: Use core I/O functions
Support future refactoring by using the core I/O functions rather than calling the driver provided I/O functions directly. Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
6f88063c14
commit
1201939a6f
@ -64,13 +64,15 @@ static const struct snd_kcontrol_new cq93vc_snd_controls[] = {
|
|||||||
static int cq93vc_mute(struct snd_soc_dai *dai, int mute)
|
static int cq93vc_mute(struct snd_soc_dai *dai, int mute)
|
||||||
{
|
{
|
||||||
struct snd_soc_codec *codec = dai->codec;
|
struct snd_soc_codec *codec = dai->codec;
|
||||||
u8 reg = cq93vc_read(codec, DAVINCI_VC_REG09) & ~DAVINCI_VC_REG09_MUTE;
|
u8 reg;
|
||||||
|
|
||||||
if (mute)
|
if (mute)
|
||||||
cq93vc_write(codec, DAVINCI_VC_REG09,
|
reg = DAVINCI_VC_REG09_MUTE;
|
||||||
reg | DAVINCI_VC_REG09_MUTE);
|
|
||||||
else
|
else
|
||||||
cq93vc_write(codec, DAVINCI_VC_REG09, reg);
|
reg = 0;
|
||||||
|
|
||||||
|
snd_soc_update_bits(codec, DAVINCI_VC_REG09, DAVINCI_VC_REG09_MUTE,
|
||||||
|
reg);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -97,18 +99,18 @@ static int cq93vc_set_bias_level(struct snd_soc_codec *codec,
|
|||||||
{
|
{
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case SND_SOC_BIAS_ON:
|
case SND_SOC_BIAS_ON:
|
||||||
cq93vc_write(codec, DAVINCI_VC_REG12,
|
snd_soc_write(codec, DAVINCI_VC_REG12,
|
||||||
DAVINCI_VC_REG12_POWER_ALL_ON);
|
DAVINCI_VC_REG12_POWER_ALL_ON);
|
||||||
break;
|
break;
|
||||||
case SND_SOC_BIAS_PREPARE:
|
case SND_SOC_BIAS_PREPARE:
|
||||||
break;
|
break;
|
||||||
case SND_SOC_BIAS_STANDBY:
|
case SND_SOC_BIAS_STANDBY:
|
||||||
cq93vc_write(codec, DAVINCI_VC_REG12,
|
snd_soc_write(codec, DAVINCI_VC_REG12,
|
||||||
DAVINCI_VC_REG12_POWER_ALL_OFF);
|
DAVINCI_VC_REG12_POWER_ALL_OFF);
|
||||||
break;
|
break;
|
||||||
case SND_SOC_BIAS_OFF:
|
case SND_SOC_BIAS_OFF:
|
||||||
/* force all power off */
|
/* force all power off */
|
||||||
cq93vc_write(codec, DAVINCI_VC_REG12,
|
snd_soc_write(codec, DAVINCI_VC_REG12,
|
||||||
DAVINCI_VC_REG12_POWER_ALL_OFF);
|
DAVINCI_VC_REG12_POWER_ALL_OFF);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user