mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
sound fixes for 7.1-rc4
A collection of small fixes. All device-specific small changes.
* HD-audio:
- Fix NULL pointer dereference in snd_hda_ctl_add()
- ACPI and Kconfig fixes for Cirrus drivers
- A regression fix CA0132 codec
- Various device-specific quirks for HP, Lenovo, Samsung, Framework,
etc
- Documentation path fix
* USB-audio:
- Boundary checks for MIDI endpoint descriptors
- Offload mapping error handling for Qualcomm
- A new device quirk for TTGK Technology USB-C Audio
- A fix for Focusrite Scarlett2 mixer
-----BEGIN PGP SIGNATURE-----
iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmoHRhoOHHRpd2FpQHN1
c2UuZGUACgkQLtJE4w1nLE9oERAAyOZw+QBHnmmdW4ONIqIPPWeKKfvwnWpu5Uqd
2VAyZmJdntwMt6rnIeyNlxpSfTQP06+uMhOl/Yc9WVnFUxDxhaTPOJmkCC3DN5a3
9ol9iT2XVzJx+EFkBAknWK/ledkQxF2b+2IUA8rPuN0sAh1bxZXkXOfCzv35Sjld
+NzwoqHG7/udYf5iQUn3FlqpeoezmxP3kW6qDZkeJ9WB//HLlQ6JUbv/aeC5kk+G
UjnqTT5NsjMeZKuyqZIBT5O4iEq5fkpa6SisM9vzuI1rE5g7Di/II9FmCrAju6bX
V0D57trpNpoR+sNbjpMb8tBZmmoq0z05GVNkc4ayoL6cRQNobSkHYnQON5cmuaIu
2VAOr1i1k/b+5S+dSiOSyBuFDaBrEAtlc1OA2cVjIg0pb56ijNrfkxGKsNrlNNRG
RJgqyUGOp/YAT09HuuIMZDJ2kijj+XaFup+sq8+PSMT65QTw8kOHbTviypC0TtVD
Q9pJbBp6lmd23G0xMY3/yo+zUR0X7qJPHOe6gT+roTXMMiX4KkO2qudqlVwR+GBb
sDEDMMW6LKbH2YE7mYuZMm9z8pQnhb3O/+b2ZeiAB5g0oRqoSNNIAV8EcutpOLkY
RUDs+0CIauLuNuegulSPNeG1iZbbNxrUD78ZE9BOL4VihR80vXJSQum8ScX9VSli
Ie+R4QY=
=0d+c
-----END PGP SIGNATURE-----
Merge tag 'sound-7.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"A collection of small fixes. All device-specific small changes:
HD-audio:
- Fix NULL pointer dereference in snd_hda_ctl_add()
- ACPI and Kconfig fixes for Cirrus drivers
- A regression fix CA0132 codec
- Various device-specific quirks for HP, Lenovo, Samsung, Framework etc
- Documentation path fix
USB-audio:
- Boundary checks for MIDI endpoint descriptors
- Offload mapping error handling for Qualcomm
- A new device quirk for TTGK Technology USB-C Audio
- A fix for Focusrite Scarlett2 mixer"
* tag 'sound-7.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/ca0132: Disable auto-detect on manual output select
ALSA: hda/realtek: Add mute LED quirk for HP Pavilion Laptop 16-ag0xxx
ALSA: hda/realtek: ALC269 fixup for Lenovo Yoga Pro 7 15ASH111 audio
ALSA: hda: Fix NULL pointer dereference in snd_hda_ctl_add()
ALSA: hda/realtek: Add quirk for Samsung Galaxy Book5 360 headphone
ALSA: hda/cs35l56: Drop malformed default N from Kconfig
ALSA: hda/realtek: fix mic boost on Framework PTL
ALSA: hda/realtek: Limit mic boost on Positivo DN50E
ALSA: doc: cs35l56: Update path to HDA driver source
ALSA: usb-audio: qcom: Check offload mapping failures
ALSA: hda/realtek: Fix Legion 7 16ITHG6 speaker amp binding
ALSA: usb-audio: Add iface reset and delay quirk for TTGK Technology USB-C Audio
ALSA: scarlett2: Add missing error check when initialise Autogain Status
ALSA: hda: cs35l41: Put ACPI device on missing physical node
ALSA: hda: cs35l56: Put ACPI device after setting companion
ALSA: usb-audio: Bound MIDI 2.0 endpoint descriptor scans
ALSA: usb-audio: Bound MIDI endpoint descriptor scans
ALSA: hda/realtek: Add codec SSID quirk for Lenovo Yoga Pro 9 16IMH9 (17aa:38d5)
This commit is contained in:
commit
b6a08b017f
|
|
@ -40,7 +40,7 @@ There are two drivers in the kernel
|
|||
|
||||
*For systems using SoundWire*: sound/soc/codecs/cs35l56.c and associated files
|
||||
|
||||
*For systems using HDA*: sound/pci/hda/cs35l56_hda.c
|
||||
*For systems using HDA*: sound/hda/codecs/side-codecs/cs35l56_hda.c
|
||||
|
||||
Firmware
|
||||
========
|
||||
|
|
|
|||
|
|
@ -5498,6 +5498,30 @@ static int zxr_headphone_gain_set(struct hda_codec *codec, long val)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Manual output selection (HP/Speaker Playback Switch or alt Output Select)
|
||||
* is meaningful only when HP/Speaker auto-detect is disabled, since the
|
||||
* select_out path always prefers jack presence when auto-detect is on. When
|
||||
* the user explicitly chooses an output, turn auto-detect off so the manual
|
||||
* choice actually takes effect, and notify userspace so the auto-detect
|
||||
* control reflects the new state.
|
||||
*/
|
||||
static void ca0132_disable_hp_auto_detect(struct hda_codec *codec)
|
||||
{
|
||||
struct ca0132_spec *spec = codec->spec;
|
||||
struct snd_kcontrol *kctl;
|
||||
|
||||
if (!spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID])
|
||||
return;
|
||||
|
||||
spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID] = 0;
|
||||
kctl = snd_hda_find_mixer_ctl(codec,
|
||||
"HP/Speaker Auto Detect Playback Switch");
|
||||
if (kctl)
|
||||
snd_ctl_notify(codec->card, SNDRV_CTL_EVENT_MASK_VALUE,
|
||||
&kctl->id);
|
||||
}
|
||||
|
||||
static int ca0132_vnode_switch_set(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
|
|
@ -5510,14 +5534,11 @@ static int ca0132_vnode_switch_set(struct snd_kcontrol *kcontrol,
|
|||
int auto_jack;
|
||||
|
||||
if (nid == VNID_HP_SEL) {
|
||||
auto_jack =
|
||||
spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID];
|
||||
if (!auto_jack) {
|
||||
if (ca0132_use_alt_functions(spec))
|
||||
ca0132_alt_select_out(codec);
|
||||
else
|
||||
ca0132_select_out(codec);
|
||||
}
|
||||
ca0132_disable_hp_auto_detect(codec);
|
||||
if (ca0132_use_alt_functions(spec))
|
||||
ca0132_alt_select_out(codec);
|
||||
else
|
||||
ca0132_select_out(codec);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -5978,7 +5999,6 @@ static int ca0132_alt_output_select_put(struct snd_kcontrol *kcontrol,
|
|||
struct ca0132_spec *spec = codec->spec;
|
||||
int sel = ucontrol->value.enumerated.item[0];
|
||||
unsigned int items = NUM_OF_OUTPUTS;
|
||||
unsigned int auto_jack;
|
||||
|
||||
if (sel >= items)
|
||||
return 0;
|
||||
|
|
@ -5988,10 +6008,8 @@ static int ca0132_alt_output_select_put(struct snd_kcontrol *kcontrol,
|
|||
|
||||
spec->out_enum_val = sel;
|
||||
|
||||
auto_jack = spec->vnode_lswitch[VNID_HP_ASEL - VNODE_START_NID];
|
||||
|
||||
if (!auto_jack)
|
||||
ca0132_alt_select_out(codec);
|
||||
ca0132_disable_hp_auto_detect(codec);
|
||||
ca0132_alt_select_out(codec);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4095,6 +4095,7 @@ enum {
|
|||
ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
|
||||
ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
|
||||
ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
|
||||
ALC295_FIXUP_FRAMEWORK_LAPTOP_LIMIT_INT_MIC_BOOST,
|
||||
ALC287_FIXUP_LEGION_16ITHG6,
|
||||
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
|
||||
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
|
||||
|
|
@ -6346,6 +6347,12 @@ static const struct hda_fixup alc269_fixups[] = {
|
|||
.chained = true,
|
||||
.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
|
||||
},
|
||||
[ALC295_FIXUP_FRAMEWORK_LAPTOP_LIMIT_INT_MIC_BOOST] = {
|
||||
.type = HDA_FIXUP_FUNC,
|
||||
.v.func = alc269_fixup_limit_int_mic_boost,
|
||||
.chained = true,
|
||||
.chain_id = ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
|
||||
},
|
||||
[ALC287_FIXUP_LEGION_16ITHG6] = {
|
||||
.type = HDA_FIXUP_FUNC,
|
||||
.v.func = alc287_fixup_legion_16ithg6_speakers,
|
||||
|
|
@ -7193,6 +7200,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
|
||||
SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
|
||||
SND_PCI_QUIRK(0x103c, 0x8caf, "HP Elite mt645 G8 Mobile Thin Client", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
|
||||
SND_PCI_QUIRK(0x103c, 0x8cbc, "HP Pavilion Laptop 16-ag0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
|
||||
SND_PCI_QUIRK(0x103c, 0x8cbd, "HP Pavilion Aero Laptop 13-bg0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
|
||||
SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
|
||||
SND_PCI_QUIRK(0x103c, 0x8cde, "HP OmniBook Ultra Flip Laptop 14t", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
|
||||
|
|
@ -7504,6 +7512,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x144d, 0xc870, "Samsung Galaxy Book2 Pro (NP950XED)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
|
||||
SND_PCI_QUIRK(0x144d, 0xc872, "Samsung Galaxy Book2 Pro (NP950XEE)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
|
||||
SND_PCI_QUIRK(0x144d, 0xc886, "Samsung Galaxy Book3 Pro (NP964XFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
|
||||
SND_PCI_QUIRK(0x144d, 0xc902, "Samsung Galaxy Book5 360 (NP750QHA)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
|
||||
SND_PCI_QUIRK(0x144d, 0xc1ca, "Samsung Galaxy Book3 Pro 360 (NP960QFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
|
||||
SND_PCI_QUIRK(0x144d, 0xc1cb, "Samsung Galaxy Book3 Pro 360 (NP965QFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
|
||||
SND_PCI_QUIRK(0x144d, 0xc1cc, "Samsung Galaxy Book3 Ultra (NT960XFH)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
|
||||
|
|
@ -7675,10 +7684,12 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
|
||||
HDA_CODEC_QUIRK(0x17aa, 0x3802, "DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8", ALC287_FIXUP_TAS2781_I2C),
|
||||
/* Yoga Pro 9 16IMH9 shares PCI SSID 17aa:3811 with Legion S7 15IMH05;
|
||||
* use codec SSID to distinguish them
|
||||
/* Yoga Pro 9 16IMH9 and Legion 7 16ITHG6 share PCI SSID 17aa:3811
|
||||
* with Legion S7 15IMH05; use codec SSID to distinguish them
|
||||
*/
|
||||
HDA_CODEC_QUIRK(0x17aa, 0x38d5, "Lenovo Yoga Pro 9 16IMH9", ALC287_FIXUP_TAS2781_I2C),
|
||||
HDA_CODEC_QUIRK(0x17aa, 0x38d6, "Lenovo Yoga Pro 9 16IMH9", ALC287_FIXUP_TAS2781_I2C),
|
||||
HDA_CODEC_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3811, "Legion S7 15IMH05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
|
||||
|
|
@ -7752,6 +7763,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x17aa, 0x38df, "Y990 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
|
||||
SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
|
||||
SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
|
||||
SND_PCI_QUIRK(0x17aa, 0x38fc, "Lenovo Yoga Pro 7 15ASH11", ALC245_FIXUP_BASS_HP_DAC),
|
||||
SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C),
|
||||
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
|
||||
SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
|
||||
|
|
@ -7828,6 +7840,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x1e39, 0xca14, "MEDION NM14LNL", ALC233_FIXUP_MEDION_MTL_SPK),
|
||||
SND_PCI_QUIRK(0x1e50, 0x7007, "Positivo DN50E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
|
||||
SND_PCI_QUIRK(0x1ee7, 0x2078, "HONOR BRB-X M1010", ALC2XX_FIXUP_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x1ee7, 0x2081, "HONOR MRB-XXX M1020", ALC256_FIXUP_HONOR_MRB_XXX_M1020_AUDIO),
|
||||
SND_PCI_QUIRK(0x1f4c, 0xe001, "Minisforum V3 (SE)", ALC245_FIXUP_BASS_HP_DAC),
|
||||
|
|
@ -7853,7 +7866,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
|||
SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
|
||||
SND_PCI_QUIRK(0xf111, 0x000b, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
|
||||
SND_PCI_QUIRK(0xf111, 0x000c, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
|
||||
SND_PCI_QUIRK(0xf111, 0x000f, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
|
||||
SND_PCI_QUIRK(0xf111, 0x000f, "Framework Laptop 13 Pro PTL", ALC295_FIXUP_FRAMEWORK_LAPTOP_LIMIT_INT_MIC_BOOST),
|
||||
SND_PCI_QUIRK(0xf111, 0x010f, "Framework Laptop 13 PTL", ALC295_FIXUP_FRAMEWORK_LAPTOP_LIMIT_INT_MIC_BOOST),
|
||||
|
||||
#if 0
|
||||
/* Below is a quirk table taken from the old code.
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ menu "CS35L56 driver options"
|
|||
|
||||
config SND_HDA_SCODEC_CS35L56_CAL_DEBUGFS
|
||||
bool "CS35L56 create debugfs for factory calibration"
|
||||
default N
|
||||
depends on DEBUG_FS
|
||||
select SND_SOC_CS35L56_CAL_DEBUGFS_COMMON
|
||||
help
|
||||
|
|
|
|||
|
|
@ -1896,8 +1896,10 @@ static int cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, const char *hid, i
|
|||
|
||||
cs35l41->dacpi = adev;
|
||||
physdev = get_device(acpi_get_first_physical_node(adev));
|
||||
if (!physdev)
|
||||
if (!physdev) {
|
||||
acpi_dev_put(adev);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
|
||||
if (IS_ERR(sub))
|
||||
|
|
|
|||
|
|
@ -1041,6 +1041,7 @@ static int cs35l56_hda_read_acpi(struct cs35l56_hda *cs35l56, int hid, int id)
|
|||
return -ENODEV;
|
||||
}
|
||||
ACPI_COMPANION_SET(cs35l56->base.dev, adev);
|
||||
acpi_dev_put(adev);
|
||||
}
|
||||
|
||||
/* Initialize things that could be overwritten by a fixup */
|
||||
|
|
|
|||
|
|
@ -1699,6 +1699,9 @@ int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid,
|
|||
unsigned short flags = 0;
|
||||
struct hda_nid_item *item;
|
||||
|
||||
if (!kctl)
|
||||
return -EINVAL;
|
||||
|
||||
if (kctl->id.subdevice & HDA_SUBDEV_AMP_FLAG) {
|
||||
flags |= HDA_NID_ITEM_AMP;
|
||||
if (nid == 0)
|
||||
|
|
|
|||
|
|
@ -1951,15 +1951,17 @@ static struct usb_ms_endpoint_descriptor *find_usb_ms_endpoint_descriptor(
|
|||
while (extralen > 3) {
|
||||
struct usb_ms_endpoint_descriptor *ms_ep =
|
||||
(struct usb_ms_endpoint_descriptor *)extra;
|
||||
int length = ms_ep->bLength;
|
||||
|
||||
if (ms_ep->bLength > 3 &&
|
||||
if (!length || length > extralen)
|
||||
break;
|
||||
|
||||
if (length > 3 &&
|
||||
ms_ep->bDescriptorType == USB_DT_CS_ENDPOINT &&
|
||||
ms_ep->bDescriptorSubtype == UAC_MS_GENERAL)
|
||||
return ms_ep;
|
||||
if (!extra[0])
|
||||
break;
|
||||
extralen -= extra[0];
|
||||
extra += extra[0];
|
||||
extralen -= length;
|
||||
extra += length;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -496,15 +496,17 @@ static void *find_usb_ms_endpoint_descriptor(struct usb_host_endpoint *hostep,
|
|||
while (extralen > 3) {
|
||||
struct usb_ms_endpoint_descriptor *ms_ep =
|
||||
(struct usb_ms_endpoint_descriptor *)extra;
|
||||
int length = ms_ep->bLength;
|
||||
|
||||
if (ms_ep->bLength > 3 &&
|
||||
if (!length || length > extralen)
|
||||
break;
|
||||
|
||||
if (length > 3 &&
|
||||
ms_ep->bDescriptorType == USB_DT_CS_ENDPOINT &&
|
||||
ms_ep->bDescriptorSubtype == subtype)
|
||||
return ms_ep;
|
||||
if (!extra[0])
|
||||
break;
|
||||
extralen -= extra[0];
|
||||
extra += extra[0];
|
||||
extralen -= length;
|
||||
extra += length;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6707,6 +6707,8 @@ static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer)
|
|||
err = scarlett2_add_new_ctl(
|
||||
mixer, &scarlett2_autogain_status_ctl,
|
||||
i, 1, s, &private->autogain_status_ctls[i]);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Add autogain target controls */
|
||||
|
|
|
|||
|
|
@ -565,6 +565,7 @@ static unsigned long uaudio_iommu_map_pa(enum mem_type mtype, bool dma_coherent,
|
|||
unsigned long iova = 0;
|
||||
bool map = true;
|
||||
int prot = uaudio_iommu_map_prot(dma_coherent);
|
||||
int ret;
|
||||
|
||||
switch (mtype) {
|
||||
case MEM_EVENT_RING:
|
||||
|
|
@ -582,10 +583,24 @@ static unsigned long uaudio_iommu_map_pa(enum mem_type mtype, bool dma_coherent,
|
|||
dev_err(uaudio_qdev->data->dev, "unknown mem type %d\n", mtype);
|
||||
}
|
||||
|
||||
if (!iova || !map)
|
||||
if (!iova)
|
||||
return 0;
|
||||
|
||||
iommu_map(uaudio_qdev->data->domain, iova, pa, size, prot, GFP_KERNEL);
|
||||
if (!map)
|
||||
return iova;
|
||||
|
||||
ret = iommu_map(uaudio_qdev->data->domain, iova, pa, size, prot,
|
||||
GFP_KERNEL);
|
||||
if (ret) {
|
||||
dev_err(uaudio_qdev->data->dev,
|
||||
"failed to map %zu bytes at iova 0x%08lx: %d\n",
|
||||
size, iova, ret);
|
||||
if (mtype == MEM_XFER_RING)
|
||||
uaudio_put_iova(iova, size,
|
||||
&uaudio_qdev->xfer_ring_list,
|
||||
&uaudio_qdev->xfer_ring_iova_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return iova;
|
||||
}
|
||||
|
|
@ -1054,15 +1069,17 @@ static int uaudio_transfer_buffer_setup(struct snd_usb_substream *subs,
|
|||
if (!xfer_buf)
|
||||
return -ENOMEM;
|
||||
|
||||
dma_get_sgtable(subs->dev->bus->sysdev, &xfer_buf_sgt, xfer_buf,
|
||||
xfer_buf_dma, len);
|
||||
ret = dma_get_sgtable(subs->dev->bus->sysdev, &xfer_buf_sgt, xfer_buf,
|
||||
xfer_buf_dma, len);
|
||||
if (ret)
|
||||
goto free_xfer_buf;
|
||||
|
||||
/* map the physical buffer into sysdev as well */
|
||||
xfer_buf_dma_sysdev = uaudio_iommu_map_xfer_buf(dma_coherent,
|
||||
len, &xfer_buf_sgt);
|
||||
if (!xfer_buf_dma_sysdev) {
|
||||
ret = -ENOMEM;
|
||||
goto unmap_sync;
|
||||
goto free_sgt;
|
||||
}
|
||||
|
||||
mem_info->dma = xfer_buf_dma;
|
||||
|
|
@ -1073,7 +1090,9 @@ static int uaudio_transfer_buffer_setup(struct snd_usb_substream *subs,
|
|||
|
||||
return 0;
|
||||
|
||||
unmap_sync:
|
||||
free_sgt:
|
||||
sg_free_table(&xfer_buf_sgt);
|
||||
free_xfer_buf:
|
||||
usb_free_coherent(subs->dev, len, xfer_buf, xfer_buf_dma);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -2479,6 +2479,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
|
|||
QUIRK_FLAG_IGNORE_CTL_ERROR),
|
||||
DEVICE_FLG(0x3255, 0x0000, /* Luxman D-10X */
|
||||
QUIRK_FLAG_ITF_USB_DSD_DAC | QUIRK_FLAG_CTL_MSG_DELAY),
|
||||
DEVICE_FLG(0x3302, 0x17c2, /* TTGK Technology USB-C Audio */
|
||||
QUIRK_FLAG_FORCE_IFACE_RESET | QUIRK_FLAG_IFACE_DELAY),
|
||||
DEVICE_FLG(0x339b, 0x3a07, /* Synaptics HONOR USB-C HEADSET */
|
||||
QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE),
|
||||
DEVICE_FLG(0x3443, 0x930d, /* NexiGo N930W 60fps Webcam */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user