View | Details | Raw Unified | Return to bug 1228269
Collapse All | Expand All

(-)a/sound/pci/hda/patch_conexant.c (-2 / +52 lines)
Lines 50-55 struct conexant_spec { Link Here
50
	unsigned int gpio_mic_led_mask;
50
	unsigned int gpio_mic_led_mask;
51
	unsigned int headset_present_flag;
51
	unsigned int headset_present_flag;
52
	bool is_cx8070_sn6140;
52
	bool is_cx8070_sn6140;
53
54
	/* hooks */
55
	void (*shutup)(struct hda_codec *codec);
53
};
56
};
54
57
55
58
Lines 208-214 static int cx_auto_init(struct hda_codec *codec) Link Here
208
	return 0;
211
	return 0;
209
}
212
}
210
213
211
static void cx_auto_shutdown(struct hda_codec *codec)
214
static void cx_auto_shutup_default(struct hda_codec *codec)
212
{
215
{
213
	struct conexant_spec *spec = codec->spec;
216
	struct conexant_spec *spec = codec->spec;
214
217
Lines 217-222 static void cx_auto_shutdown(struct hda_codec *codec) Link Here
217
	cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
220
	cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
218
}
221
}
219
222
223
static void cx_auto_shutup_mute(struct hda_codec *codec)
224
{
225
	struct conexant_spec *spec = codec->spec;
226
	hda_nid_t nid;
227
	int c;
228
229
	if (!snd_hdac_is_power_on(&codec->core))
230
		return;
231
232
	/* forcibly mute the speaker output */
233
	nid = spec->gen.multiout.extra_out_nid[0];
234
	for (c = 0; c < 2; c++) {
235
		if (!(snd_hda_codec_amp_read(codec, nid, c, HDA_OUTPUT, 0) & HDA_AMP_MUTE))
236
			snd_hda_codec_write(codec, nid, 0,
237
					    AC_VERB_SET_AMP_GAIN_MUTE, HDA_AMP_MUTE);
238
	}
239
240
	cx_auto_shutup_default(codec);
241
}
242
243
static void cx_auto_shutdown(struct hda_codec *codec)
244
{
245
	struct conexant_spec *spec = codec->spec;
246
247
	if (spec->shutup)
248
		spec->shutup(codec);
249
	else
250
		cx_auto_shutup_default(codec);
251
}
252
220
static void cx_auto_free(struct hda_codec *codec)
253
static void cx_auto_free(struct hda_codec *codec)
221
{
254
{
222
	cx_auto_shutdown(codec);
255
	cx_auto_shutdown(codec);
Lines 341-346 enum { Link Here
341
	CXT_FIXUP_HEADSET_MIC,
374
	CXT_FIXUP_HEADSET_MIC,
342
	CXT_FIXUP_HP_MIC_NO_PRESENCE,
375
	CXT_FIXUP_HP_MIC_NO_PRESENCE,
343
	CXT_PINCFG_SWS_JS201D,
376
	CXT_PINCFG_SWS_JS201D,
377
	CXT_FIXUP_THINKPAD_SHUTDOWN_MUTE,
344
};
378
};
345
379
346
/* for hda_fixup_thinkpad_acpi() */
380
/* for hda_fixup_thinkpad_acpi() */
Lines 809-814 static void cxt_fixup_hp_zbook_mute_led(struct hda_codec *codec, Link Here
809
		cxt_setup_mute_led(codec, 0x10, 0x20);
843
		cxt_setup_mute_led(codec, 0x10, 0x20);
810
}
844
}
811
845
846
static void cxt_fixup_thinkpad_shutdown_mute(struct hda_codec *codec,
847
					     const struct hda_fixup *fix,
848
					     int action)
849
{
850
	struct conexant_spec *spec = codec->spec;
851
852
	if (action == HDA_FIXUP_ACT_PRE_PROBE)
853
		spec->shutup = cx_auto_shutup_mute;
854
}
855
812
/* ThinkPad X200 & co with cxt5051 */
856
/* ThinkPad X200 & co with cxt5051 */
813
static const struct hda_pintbl cxt_pincfg_lenovo_x200[] = {
857
static const struct hda_pintbl cxt_pincfg_lenovo_x200[] = {
814
	{ 0x16, 0x042140ff }, /* HP (seq# overridden) */
858
	{ 0x16, 0x042140ff }, /* HP (seq# overridden) */
Lines 1008-1013 static const struct hda_fixup cxt_fixups[] = { Link Here
1008
		.type = HDA_FIXUP_PINS,
1052
		.type = HDA_FIXUP_PINS,
1009
		.v.pins = cxt_pincfg_sws_js201d,
1053
		.v.pins = cxt_pincfg_sws_js201d,
1010
	},
1054
	},
1055
	[CXT_FIXUP_THINKPAD_SHUTDOWN_MUTE] = {
1056
		.type = HDA_FIXUP_FUNC,
1057
		.v.func = cxt_fixup_thinkpad_shutdown_mute,
1058
		.chained = true,
1059
		.chain_id = CXT_FIXUP_THINKPAD_ACPI,
1060
	},
1011
};
1061
};
1012
1062
1013
static const struct snd_pci_quirk cxt5045_fixups[] = {
1063
static const struct snd_pci_quirk cxt5045_fixups[] = {
Lines 1101-1106 static const struct snd_pci_quirk cxt5066_fixups[] = { Link Here
1101
	SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC),
1151
	SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC),
1102
	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo G50-70", CXT_FIXUP_STEREO_DMIC),
1152
	SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo G50-70", CXT_FIXUP_STEREO_DMIC),
1103
	SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC),
1153
	SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC),
1154
	SND_PCI_QUIRK(0x17aa, 0x50ec, "Lenovo ThinkPad E16 Gen 2", CXT_FIXUP_THINKPAD_SHUTDOWN_MUTE),
1104
	SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI),
1155
	SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI),
1105
	SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004),
1156
	SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004),
1106
	SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205),
1157
	SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205),
1107
- 

Return to bug 1228269