Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: tas2770: Drop conflicting set_bias_level power setting

The driver is setting the PWR_CTRL field in both the set_bias_level
callback and on DAPM events of the DAC widget (and also in the
mute_stream method). Drop the set_bias_level callback altogether as the
power setting it does is in conflict with the other code paths.

Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220808141246.5749-4-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Martin Povišer and committed by
Mark Brown
482c23fb bf54d97a

-33
-33
sound/soc/codecs/tas2770.c
··· 46 46 usleep_range(1000, 2000); 47 47 } 48 48 49 - static int tas2770_set_bias_level(struct snd_soc_component *component, 50 - enum snd_soc_bias_level level) 51 - { 52 - struct tas2770_priv *tas2770 = 53 - snd_soc_component_get_drvdata(component); 54 - 55 - switch (level) { 56 - case SND_SOC_BIAS_ON: 57 - snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 58 - TAS2770_PWR_CTRL_MASK, 59 - TAS2770_PWR_CTRL_ACTIVE); 60 - break; 61 - case SND_SOC_BIAS_STANDBY: 62 - case SND_SOC_BIAS_PREPARE: 63 - snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 64 - TAS2770_PWR_CTRL_MASK, 65 - TAS2770_PWR_CTRL_MUTE); 66 - break; 67 - case SND_SOC_BIAS_OFF: 68 - snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, 69 - TAS2770_PWR_CTRL_MASK, 70 - TAS2770_PWR_CTRL_SHUTDOWN); 71 - break; 72 - 73 - default: 74 - dev_err(tas2770->dev, "wrong power level setting %d\n", level); 75 - return -EINVAL; 76 - } 77 - 78 - return 0; 79 - } 80 - 81 49 #ifdef CONFIG_PM 82 50 static int tas2770_codec_suspend(struct snd_soc_component *component) 83 51 { ··· 523 555 .probe = tas2770_codec_probe, 524 556 .suspend = tas2770_codec_suspend, 525 557 .resume = tas2770_codec_resume, 526 - .set_bias_level = tas2770_set_bias_level, 527 558 .controls = tas2770_snd_controls, 528 559 .num_controls = ARRAY_SIZE(tas2770_snd_controls), 529 560 .dapm_widgets = tas2770_dapm_widgets,