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

Commit 290b421f authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'fix/hda' into topic/hda

parents 356aab7d 46724c2e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -5532,6 +5532,7 @@ F: include/media/*7146*

SAMSUNG AUDIO (ASoC) DRIVERS
M:	Jassi Brar <jassisinghbrar@gmail.com>
M:	Sangbeom Kim <sbkim73@samsung.com>
L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
S:	Supported
F:	sound/soc/samsung
@@ -7199,6 +7200,9 @@ W: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices
S:	Supported
F:	Documentation/hwmon/wm83??
F:	drivers/leds/leds-wm83*.c
F:	drivers/input/misc/wm831x-on.c
F:	drivers/input/touchscreen/wm831x-ts.c
F:	drivers/input/touchscreen/wm97*.c
F:	drivers/mfd/wm8*.c
F:	drivers/power/wm83*.c
F:	drivers/rtc/rtc-wm83*.c
@@ -7208,6 +7212,7 @@ F: drivers/watchdog/wm83*_wdt.c
F:	include/linux/mfd/wm831x/
F:	include/linux/mfd/wm8350/
F:	include/linux/mfd/wm8400*
F:	include/linux/wm97xx.h
F:	include/sound/wm????.h
F:	sound/soc/codecs/wm*

+24 −9
Original line number Diff line number Diff line
@@ -1761,6 +1761,10 @@ static int wait_for_avail(struct snd_pcm_substream *substream,
	snd_pcm_uframes_t avail = 0;
	long wait_time, tout;

	init_waitqueue_entry(&wait, current);
	set_current_state(TASK_INTERRUPTIBLE);
	add_wait_queue(&runtime->tsleep, &wait);

	if (runtime->no_period_wakeup)
		wait_time = MAX_SCHEDULE_TIMEOUT;
	else {
@@ -1771,16 +1775,32 @@ static int wait_for_avail(struct snd_pcm_substream *substream,
		}
		wait_time = msecs_to_jiffies(wait_time * 1000);
	}
	init_waitqueue_entry(&wait, current);
	add_wait_queue(&runtime->tsleep, &wait);

	for (;;) {
		if (signal_pending(current)) {
			err = -ERESTARTSYS;
			break;
		}

		/*
		 * We need to check if space became available already
		 * (and thus the wakeup happened already) first to close
		 * the race of space already having become available.
		 * This check must happen after been added to the waitqueue
		 * and having current state be INTERRUPTIBLE.
		 */
		if (is_playback)
			avail = snd_pcm_playback_avail(runtime);
		else
			avail = snd_pcm_capture_avail(runtime);
		if (avail >= runtime->twake)
			break;
		snd_pcm_stream_unlock_irq(substream);
		tout = schedule_timeout_interruptible(wait_time);

		tout = schedule_timeout(wait_time);

		snd_pcm_stream_lock_irq(substream);
		set_current_state(TASK_INTERRUPTIBLE);
		switch (runtime->status->state) {
		case SNDRV_PCM_STATE_SUSPENDED:
			err = -ESTRPIPE;
@@ -1806,14 +1826,9 @@ static int wait_for_avail(struct snd_pcm_substream *substream,
			err = -EIO;
			break;
		}
		if (is_playback)
			avail = snd_pcm_playback_avail(runtime);
		else
			avail = snd_pcm_capture_avail(runtime);
		if (avail >= runtime->twake)
			break;
	}
 _endloop:
	set_current_state(TASK_RUNNING);
	remove_wait_queue(&runtime->tsleep, &wait);
	*availp = avail;
	return err;
