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

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

ALSA: hda - Don't send invalid volume knob command on IDT 92hd75bxx



Instead of blindly initializing a volume knob widget, first check
that there actually is a volume knob widget.

Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e9ba389c
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -4272,6 +4272,7 @@ static int stac92xx_init(struct hda_codec *codec)
	unsigned int gpio;
	unsigned int gpio;
	int i;
	int i;


	if (spec->init)
		snd_hda_sequence_write(codec, spec->init);
		snd_hda_sequence_write(codec, spec->init);


	/* power down adcs initially */
	/* power down adcs initially */
@@ -5748,7 +5749,6 @@ again:
		/* fallthru */
		/* fallthru */
	case 0x111d76b4: /* 6 Port without Analog Mixer */
	case 0x111d76b4: /* 6 Port without Analog Mixer */
	case 0x111d76b5:
	case 0x111d76b5:
		spec->init = stac92hd71bxx_core_init;
		codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
		codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
		spec->num_dmics = stac92xx_connected_ports(codec,
		spec->num_dmics = stac92xx_connected_ports(codec,
					stac92hd71bxx_dmic_nids,
					stac92hd71bxx_dmic_nids,
@@ -5773,7 +5773,6 @@ again:
			spec->stream_delay = 40; /* 40 milliseconds */
			spec->stream_delay = 40; /* 40 milliseconds */


		/* disable VSW */
		/* disable VSW */
		spec->init = stac92hd71bxx_core_init;
		unmute_init++;
		unmute_init++;
		snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0);
		snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0);
		snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3);
		snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3);
@@ -5788,7 +5787,6 @@ again:


		/* fallthru */
		/* fallthru */
	default:
	default:
		spec->init = stac92hd71bxx_core_init;
		codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
		codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
		spec->num_dmics = stac92xx_connected_ports(codec,
		spec->num_dmics = stac92xx_connected_ports(codec,
					stac92hd71bxx_dmic_nids,
					stac92hd71bxx_dmic_nids,
@@ -5796,6 +5794,9 @@ again:
		break;
		break;
	}
	}


	if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB)
		spec->init = stac92hd71bxx_core_init;

	if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP)
	if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP)
		snd_hda_sequence_write_cache(codec, unmute_init);
		snd_hda_sequence_write_cache(codec, unmute_init);