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

Commit fe10e6f4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: usb-audio: Use kmemdup rather than duplicating its implementation
  ALSA: hda - Re-enable the check NO_PRESENCE misc bit
  ALSA: vmaster - Free slave-links when freeing the master element
  ALSA: hda - Don't add elements of other codecs to vmaster slave
  ALSA: intel8x0: improve virtual environment detection
  ALSA: intel8x0: move virtual environment detection code into one place
  ALSA: snd_usb_audio: add Logitech HD Webcam c510 to quirk-384
  ALSA: hda - fix internal mic on Dell Vostro 3500 laptop
  ALSA: HDA: Remove quirk for Toshiba T110
  ALSA: usb-audio - Fix the missing volume quirks at delayed init
  ALSA: hda - Mute unused capture sources for Realtek codecs
  ALSA: intel8x0: Improve comments for VM optimization
  ASoC: Ensure we get an impedence reported for WM8958 jack detect
  ASoC: Don't use wm8994->control_data when requesting IRQs
  ASoC: Don't use wm8994->control_data in wm8994_readable_register()
  ASoC: Update git repository URL
parents f28ad3b4 d938e660
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -349,6 +349,7 @@ STAC92HD83*
  ref		Reference board
  mic-ref	Reference board with power management for ports
  dell-s14	Dell laptop
  dell-vostro-3500	Dell Vostro 3500 laptop
  hp		HP laptops with (inverted) mute-LED
  hp-dv7-4000	HP dv-7 4000
  auto		BIOS setup (default)
+1 −1
Original line number Diff line number Diff line
@@ -6129,7 +6129,7 @@ F: sound/
SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
M:	Liam Girdwood <lrg@ti.com>
M:	Mark Brown <broonie@opensource.wolfsonmicro.com>
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
W:	http://alsa-project.org/main/index.php/ASoC
S:	Supported
+15 −0
Original line number Diff line number Diff line
@@ -1962,6 +1962,21 @@
#define WM8958_MICB2_DISCH_SHIFT                     0  /* MICB2_DISCH */
#define WM8958_MICB2_DISCH_WIDTH                     1  /* MICB2_DISCH */

/*
 * R210 (0xD2) - Mic Detect 3
 */
#define WM8958_MICD_LVL_MASK                    0x07FC  /* MICD_LVL - [10:2] */
#define WM8958_MICD_LVL_SHIFT                        2  /* MICD_LVL - [10:2] */
#define WM8958_MICD_LVL_WIDTH                        9  /* MICD_LVL - [10:2] */
#define WM8958_MICD_VALID                       0x0002  /* MICD_VALID */
#define WM8958_MICD_VALID_MASK                  0x0002  /* MICD_VALID */
#define WM8958_MICD_VALID_SHIFT                      1  /* MICD_VALID */
#define WM8958_MICD_VALID_WIDTH                      1  /* MICD_VALID */
#define WM8958_MICD_STS                         0x0001  /* MICD_STS */
#define WM8958_MICD_STS_MASK                    0x0001  /* MICD_STS */
#define WM8958_MICD_STS_SHIFT                        0  /* MICD_STS */
#define WM8958_MICD_STS_WIDTH                        1  /* MICD_STS */

/*
 * R76 (0x4C) - Charge Pump (1)
 */
+14 −4
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ struct link_slave {
	struct link_ctl_info info;
	int vals[2];		/* current values */
	unsigned int flags;
	struct snd_kcontrol *kctl; /* original kcontrol pointer */
	struct snd_kcontrol slave; /* the copy of original control entry */
};

@@ -252,6 +253,7 @@ int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave,
		       slave->count * sizeof(*slave->vd), GFP_KERNEL);
	if (!srec)
		return -ENOMEM;
	srec->kctl = slave;
	srec->slave = *slave;
	memcpy(srec->slave.vd, slave->vd, slave->count * sizeof(*slave->vd));
	srec->master = master_link;
