Commit c5364190 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "Just a collection of small fixes around this time:

   - One more try for fixing PCM OSS regression

   - HD-audio: a new quirk for Lenovo, the improved driver blacklisting,
     a lock fix in the minor error path, and a fix for the possible race
     at monitor notifiaction

   - USB-audio: a quirk ID fix, a fix for POD HD500 workaround"

* tag 'sound-5.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: usb-audio: Correct a typo of NuPrime DAC-10 USB ID
  ALSA: opti9xx: shut up gcc-10 range warning
  ALSA: hda/hdmi: fix without unlocked before return
  ALSA: hda/hdmi: fix race in monitor detection during probe
  ALSA: hda/realtek - Two front mics on a Lenovo ThinkCenter
  ALSA: line6: Fix POD HD500 audio playback
  ALSA: pcm: oss: Place the plugin buffer overflow checks correctly (for 5.7)
  ALSA: pcm: oss: Place the plugin buffer overflow checks correctly
  ALSA: hda: Match both PCI ID and SSID for driver blacklist
parents 477bfeb9 547d2c9c
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -205,13 +205,14 @@ static snd_pcm_sframes_t calc_dst_frames(struct snd_pcm_substream *plug,
	plugin = snd_pcm_plug_first(plug);
	while (plugin && frames > 0) {
		plugin_next = plugin->next;
		if (check_size && plugin->buf_frames &&
		    frames > plugin->buf_frames)
			frames = plugin->buf_frames;
		if (plugin->dst_frames) {
			frames = plugin->dst_frames(plugin, frames);
			if (frames < 0)
				return frames;
		}
		if (check_size && frames > plugin->buf_frames)
			frames = plugin->buf_frames;
		plugin = plugin_next;
	}
	return frames;
@@ -225,14 +226,15 @@ static snd_pcm_sframes_t calc_src_frames(struct snd_pcm_substream *plug,

	plugin = snd_pcm_plug_last(plug);
	while (plugin && frames > 0) {
		if (check_size && frames > plugin->buf_frames)
			frames = plugin->buf_frames;
		plugin_prev = plugin->prev;
		if (plugin->src_frames) {
			frames = plugin->src_frames(plugin, frames);
			if (frames < 0)
				return frames;
		}
		if (check_size && plugin->buf_frames &&
		    frames > plugin->buf_frames)
			frames = plugin->buf_frames;
		plugin = plugin_prev;
	}
	return frames;
+6 −3
Original line number Diff line number Diff line
@@ -867,10 +867,13 @@ static void snd_miro_write(struct snd_miro *chip, unsigned char reg,
	spin_unlock_irqrestore(&chip->lock, flags);
}

static inline void snd_miro_write_mask(struct snd_miro *chip,
		unsigned char reg, unsigned char value, unsigned char mask)
{
	unsigned char oldval = snd_miro_read(chip, reg);

#define snd_miro_write_mask(chip, reg, value, mask)	\
	snd_miro_write(chip, reg,			\
		(snd_miro_read(chip, reg) & ~(mask)) | ((value) & (mask)))
	snd_miro_write(chip, reg, (oldval & ~mask) | (value & mask));
}

/*
 *  Proc Interface
+6 −3
Original line number Diff line number Diff line
@@ -317,10 +317,13 @@ static void snd_opti9xx_write(struct snd_opti9xx *chip, unsigned char reg,
}


#define snd_opti9xx_write_mask(chip, reg, value, mask)	\
	snd_opti9xx_write(chip, reg,			\
		(snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask)))
static inline void snd_opti9xx_write_mask(struct snd_opti9xx *chip,
		unsigned char reg, unsigned char value, unsigned char mask)
{
	unsigned char oldval = snd_opti9xx_read(chip, reg);

	snd_opti9xx_write(chip, reg, (oldval & ~mask) | (value & mask));
}

static int snd_opti9xx_configure(struct snd_opti9xx *chip,
					   long port,
+5 −4
Original line number Diff line number Diff line
@@ -2078,9 +2078,10 @@ static void pcm_mmap_prepare(struct snd_pcm_substream *substream,
 * some HD-audio PCI entries are exposed without any codecs, and such devices
 * should be ignored from the beginning.
 */
static const struct snd_pci_quirk driver_blacklist[] = {
	SND_PCI_QUIRK(0x1462, 0xcb59, "MSI TRX40 Creator", 0),
	SND_PCI_QUIRK(0x1462, 0xcb60, "MSI TRX40", 0),
static const struct pci_device_id driver_blacklist[] = {
	{ PCI_DEVICE_SUB(0x1022, 0x1487, 0x1043, 0x874f) }, /* ASUS ROG Zenith II / Strix */
	{ PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */
	{ PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */
	{}
};

@@ -2100,7 +2101,7 @@ static int azx_probe(struct pci_dev *pci,
	bool schedule_probe;
	int err;

	if (snd_pci_quirk_lookup(pci, driver_blacklist)) {
	if (pci_match_id(driver_blacklist, pci)) {
		dev_info(&pci->dev, "Skipping the blacklisted device\n");
		return -ENODEV;
	}
+5 −1
Original line number Diff line number Diff line
@@ -1848,8 +1848,10 @@ static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid)
	/* Add sanity check to pass klockwork check.
	 * This should never happen.
	 */
	if (WARN_ON(spdif == NULL))
	if (WARN_ON(spdif == NULL)) {
		mutex_unlock(&codec->spdif_mutex);
		return true;
	}
	non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO);
	mutex_unlock(&codec->spdif_mutex);
	return non_pcm;
@@ -2198,7 +2200,9 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)

	for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
		struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
		struct hdmi_eld *pin_eld = &per_pin->sink_eld;

		pin_eld->eld_valid = false;
		hdmi_present_sense(per_pin, 0);
	}

Loading