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

Commit e411b0b5 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Mark Brown
Browse files

ASoC: dapm: Support second register for DAPM control updates



To support double channel shared controls split across 2 registers, one
for each channel, we must be able to update both registers together.

Add a second set of register fields to struct snd_soc_dapm_update, and
update the DAPM control writeback (put) callbacks to support this.

For codecs that use custom events which call into DAPM to do updates,
also clear struct snd_soc_dapm_update before using it, so the second
set of fields remains clean.

Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1001354c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -615,6 +615,10 @@ struct snd_soc_dapm_update {
	int reg;
	int mask;
	int val;
	int reg2;
	int mask2;
	int val2;
	bool has_second_set;
};

struct snd_soc_dapm_wcache {
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static int adau17x1_dsp_mux_enum_put(struct snd_kcontrol *kcontrol,
	struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
	struct adau *adau = snd_soc_codec_get_drvdata(codec);
	struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
	struct snd_soc_dapm_update update;
	struct snd_soc_dapm_update update = { 0 };
	unsigned int stream = e->shift_l;
	unsigned int val, change;
	int reg;
+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
	unsigned int mask = (1 << fls(max)) - 1;
	unsigned int invert = mc->invert;
	unsigned short val;
	struct snd_soc_dapm_update update;
	struct snd_soc_dapm_update update = { 0 };
	int connect, change;

	val = (ucontrol->value.integer.value[0] & mask);
+1 −1
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ static int wm9712_hp_mixer_put(struct snd_kcontrol *kcontrol,
	struct soc_mixer_control *mc =
		(struct soc_mixer_control *)kcontrol->private_value;
	unsigned int mixer, mask, shift, old;
	struct snd_soc_dapm_update update;
	struct snd_soc_dapm_update update = { 0 };
	bool change;

	mixer = mc->shift >> 8;
+1 −1
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ static int wm9713_hp_mixer_put(struct snd_kcontrol *kcontrol,
	struct soc_mixer_control *mc =
		(struct soc_mixer_control *)kcontrol->private_value;
	unsigned int mixer, mask, shift, old;
	struct snd_soc_dapm_update update;
	struct snd_soc_dapm_update update = { 0 };
	bool change;

	mixer = mc->shift >> 8;
Loading