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

Commit 0d25e369 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "Again only fixes for HD-audio:
   - regression fixes due to the modularization
   - a few fixups for Dell, Sony and HP laptops
   - a revert of the previous fix as it leads to another regression"

* tag 'sound-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X"
  ALSA: hda - Fix undefined symbol due to builtin/module mixup
  ALSA: hda - Fix mic capture on Sony VAIO Pro 11
  ALSA: hda - Add a headset quirk for Dell XPS 13
  ALSA: hda - Fix inconsistent Mic mute LED
  ALSA: hda - Fix leftover ifdef checks after modularization
parents e8478828 2078600b
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -932,7 +932,7 @@ int snd_hda_bus_new(struct snd_card *card,
}
EXPORT_SYMBOL_GPL(snd_hda_bus_new);

#ifdef CONFIG_SND_HDA_GENERIC
#if IS_ENABLED(CONFIG_SND_HDA_GENERIC)
#define is_generic_config(codec) \
	(codec->modelname && !strcmp(codec->modelname, "generic"))
#else
@@ -1339,24 +1339,16 @@ get_hda_cvt_setup(struct hda_codec *codec, hda_nid_t nid)
/*
 * Dynamic symbol binding for the codec parsers
 */
#ifdef MODULE
#define load_parser_sym(sym)		((int (*)(struct hda_codec *))symbol_request(sym))
#define unload_parser_addr(addr)	symbol_put_addr(addr)
#else
#define load_parser_sym(sym)		(sym)
#define unload_parser_addr(addr)	do {} while (0)
#endif

#define load_parser(codec, sym) \
	((codec)->parser = load_parser_sym(sym))
	((codec)->parser = (int (*)(struct hda_codec *))symbol_request(sym))

static void unload_parser(struct hda_codec *codec)
{
	if (codec->parser) {
		unload_parser_addr(codec->parser);
	if (codec->parser)
		symbol_put_addr(codec->parser);
	codec->parser = NULL;
}
}

/*
 * codec destructor
@@ -1570,7 +1562,7 @@ int snd_hda_codec_update_widgets(struct hda_codec *codec)
EXPORT_SYMBOL_GPL(snd_hda_codec_update_widgets);


#ifdef CONFIG_SND_HDA_CODEC_HDMI
#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI)
/* if all audio out widgets are digital, let's assume the codec as a HDMI/DP */
static bool is_likely_hdmi_codec(struct hda_codec *codec)
{
@@ -1620,12 +1612,20 @@ int snd_hda_codec_configure(struct hda_codec *codec)
		patch = codec->preset->patch;
	if (!patch) {
		unload_parser(codec); /* to be sure */
		if (is_likely_hdmi_codec(codec))
		if (is_likely_hdmi_codec(codec)) {
#if IS_MODULE(CONFIG_SND_HDA_CODEC_HDMI)
			patch = load_parser(codec, snd_hda_parse_hdmi_codec);
#ifdef CONFIG_SND_HDA_GENERIC
		if (!patch)
#elif IS_BUILTIN(CONFIG_SND_HDA_CODEC_HDMI)
			patch = snd_hda_parse_hdmi_codec;
#endif
		}
		if (!patch) {
#if IS_MODULE(CONFIG_SND_HDA_GENERIC)
			patch = load_parser(codec, snd_hda_parse_generic_codec);
#elif IS_BUILTIN(CONFIG_SND_HDA_GENERIC)
			patch = snd_hda_parse_generic_codec;
#endif
		}
		if (!patch) {
			printk(KERN_ERR "hda-codec: No codec parser is available\n");
			return -ENODEV;
+4 −4
Original line number Diff line number Diff line
@@ -3269,7 +3269,7 @@ static int cap_put_caller(struct snd_kcontrol *kcontrol,
	mutex_unlock(&codec->control_mutex);
	snd_hda_codec_flush_cache(codec); /* flush the updates */
	if (err >= 0 && spec->cap_sync_hook)
		spec->cap_sync_hook(codec, ucontrol);
		spec->cap_sync_hook(codec, kcontrol, ucontrol);
	return err;
}

@@ -3390,7 +3390,7 @@ static int cap_single_sw_put(struct snd_kcontrol *kcontrol,
		return ret;

	if (spec->cap_sync_hook)
		spec->cap_sync_hook(codec, ucontrol);
		spec->cap_sync_hook(codec, kcontrol, ucontrol);

	return ret;
}
@@ -3795,7 +3795,7 @@ static int mux_select(struct hda_codec *codec, unsigned int adc_idx,
		return 0;
	snd_hda_activate_path(codec, path, true, false);
	if (spec->cap_sync_hook)
		spec->cap_sync_hook(codec, NULL);
		spec->cap_sync_hook(codec, NULL, NULL);
	path_power_down_sync(codec, old_path);
	return 1;
}
@@ -5270,7 +5270,7 @@ static void init_input_src(struct hda_codec *codec)
	}

	if (spec->cap_sync_hook)
		spec->cap_sync_hook(codec, NULL);
		spec->cap_sync_hook(codec, NULL, NULL);
}

/* set right pin controls for digital I/O */
+1 −0
Original line number Diff line number Diff line
@@ -274,6 +274,7 @@ struct hda_gen_spec {
	void (*init_hook)(struct hda_codec *codec);
	void (*automute_hook)(struct hda_codec *codec);
	void (*cap_sync_hook)(struct hda_codec *codec,
			      struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_value *ucontrol);

	/* PCM hooks */
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ MODULE_DESCRIPTION("Intel HDA driver");
#endif

#if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO)
#ifdef CONFIG_SND_HDA_CODEC_HDMI
#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI)
#define SUPPORT_VGA_SWITCHEROO
#endif
#endif
+2 −1
Original line number Diff line number Diff line
@@ -3291,6 +3291,7 @@ static void cxt_update_headset_mode(struct hda_codec *codec)
}

static void cxt_update_headset_mode_hook(struct hda_codec *codec,
					 struct snd_kcontrol *kcontrol,
					 struct snd_ctl_elem_value *ucontrol)
{
	cxt_update_headset_mode(codec);
Loading