@@ -333,10 +335,18 @@ static int master_put(struct snd_kcontrol *kcontrol,
static void master_free(struct snd_kcontrol *kcontrol)
{
	struct link_master *master = snd_kcontrol_chip(kcontrol);
	struct link_slave *slave;

	list_for_each_entry(slave, &master->slaves, list)
		slave->master = NULL;
	struct link_slave *slave, *n;

	/* free all slave links and retore the original slave kctls */
	list_for_each_entry_safe(slave, n, &master->slaves, list) {
		struct snd_kcontrol *sctl = slave->kctl;
		struct list_head olist = sctl->list;
		memcpy(sctl, &slave->slave, sizeof(*sctl));
		memcpy(sctl->vd, slave->slave.vd,
		       sctl->count * sizeof(*sctl->vd));
		sctl->list = olist; /* keep the current linked-list */
		kfree(slave);
	}
	kfree(master);
}

+43 −21
Original line number Diff line number Diff line
@@ -2331,6 +2331,39 @@ int snd_hda_codec_reset(struct hda_codec *codec)
	return 0;
}

typedef int (*map_slave_func_t)(void *, struct snd_kcontrol *);

/* apply the function to all matching slave ctls in the mixer list */
static int map_slaves(struct hda_codec *codec, const char * const *slaves,
		      map_slave_func_t func, void *data) 
{
	struct hda_nid_item *items;
	const char * const *s;
	int i, err;

	items = codec->mixers.list;
	for (i = 0; i < codec->mixers.used; i++) {
		struct snd_kcontrol *sctl = items[i].kctl;
		if (!sctl || !sctl->id.name ||
		    sctl->id.iface != SNDRV_CTL_ELEM_IFACE_MIXER)
			continue;
		for (s = slaves; *s; s++) {
			if (!strcmp(sctl->id.name, *s)) {
				err = func(data, sctl);
				if (err)
					return err;
				break;
			}
		}
	}
	return 0;
}

static int check_slave_present(void *data, struct snd_kcontrol *sctl)
{
	return 1;
}

/**
 * snd_hda_add_vmaster - create a virtual master control and add slaves
 * @codec: HD-audio codec
@@ -2351,12 +2384,10 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
			unsigned int *tlv, const char * const *slaves)
{
	struct snd_kcontrol *kctl;
	const char * const *s;
	int err;

	for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++)
		;
	if (!*s) {
	err = map_slaves(codec, slaves, check_slave_present, NULL);
	if (err != 1) {
		snd_printdd("No slave found for %s\n", name);
		return 0;
	}
@@ -2367,23 +2398,10 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
	if (err < 0)
		return err;

	for (s = slaves; *s; s++) {
		struct snd_kcontrol *sctl;
		int i = 0;
		for (;;) {
			sctl = _snd_hda_find_mixer_ctl(codec, *s, i);
			if (!sctl) {
				if (!i)
					snd_printdd("Cannot find slave %s, "
						    "skipped\n", *s);
				break;
			}
			err = snd_ctl_add_slave(kctl, sctl);
	err = map_slaves(codec, slaves, (map_slave_func_t)snd_ctl_add_slave,
			 kctl);
	if (err < 0)
		return err;
			i++;
		}
	}
	return 0;
}
EXPORT_SYMBOL_HDA(snd_hda_add_vmaster);
@@ -4752,6 +4770,7 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
	memset(sequences_hp, 0, sizeof(sequences_hp));
	assoc_line_out = 0;

	codec->ignore_misc_bit = true;
	end_nid = codec->start_nid + codec->num_nodes;
	for (nid = codec->start_nid; nid < end_nid; nid++) {
		unsigned int wid_caps = get_wcaps(codec, nid);
@@ -4767,6 +4786,9 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
			continue;

		def_conf = snd_hda_codec_get_pincfg(codec, nid);
		if (!(get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) &
		      AC_DEFCFG_MISC_NO_PRESENCE))
			codec->ignore_misc_bit = false;
		conn = get_defcfg_connect(def_conf);
		if (conn == AC_JACK_PORT_NONE)
			continue;
Loading