Commit 2ae048e1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "A collection of small fixes.

   - The optimization of PM resume with HD-audio HDMI codecs, which
     eventually work around weird issues

   - A correction of Intel Icelake HDMI audio code

   - Quirks for Dell machines with Realtek HD-audio codecs

   - The fix for too long sequencer write stall that was spotted by
     syzkaller

   - A few trivial cleanups reported by coccinelle"

* tag 'sound-fix-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Don't resume forcibly i915 HDMI/DP codec
  ALSA: hda/hdmi - Fix i915 reverse port/pin mapping
  ALSA: hda/hdmi - Remove duplicated define
  ALSA: seq: Break too long mutex context in the write loop
  ALSA: hda/realtek: apply ALC891 headset fixup to one Dell machine
  ALSA: rme9652: Unneeded variable: "result".
  ALSA: emu10k1: Remove unneeded variable "change"
  ALSA: au88x0: Remove unneeded variable: "changed"
  ALSA: hda/realtek - Fixed Headphone Mic can't record on Dell platform
  ALSA: ps3: Remove Unneeded variable: "ret"
  ALSA: lx6464es: Remove unneeded variable err
parents d0411ec8 4914da2f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -252,6 +252,8 @@ struct hda_codec {
	unsigned int auto_runtime_pm:1; /* enable automatic codec runtime pm */
	unsigned int force_pin_prefix:1; /* Add location prefix */
	unsigned int link_down_at_suspend:1; /* link down at runtime suspend */
	unsigned int relaxed_resume:1;	/* don't resume forcibly for jack */

#ifdef CONFIG_PM
	unsigned long power_on_acct;
	unsigned long power_off_acct;
+10 −1
Original line number Diff line number Diff line
@@ -1021,7 +1021,7 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,
{
	struct snd_seq_client *client = file->private_data;
	int written = 0, len;
	int err;
	int err, handled;
	struct snd_seq_event event;

	if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT))
@@ -1034,6 +1034,8 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,
	if (!client->accept_output || client->pool == NULL)
		return -ENXIO;

 repeat:
	handled = 0;
	/* allocate the pool now if the pool is not allocated yet */ 
	mutex_lock(&client->ioctl_mutex);
	if (client->pool->size > 0 && !snd_seq_write_pool_allocated(client)) {
@@ -1093,12 +1095,19 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,
						   0, 0, &client->ioctl_mutex);
		if (err < 0)
			break;
		handled++;

	__skip_event:
		/* Update pointers and counts */
		count -= len;
		buf += len;
		written += len;

		/* let's have a coffee break if too many events are queued */
		if (++handled >= 200) {
			mutex_unlock(&client->ioctl_mutex);
			goto repeat;
		}
	}

 out:
+7 −8
Original line number Diff line number Diff line
@@ -765,7 +765,7 @@ snd_vortex_a3d_hrtf_put(struct snd_kcontrol *kcontrol,
			struct snd_ctl_elem_value *ucontrol)
{
	a3dsrc_t *a = kcontrol->private_data;
	int changed = 1, i;
	int i;
	int coord[6];
	for (i = 0; i < 6; i++)
		coord[i] = ucontrol->value.integer.value[i];
@@ -774,7 +774,7 @@ snd_vortex_a3d_hrtf_put(struct snd_kcontrol *kcontrol,
	vortex_a3d_coord2hrtf(a->hrtf[1], coord);
	a3dsrc_SetHrtfTarget(a, a->hrtf[0], a->hrtf[1]);
	a3dsrc_SetHrtfCurrent(a, a->hrtf[0], a->hrtf[1]);
	return changed;
	return 1;
}

static int
@@ -783,7 +783,7 @@ snd_vortex_a3d_itd_put(struct snd_kcontrol *kcontrol,
{
	a3dsrc_t *a = kcontrol->private_data;
	int coord[6];
	int i, changed = 1;
	int i;
	for (i = 0; i < 6; i++)
		coord[i] = ucontrol->value.integer.value[i];
	/* Translate orientation coordinates to a3d params. */
@@ -793,7 +793,7 @@ snd_vortex_a3d_itd_put(struct snd_kcontrol *kcontrol,
	a3dsrc_SetItdTarget(a, a->itd[0], a->itd[1]);
	a3dsrc_SetItdCurrent(a, a->itd[0], a->itd[1]);
	a3dsrc_SetItdDline(a, a->dline);
	return changed;
	return 1;
}

static int
@@ -801,7 +801,6 @@ snd_vortex_a3d_ild_put(struct snd_kcontrol *kcontrol,
		       struct snd_ctl_elem_value *ucontrol)
{
	a3dsrc_t *a = kcontrol->private_data;
	int changed = 1;
	int l, r;
	/* There may be some scale tranlation needed here. */
	l = ucontrol->value.integer.value[0];
@@ -810,7 +809,7 @@ snd_vortex_a3d_ild_put(struct snd_kcontrol *kcontrol,
	/* Left Right panning. */
	a3dsrc_SetGainTarget(a, l, r);
	a3dsrc_SetGainCurrent(a, l, r);
	return changed;
	return 1;
}

static int
@@ -818,7 +817,7 @@ snd_vortex_a3d_filter_put(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
{
	a3dsrc_t *a = kcontrol->private_data;
	int i, changed = 1;
	int i;
	int params[6];
	for (i = 0; i < 6; i++)
		params[i] = ucontrol->value.integer.value[i];
@@ -831,7 +830,7 @@ snd_vortex_a3d_filter_put(struct snd_kcontrol *kcontrol,
	a3dsrc_SetAtmosCurrent(a, a->filter[0],
			       a->filter[1], a->filter[2],
			       a->filter[3], a->filter[4]);
	return changed;
	return 1;
}

static const struct snd_kcontrol_new vortex_a3d_kcontrol = {
+1 −2
Original line number Diff line number Diff line
@@ -1074,7 +1074,6 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol,
{
	struct emu10k1x *emu = snd_kcontrol_chip(kcontrol);
	unsigned int val;
	int change = 0;

	val = ucontrol->value.integer.value[0] ;

@@ -1089,7 +1088,7 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol,
		snd_emu10k1x_ptr_write(emu, ROUTING, 0, 0x1003F);
		snd_emu10k1x_gpio_write(emu, 0x1080);
	}
	return change;
	return 0;
}

static const struct snd_kcontrol_new snd_emu10k1x_shared_spdif =
+6 −2
Original line number Diff line number Diff line
@@ -2941,14 +2941,18 @@ static int hda_codec_runtime_resume(struct device *dev)
#ifdef CONFIG_PM_SLEEP
static int hda_codec_force_resume(struct device *dev)
{
	struct hda_codec *codec = dev_to_hda_codec(dev);
	bool forced_resume = !codec->relaxed_resume;
	int ret;

	/* The get/put pair below enforces the runtime resume even if the
	 * device hasn't been used at suspend time.  This trick is needed to
	 * update the jack state change during the sleep.
	 */
	if (forced_resume)
		pm_runtime_get_noresume(dev);
	ret = pm_runtime_force_resume(dev);
	if (forced_resume)
		pm_runtime_put(dev);
	return ret;
}
Loading