summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/nau8822.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/nau8822.c')
-rw-r--r--sound/soc/codecs/nau8822.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c
index 15d6f8d01f78..a11759f85eac 100644
--- a/sound/soc/codecs/nau8822.c
+++ b/sound/soc/codecs/nau8822.c
@@ -180,8 +180,7 @@ static bool nau8822_volatile(struct device *dev, unsigned int reg)
static int nau8822_eq_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct soc_bytes_ext *params = (void *)kcontrol->private_value;
int i, reg;
u16 reg_val, *val;
@@ -212,8 +211,7 @@ static int nau8822_eq_get(struct snd_kcontrol *kcontrol,
static int nau8822_eq_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct soc_bytes_ext *params = (void *)kcontrol->private_value;
void *data;
u16 *val, value;
@@ -959,6 +957,7 @@ static int nau8822_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{
struct nau8822 *nau8822 = snd_soc_component_get_drvdata(component);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
switch (level) {
case SND_SOC_BIAS_ON:
@@ -966,7 +965,7 @@ static int nau8822_set_bias_level(struct snd_soc_component *component,
case SND_SOC_BIAS_PREPARE:
if (nau8822->mclk &&
- snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON) {
+ snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_ON) {
int ret = clk_prepare_enable(nau8822->mclk);
if (ret) {
@@ -983,7 +982,7 @@ static int nau8822_set_bias_level(struct snd_soc_component *component,
case SND_SOC_BIAS_STANDBY:
if (nau8822->mclk &&
- snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_OFF)
+ snd_soc_dapm_get_bias_level(dapm) != SND_SOC_BIAS_OFF)
clk_disable_unprepare(nau8822->mclk);
snd_soc_component_update_bits(component,
@@ -991,8 +990,7 @@ static int nau8822_set_bias_level(struct snd_soc_component *component,
NAU8822_IOBUF_EN | NAU8822_ABIAS_EN,
NAU8822_IOBUF_EN | NAU8822_ABIAS_EN);
- if (snd_soc_component_get_bias_level(component) ==
- SND_SOC_BIAS_OFF) {
+ if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) {
snd_soc_component_update_bits(component,
NAU8822_REG_POWER_MANAGEMENT_1,
NAU8822_REFIMP_MASK, NAU8822_REFIMP_3K);
@@ -1055,8 +1053,9 @@ static struct snd_soc_dai_driver nau8822_dai = {
static int nau8822_suspend(struct snd_soc_component *component)
{
struct nau8822 *nau8822 = snd_soc_component_get_drvdata(component);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
- snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
+ snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_OFF);
regcache_mark_dirty(nau8822->regmap);
@@ -1066,10 +1065,11 @@ static int nau8822_suspend(struct snd_soc_component *component)
static int nau8822_resume(struct snd_soc_component *component)
{
struct nau8822 *nau8822 = snd_soc_component_get_drvdata(component);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
regcache_sync(nau8822->regmap);
- snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY);
+ snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_STANDBY);
return 0;
}