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

Commit c41999a2 authored by David Henningsson's avatar David Henningsson Committed by Takashi Iwai
Browse files

ALSA: hda - don't create dysfunctional mixer controls for ca0132

It's possible that these amps are settable somehow, e g through
secret codec verbs, but for now, don't create the controls (as
they won't be working anyway, and cause errors in amixer).

Cc: stable@kernel.org
BugLink: https://bugs.launchpad.net/bugs/1038651


Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8e13fc1c
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -275,6 +275,10 @@ static int _add_switch(struct hda_codec *codec, hda_nid_t nid, const char *pfx,
	int type = dir ? HDA_INPUT : HDA_OUTPUT;
	int type = dir ? HDA_INPUT : HDA_OUTPUT;
	struct snd_kcontrol_new knew =
	struct snd_kcontrol_new knew =
		HDA_CODEC_MUTE_MONO(namestr, nid, chan, 0, type);
		HDA_CODEC_MUTE_MONO(namestr, nid, chan, 0, type);
	if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_MUTE) == 0) {
		snd_printdd("Skipping '%s %s Switch' (no mute on node 0x%x)\n", pfx, dirstr[dir], nid);
		return 0;
	}
	sprintf(namestr, "%s %s Switch", pfx, dirstr[dir]);
	sprintf(namestr, "%s %s Switch", pfx, dirstr[dir]);
	return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
	return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
}
}
@@ -286,6 +290,10 @@ static int _add_volume(struct hda_codec *codec, hda_nid_t nid, const char *pfx,
	int type = dir ? HDA_INPUT : HDA_OUTPUT;
	int type = dir ? HDA_INPUT : HDA_OUTPUT;
	struct snd_kcontrol_new knew =
	struct snd_kcontrol_new knew =
		HDA_CODEC_VOLUME_MONO(namestr, nid, chan, 0, type);
		HDA_CODEC_VOLUME_MONO(namestr, nid, chan, 0, type);
	if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_NUM_STEPS) == 0) {
		snd_printdd("Skipping '%s %s Volume' (no amp on node 0x%x)\n", pfx, dirstr[dir], nid);
		return 0;
	}
	sprintf(namestr, "%s %s Volume", pfx, dirstr[dir]);
	sprintf(namestr, "%s %s Volume", pfx, dirstr[dir]);
	return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
	return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
}
}