+5 −1
Original line number Diff line number Diff line
@@ -586,9 +586,13 @@ int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux,
		return -1;
	}
	recursive++;
	for (i = 0; i < nums; i++)
	for (i = 0; i < nums; i++) {
		unsigned int type = get_wcaps_type(get_wcaps(codec, conn[i]));
		if (type == AC_WID_PIN || type == AC_WID_AUD_OUT)
			continue;
		if (snd_hda_get_conn_index(codec, conn[i], nid, recursive) >= 0)
			return i;
	}
	return -1;
}
EXPORT_SYMBOL_HDA(snd_hda_get_conn_index);
+1 −1
Original line number Diff line number Diff line
@@ -535,7 +535,7 @@ static int add_volume(struct hda_codec *codec, const char *name,
		      int index, unsigned int pval, int dir,
		      struct snd_kcontrol **kctlp)
{
	char tmp[32];
	char tmp[44];
	struct snd_kcontrol_new knew =
		HDA_CODEC_VOLUME_IDX(tmp, index, 0, 0, HDA_OUTPUT);
	knew.private_value = pval;
+27 −19
Original line number Diff line number Diff line
@@ -3329,18 +3329,26 @@ static int fill_cx_auto_dacs(struct hda_codec *codec, hda_nid_t *dacs)
/* fill pin_dac_pair list from the pin and dac list */
static int fill_dacs_for_pins(struct hda_codec *codec, hda_nid_t *pins,
			      int num_pins, hda_nid_t *dacs, int *rest,
			      struct pin_dac_pair *filled, int type)
			      struct pin_dac_pair *filled, int nums, 
			      int type)
{
	int i, nums;
	int i, start = nums;

	nums = 0;
	for (i = 0; i < num_pins; i++) {
	for (i = 0; i < num_pins; i++, nums++) {
		filled[nums].pin = pins[i];
		filled[nums].type = type;
		filled[nums].dac = get_unassigned_dac(codec, pins[i], dacs, rest);
		if (!filled[nums].dac && i > 0 && filled[0].dac)
		if (filled[nums].dac) 
			continue;
		if (filled[start].dac && get_connection_index(codec, pins[i], filled[start].dac) >= 0) {
			filled[nums].dac = filled[start].dac | DAC_SLAVE_FLAG;
			continue;
		}
		if (filled[0].dac && get_connection_index(codec, pins[i], filled[0].dac) >= 0) {
			filled[nums].dac = filled[0].dac | DAC_SLAVE_FLAG;
		nums++;
			continue;
		}
		snd_printdd("Failed to find a DAC for pin 0x%x", pins[i]);
	}
	return nums;
}
@@ -3356,13 +3364,13 @@ static void cx_auto_parse_output(struct hda_codec *codec)
	rest = fill_cx_auto_dacs(codec, dacs);
	/* parse all analog output pins */
	nums = fill_dacs_for_pins(codec, cfg->line_out_pins, cfg->line_outs,
				  dacs, &rest, spec->dac_info,
			  dacs, &rest, spec->dac_info, 0,
			  AUTO_PIN_LINE_OUT);
	nums += fill_dacs_for_pins(codec, cfg->hp_pins, cfg->hp_outs,
				  dacs, &rest, spec->dac_info + nums,
	nums = fill_dacs_for_pins(codec, cfg->hp_pins, cfg->hp_outs,
			  dacs, &rest, spec->dac_info, nums,
			  AUTO_PIN_HP_OUT);
	nums += fill_dacs_for_pins(codec, cfg->speaker_pins, cfg->speaker_outs,
				  dacs, &rest, spec->dac_info + nums,
	nums = fill_dacs_for_pins(codec, cfg->speaker_pins, cfg->speaker_outs,
			  dacs, &rest, spec->dac_info, nums,
			  AUTO_PIN_SPEAKER_OUT);
	spec->dac_info_filled = nums;
	/* fill multiout struct */
@@ -4130,9 +4138,11 @@ static int try_add_pb_volume(struct hda_codec *codec, hda_nid_t dac,
			     hda_nid_t pin, const char *name, int idx)
{
	unsigned int caps;
	if (dac && !(dac & DAC_SLAVE_FLAG)) {
		caps = query_amp_caps(codec, dac, HDA_OUTPUT);
		if (caps & AC_AMPCAP_NUM_STEPS)
			return cx_auto_add_pb_volume(codec, dac, name, idx);
	}
	caps = query_amp_caps(codec, pin, HDA_OUTPUT);
	if (caps & AC_AMPCAP_NUM_STEPS)
		return cx_auto_add_pb_volume(codec, pin, name, idx);
@@ -4155,8 +4165,6 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
		const char *label;
		int idx, type;
		hda_nid_t dac = spec->dac_info[i].dac;
		if (!dac || (dac & DAC_SLAVE_FLAG))
			continue;
		type = spec->dac_info[i].type;
		if (type == AUTO_PIN_LINE_OUT)
			type = spec->autocfg.line_out_type;
Loading