Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bb043f5 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

ASoC: alc5632: Replace w->codec snd_soc_dapm_to_codec(w->dapm)



The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) instead.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a50d761f
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -116,18 +116,20 @@ static inline int alc5632_reset(struct regmap *map)
static int amp_mixer_event(struct snd_soc_dapm_widget *w,
static int amp_mixer_event(struct snd_soc_dapm_widget *w,
	struct snd_kcontrol *kcontrol, int event)
	struct snd_kcontrol *kcontrol, int event)
{
{
	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);

	/* to power-on/off class-d amp generators/speaker */
	/* to power-on/off class-d amp generators/speaker */
	/* need to write to 'index-46h' register :        */
	/* need to write to 'index-46h' register :        */
	/* so write index num (here 0x46) to reg 0x6a     */
	/* so write index num (here 0x46) to reg 0x6a     */
	/* and then 0xffff/0 to reg 0x6c                  */
	/* and then 0xffff/0 to reg 0x6c                  */
	snd_soc_write(w->codec, ALC5632_HID_CTRL_INDEX, 0x46);
	snd_soc_write(codec, ALC5632_HID_CTRL_INDEX, 0x46);


	switch (event) {
	switch (event) {
	case SND_SOC_DAPM_PRE_PMU:
	case SND_SOC_DAPM_PRE_PMU:
		snd_soc_write(w->codec, ALC5632_HID_CTRL_DATA, 0xFFFF);
		snd_soc_write(codec, ALC5632_HID_CTRL_DATA, 0xFFFF);
		break;
		break;
	case SND_SOC_DAPM_POST_PMD:
	case SND_SOC_DAPM_POST_PMD:
		snd_soc_write(w->codec, ALC5632_HID_CTRL_DATA, 0);
		snd_soc_write(codec, ALC5632_HID_CTRL_DATA, 0);
		break;
		break;
	}
	}