Skip to content

Commit f69910d

Browse files
committed
ALSA: hda - Fix missing mute controls for CX5051
We've added a fake mute control (setting the amp volume to zero) for CX5051 at commit [3868137: ALSA: hda - Add a fake mute feature], but this feature was overlooked in the generic parser implementation. Now the driver lacks of mute controls on these codecs. The fix is just to check both AC_AMPCAP_MUTE and AC_AMPCAP_MIN_MUTE bits in each place checking the amp capabilities. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59001 Cc: <[email protected]> [v3.9+] Signed-off-by: Takashi Iwai <[email protected]>
1 parent aa773bf commit f69910d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/pci/hda/hda_generic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ static bool same_amp_caps(struct hda_codec *codec, hda_nid_t nid1,
522522
}
523523

524524
#define nid_has_mute(codec, nid, dir) \
525-
check_amp_caps(codec, nid, dir, AC_AMPCAP_MUTE)
525+
check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE))
526526
#define nid_has_volume(codec, nid, dir) \
527527
check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS)
528528

@@ -624,7 +624,7 @@ static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid,
624624
if (enable)
625625
val = (caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT;
626626
}
627-
if (caps & AC_AMPCAP_MUTE) {
627+
if (caps & (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) {
628628
if (!enable)
629629
val |= HDA_AMP_MUTE;
630630
}
@@ -648,7 +648,7 @@ static unsigned int get_amp_mask_to_modify(struct hda_codec *codec,
648648
{
649649
unsigned int mask = 0xff;
650650

651-
if (caps & AC_AMPCAP_MUTE) {
651+
if (caps & (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) {
652652
if (is_ctl_associated(codec, nid, dir, idx, NID_PATH_MUTE_CTL))
653653
mask &= ~0x80;
654654
}

0 commit comments

Comments
 (0)