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

Commit 7b09ac70 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "This is a collection of many small fixes.  Most of fixes are for ASoC
  drivers, including the fixes of wrong field usages for boolean kctls.

  In addition, there is a fix in ASoC core for adding proper locks for
  component lists, and a fix for a HD-audio regression by the previous
  mono channel fix"

* tag 'sound-4.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits)
  ALSA: hda - Treat stereo-to-mono mix properly
  ASoC: wm9713: Fix wrong value references for boolean kctl
  ASoC: wm9712: Fix wrong value references for boolean kctl
  ASoC: wm8960: Fix wrong value references for boolean kctl
  ASoC: wm8955: Fix wrong value references for boolean kctl
  ASoC: wm8904: Fix wrong value references for boolean kctl
  ASoC: wm8903: Fix wrong value references for boolean kctl
  ASoC: wm8731: Fix wrong value references for boolean kctl
  ASoC: wm2000: Fix wrong value references for boolean kctl
  ASoC: tas5086: Fix wrong value references for boolean kctl
  ASoC: pcm1681: Fix wrong value references for boolean kctl
  ASoC: es8238: Fix wrong value references for boolean kctl
  ASoC: cs4271: Fix wrong value references for boolean kctl
  ASoC: ak4641: Fix wrong value references for boolean kctl
  ASoC: adav80x: Fix wrong value references for boolean kctl
  ASoC: Fix component lists locking
  ASoC: Intel: remove conflicts when load/unload multiple firmware images
  ASoC: rt286: Change the DMI mapping for Dino
  ASoC: sgtl5000: remove useless register write clearing CHRGPUMP_POWERUP
  ASoC: fsl_ssi: Don't try to round-up for PM divisor calculation
  ...
parents ec3fbff0 3fc6c5a1
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -687,13 +687,30 @@ static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid,
	return val;
}

/* is this a stereo widget or a stereo-to-mono mix? */
static bool is_stereo_amps(struct hda_codec *codec, hda_nid_t nid, int dir)
{
	unsigned int wcaps = get_wcaps(codec, nid);
	hda_nid_t conn;

	if (wcaps & AC_WCAP_STEREO)
		return true;
	if (dir != HDA_INPUT || get_wcaps_type(wcaps) != AC_WID_AUD_MIX)
		return false;
	if (snd_hda_get_num_conns(codec, nid) != 1)
		return false;
	if (snd_hda_get_connections(codec, nid, &conn, 1) < 0)
		return false;
	return !!(get_wcaps(codec, conn) & AC_WCAP_STEREO);
}

/* initialize the amp value (only at the first time) */
static void init_amp(struct hda_codec *codec, hda_nid_t nid, int dir, int idx)
{
	unsigned int caps = query_amp_caps(codec, nid, dir);
	int val = get_amp_val_to_activate(codec, nid, dir, caps, false);

	if (get_wcaps(codec, nid) & AC_WCAP_STEREO)
	if (is_stereo_amps(codec, nid, dir))
		snd_hda_codec_amp_init_stereo(codec, nid, dir, idx, 0xff, val);
	else
		snd_hda_codec_amp_init(codec, nid, 0, dir, idx, 0xff, val);
@@ -703,7 +720,7 @@ static void init_amp(struct hda_codec *codec, hda_nid_t nid, int dir, int idx)
static int update_amp(struct hda_codec *codec, hda_nid_t nid, int dir, int idx,
		      unsigned int mask, unsigned int val)
{
	if (get_wcaps(codec, nid) & AC_WCAP_STEREO)
	if (is_stereo_amps(codec, nid, dir))
		return snd_hda_codec_amp_stereo(codec, nid, dir, idx,
						mask, val);
	else
+30 −8
Original line number Diff line number Diff line
@@ -134,13 +134,38 @@ static void print_amp_caps(struct snd_info_buffer *buffer,
		    (caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT);
}

/* is this a stereo widget or a stereo-to-mono mix? */
static bool is_stereo_amps(struct hda_codec *codec, hda_nid_t nid,
			   int dir, unsigned int wcaps, int indices)
{
	hda_nid_t conn;

	if (wcaps & AC_WCAP_STEREO)
		return true;
	/* check for a stereo-to-mono mix; it must be:
	 * only a single connection, only for input, and only a mixer widget
	 */
	if (indices != 1 || dir != HDA_INPUT ||
	    get_wcaps_type(wcaps) != AC_WID_AUD_MIX)
		return false;

	if (snd_hda_get_raw_connections(codec, nid, &conn, 1) < 0)
		return false;
	/* the connection source is a stereo? */
	wcaps = snd_hda_param_read(codec, conn, AC_PAR_AUDIO_WIDGET_CAP);
	return !!(wcaps & AC_WCAP_STEREO);
}

static void print_amp_vals(struct snd_info_buffer *buffer,
			   struct hda_codec *codec, hda_nid_t nid,
			   int dir, int stereo, int indices)
			   int dir, unsigned int wcaps, int indices)
{
	unsigned int val;
	bool stereo;
	int i;

	stereo = is_stereo_amps(codec, nid, dir, wcaps, indices);

	dir = dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT;
	for (i = 0; i < indices; i++) {
		snd_iprintf(buffer, " [");
@@ -757,12 +782,10 @@ static void print_codec_info(struct snd_info_entry *entry,
			    (codec->single_adc_amp &&
			     wid_type == AC_WID_AUD_IN))
				print_amp_vals(buffer, codec, nid, HDA_INPUT,
					       wid_caps & AC_WCAP_STEREO,
					       1);
					       wid_caps, 1);
			else
				print_amp_vals(buffer, codec, nid, HDA_INPUT,
					       wid_caps & AC_WCAP_STEREO,
					       conn_len);
					       wid_caps, conn_len);
		}
		if (wid_caps & AC_WCAP_OUT_AMP) {
			snd_iprintf(buffer, "  Amp-Out caps: ");
@@ -771,11 +794,10 @@ static void print_codec_info(struct snd_info_entry *entry,
			if (wid_type == AC_WID_PIN &&
			    codec->pin_amp_workaround)
				print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
					       wid_caps & AC_WCAP_STEREO,
					       conn_len);
					       wid_caps, conn_len);
			else
				print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
					       wid_caps & AC_WCAP_STEREO, 1);
					       wid_caps, 1);
		}

		switch (wid_type) {
+2 −2
Original line number Diff line number Diff line
@@ -317,7 +317,7 @@ static int adav80x_put_deemph(struct snd_kcontrol *kcontrol,
{
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
	struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
	unsigned int deemph = ucontrol->value.enumerated.item[0];
	unsigned int deemph = ucontrol->value.integer.value[0];

	if (deemph > 1)
		return -EINVAL;
@@ -333,7 +333,7 @@ static int adav80x_get_deemph(struct snd_kcontrol *kcontrol,
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
	struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);

	ucontrol->value.enumerated.item[0] = adav80x->deemph;
	ucontrol->value.integer.value[0] = adav80x->deemph;
	return 0;
};

+2 −2
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ static int ak4641_put_deemph(struct snd_kcontrol *kcontrol,
{
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
	struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);
	int deemph = ucontrol->value.enumerated.item[0];
	int deemph = ucontrol->value.integer.value[0];

	if (deemph > 1)
		return -EINVAL;
@@ -92,7 +92,7 @@ static int ak4641_get_deemph(struct snd_kcontrol *kcontrol,
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
	struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);

	ucontrol->value.enumerated.item[0] = ak4641->deemph;
	ucontrol->value.integer.value[0] = ak4641->deemph;
	return 0;
};

+22 −22
Original line number Diff line number Diff line
@@ -343,25 +343,25 @@ static const struct snd_soc_dapm_widget ak4671_dapm_widgets[] = {
};

static const struct snd_soc_dapm_route ak4671_intercon[] = {
	{"DAC Left", "NULL", "PMPLL"},
	{"DAC Right", "NULL", "PMPLL"},
	{"ADC Left", "NULL", "PMPLL"},
	{"ADC Right", "NULL", "PMPLL"},
	{"DAC Left", NULL, "PMPLL"},
	{"DAC Right", NULL, "PMPLL"},
	{"ADC Left", NULL, "PMPLL"},
	{"ADC Right", NULL, "PMPLL"},

	/* Outputs */
	{"LOUT1", "NULL", "LOUT1 Mixer"},
	{"ROUT1", "NULL", "ROUT1 Mixer"},
	{"LOUT2", "NULL", "LOUT2 Mix Amp"},
	{"ROUT2", "NULL", "ROUT2 Mix Amp"},
	{"LOUT3", "NULL", "LOUT3 Mixer"},
	{"ROUT3", "NULL", "ROUT3 Mixer"},
	{"LOUT1", NULL, "LOUT1 Mixer"},
	{"ROUT1", NULL, "ROUT1 Mixer"},
	{"LOUT2", NULL, "LOUT2 Mix Amp"},
	{"ROUT2", NULL, "ROUT2 Mix Amp"},
	{"LOUT3", NULL, "LOUT3 Mixer"},
	{"ROUT3", NULL, "ROUT3 Mixer"},

	{"LOUT1 Mixer", "DACL", "DAC Left"},
	{"ROUT1 Mixer", "DACR", "DAC Right"},
	{"LOUT2 Mixer", "DACHL", "DAC Left"},
	{"ROUT2 Mixer", "DACHR", "DAC Right"},
	{"LOUT2 Mix Amp", "NULL", "LOUT2 Mixer"},
	{"ROUT2 Mix Amp", "NULL", "ROUT2 Mixer"},
	{"LOUT2 Mix Amp", NULL, "LOUT2 Mixer"},
	{"ROUT2 Mix Amp", NULL, "ROUT2 Mixer"},
	{"LOUT3 Mixer", "DACSL", "DAC Left"},
	{"ROUT3 Mixer", "DACSR", "DAC Right"},

@@ -381,18 +381,18 @@ static const struct snd_soc_dapm_route ak4671_intercon[] = {
	{"LIN2", NULL, "Mic Bias"},
	{"RIN2", NULL, "Mic Bias"},

	{"ADC Left", "NULL", "LIN MUX"},
	{"ADC Right", "NULL", "RIN MUX"},
	{"ADC Left", NULL, "LIN MUX"},
	{"ADC Right", NULL, "RIN MUX"},

	/* Analog Loops */
	{"LIN1 Mixing Circuit", "NULL", "LIN1"},
	{"RIN1 Mixing Circuit", "NULL", "RIN1"},
	{"LIN2 Mixing Circuit", "NULL", "LIN2"},
	{"RIN2 Mixing Circuit", "NULL", "RIN2"},
	{"LIN3 Mixing Circuit", "NULL", "LIN3"},
	{"RIN3 Mixing Circuit", "NULL", "RIN3"},
	{"LIN4 Mixing Circuit", "NULL", "LIN4"},
	{"RIN4 Mixing Circuit", "NULL", "RIN4"},
	{"LIN1 Mixing Circuit", NULL, "LIN1"},
	{"RIN1 Mixing Circuit", NULL, "RIN1"},
	{"LIN2 Mixing Circuit", NULL, "LIN2"},
	{"RIN2 Mixing Circuit", NULL, "RIN2"},
	{"LIN3 Mixing Circuit", NULL, "LIN3"},
	{"RIN3 Mixing Circuit", NULL, "RIN3"},
	{"LIN4 Mixing Circuit", NULL, "LIN4"},
	{"RIN4 Mixing Circuit", NULL, "RIN4"},

	{"LOUT1 Mixer", "LINL1", "LIN1 Mixing Circuit"},
	{"ROUT1 Mixer", "RINR1", "RIN1 Mixing Circuit"},
Loading