Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-fix-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"Here are the rest of small updates for 7.1-rc1. All small fixes mostly
for device-specific issues or regressions.

Core:
- Fix a potential data race in fasync handling

USB-audio:
- New device support: Line6 POD HD PRO, NexiGo N930W webcam
- Fixes for Audio Advantage Micro II SPDIF switch and E-MU sample
rates
- Limit UAC2 rate parsing to prevent potential overflows

HD-Audio:
- Device-specific quirks for HP, Acer, and Honor laptops
- Fix for TAS2781 SPI device abnormal sound
- Move Intel firmware loading into probe work to avoid stalling

ASoC:
- New support for TI TAS5832
- Fixes for SoundWire SDCA/DisCo boolean parsing
- Driver-specific fixes for Intel SOF, ES8311, RT1320, and PXA2xx

Misc:
- Fixes for resource leaks and data races in 6fire, caiaq, als4000,
and pcmtest drivers"

* tag 'sound-fix-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (41 commits)
Revert "ALSA: pcmtest: fix reference leak on failed device registration"
ASoC: tas2781: Add tas5832 support
ASoC: dt-bindings: ti,tas2781: Add TAS5832 support
ALSA: usb-audio: Fix Audio Advantage Micro II SPDIF switch
ALSA: usb-audio: Avoid false E-MU sample-rate notifications
ASoC: sdw_utils: cs42l43: allow spk component names to be combined
ASoC: qcom: x1e80100: limit speaker volumes
ALSA: hda/realtek - Add mute LED support for HP Victus 15-fa2xxx
ALSA: pcmtest: Fix resource leaks in module init error paths
ALSA: usb-audio/line6: Add support for POD HD PRO
ALSA: hda/realtek: Add LED fixup for HP EliteBook 6 G2a Laptops
ASoC: SDCA: Fix reading of mipi-sdca-control-deferrable
regmap: sdw-mbq: Allow defers on undeferrable controls
Revert "ALSA: usb-audio: Add quirk for SmartlinkTechnology M01"
ALSA: als4000: Fix capture trigger chip->mode race
ALSA: core: Fix potential data race at fasync handling
ALSA: hda/tas2781: Fix sound abnormal issue on some SPI device
ALSA: hda/realtek: add quirk for Acer Nitro 16 AN16-41
ALSA: caiaq: Fix control_put() result and cache rollback
ALSA: pcmtest: fix reference leak on failed device registration
...

+339 -258
+6 -1
Documentation/devicetree/bindings/sound/ti,tas2781.yaml
··· 1 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 - # Copyright (C) 2022 - 2025 Texas Instruments Incorporated 2 + # Copyright (C) 2022 - 2026 Texas Instruments Incorporated 3 3 %YAML 1.2 4 4 --- 5 5 $id: http://devicetree.org/schemas/sound/ti,tas2781.yaml# ··· 107 107 108 108 ti,tas5830: 65-W Stereo, Digital Input, High Efficiency Closed-Loop 109 109 Class-D Amplifier with Class-H Algorithm 110 + 111 + ti,tas5832: 81-W Stereo, Digital Input, High Efficiency Closed-Loop 112 + Class-D Amplifier with Class-H Algorithm 110 113 oneOf: 111 114 - items: 112 115 - enum: ··· 131 128 - ti,tas5827 132 129 - ti,tas5828 133 130 - ti,tas5830 131 + - ti,tas5832 134 132 - const: ti,tas2781 135 133 - enum: 136 134 - ti,tas2781 ··· 268 264 - ti,tas5827 269 265 - ti,tas5828 270 266 - ti,tas5830 267 + - ti,tas5832 271 268 then: 272 269 properties: 273 270 reg:
+18 -18
drivers/base/regmap/regmap-sdw-mbq.c
··· 74 74 75 75 static int regmap_sdw_mbq_write_impl(struct sdw_slave *slave, 76 76 unsigned int reg, unsigned int val, 77 - int mbq_size, bool deferrable) 77 + int mbq_size) 78 78 { 79 79 int shift = mbq_size * BITS_PER_BYTE; 80 80 int ret; ··· 88 88 return ret; 89 89 } 90 90 91 - ret = sdw_write_no_pm(slave, reg, val & 0xff); 92 - if (deferrable && ret == -ENODATA) 93 - return -EAGAIN; 94 - 95 - return ret; 91 + return sdw_write_no_pm(slave, reg, val & 0xff); 96 92 } 97 93 98 94 static int regmap_sdw_mbq_write(void *context, unsigned int reg, unsigned int val) 99 95 { 100 96 struct regmap_mbq_context *ctx = context; 101 97 struct sdw_slave *slave = ctx->sdw; 98 + struct device *dev = ctx->dev; 102 99 bool deferrable = regmap_sdw_mbq_deferrable(ctx, reg); 103 100 int mbq_size = regmap_sdw_mbq_size(ctx, reg); 104 101 int ret; ··· 110 113 * process a single wait/timeout on function busy and a single retry 111 114 * of the transaction. 112 115 */ 113 - ret = regmap_sdw_mbq_write_impl(slave, reg, val, mbq_size, deferrable); 114 - if (ret == -EAGAIN) { 116 + ret = regmap_sdw_mbq_write_impl(slave, reg, val, mbq_size); 117 + if (ret == -ENODATA) { 118 + if (!deferrable) 119 + dev_warn(dev, "Defer on undeferrable control: %x\n", reg); 120 + 115 121 ret = regmap_sdw_mbq_poll_busy(slave, reg, ctx); 116 122 if (ret) 117 123 return ret; 118 124 119 - ret = regmap_sdw_mbq_write_impl(slave, reg, val, mbq_size, false); 125 + ret = regmap_sdw_mbq_write_impl(slave, reg, val, mbq_size); 120 126 } 121 127 122 128 return ret; ··· 127 127 128 128 static int regmap_sdw_mbq_read_impl(struct sdw_slave *slave, 129 129 unsigned int reg, unsigned int *val, 130 - int mbq_size, bool deferrable) 130 + int mbq_size) 131 131 { 132 132 int shift = BITS_PER_BYTE; 133 133 int read; 134 134 135 135 read = sdw_read_no_pm(slave, reg); 136 - if (read < 0) { 137 - if (deferrable && read == -ENODATA) 138 - return -EAGAIN; 139 - 136 + if (read < 0) 140 137 return read; 141 - } 142 138 143 139 *val = read; 144 140 ··· 154 158 { 155 159 struct regmap_mbq_context *ctx = context; 156 160 struct sdw_slave *slave = ctx->sdw; 161 + struct device *dev = ctx->dev; 157 162 bool deferrable = regmap_sdw_mbq_deferrable(ctx, reg); 158 163 int mbq_size = regmap_sdw_mbq_size(ctx, reg); 159 164 int ret; ··· 169 172 * process a single wait/timeout on function busy and a single retry 170 173 * of the transaction. 171 174 */ 172 - ret = regmap_sdw_mbq_read_impl(slave, reg, val, mbq_size, deferrable); 173 - if (ret == -EAGAIN) { 175 + ret = regmap_sdw_mbq_read_impl(slave, reg, val, mbq_size); 176 + if (ret == -ENODATA) { 177 + if (!deferrable) 178 + dev_warn(dev, "Defer on undeferable control: %x\n", reg); 179 + 174 180 ret = regmap_sdw_mbq_poll_busy(slave, reg, ctx); 175 181 if (ret) 176 182 return ret; 177 183 178 - ret = regmap_sdw_mbq_read_impl(slave, reg, val, mbq_size, false); 184 + ret = regmap_sdw_mbq_read_impl(slave, reg, val, mbq_size); 179 185 } 180 186 181 187 return ret;
+1
include/sound/tas2781.h
··· 131 131 TAS5827, 132 132 TAS5828, 133 133 TAS5830, 134 + TAS5832, 134 135 TAS_OTHERS, 135 136 }; 136 137
+9 -6
sound/arm/pxa2xx-ac97-lib.c
··· 331 331 if (dev->dev.of_node) { 332 332 /* Assert reset using GPIOD_OUT_HIGH, because reset is GPIO_ACTIVE_LOW */ 333 333 rst_gpio = devm_gpiod_get(&dev->dev, "reset", GPIOD_OUT_HIGH); 334 - ret = PTR_ERR(rst_gpio); 335 - if (ret == -ENOENT) 336 - reset_gpio = -1; 337 - else if (ret) 338 - return ret; 339 - reset_gpio = desc_to_gpio(rst_gpio); 334 + if (IS_ERR(rst_gpio)) { 335 + ret = PTR_ERR(rst_gpio); 336 + if (ret == -ENOENT) 337 + reset_gpio = -1; 338 + else if (ret) 339 + return ret; 340 + } else { 341 + reset_gpio = desc_to_gpio(rst_gpio); 342 + } 340 343 } else { 341 344 if (cpu_is_pxa27x()) 342 345 reset_gpio = 113;
+10 -3
sound/core/misc.c
··· 100 100 static void snd_fasync_work_fn(struct work_struct *work) 101 101 { 102 102 struct snd_fasync *fasync; 103 + int signal, poll; 103 104 104 105 spin_lock_irq(&snd_fasync_lock); 105 106 while (!list_empty(&snd_fasync_list)) { 106 107 fasync = list_first_entry(&snd_fasync_list, struct snd_fasync, list); 107 108 list_del_init(&fasync->list); 109 + if (!fasync->on) 110 + continue; 111 + signal = fasync->signal; 112 + poll = fasync->poll; 108 113 spin_unlock_irq(&snd_fasync_lock); 109 - if (fasync->on) 110 - kill_fasync(&fasync->fasync, fasync->signal, fasync->poll); 114 + kill_fasync(&fasync->fasync, signal, poll); 111 115 spin_lock_irq(&snd_fasync_lock); 112 116 } 113 117 spin_unlock_irq(&snd_fasync_lock); ··· 162 158 { 163 159 if (!fasync) 164 160 return; 165 - fasync->on = 0; 161 + 162 + scoped_guard(spinlock_irq, &snd_fasync_lock) 163 + list_del_init(&fasync->list); 164 + 166 165 flush_work(&snd_fasync_work); 167 166 kfree(fasync); 168 167 }
+12 -3
sound/drivers/pcmtest.c
··· 754 754 755 755 err = init_debug_files(buf_allocated); 756 756 if (err) 757 - return err; 757 + goto err_free_patterns; 758 758 err = platform_device_register(&pcmtst_pdev); 759 759 if (err) 760 - return err; 760 + goto err_clear_debug; 761 761 err = platform_driver_register(&pcmtst_pdrv); 762 - if (err) 762 + if (err) { 763 763 platform_device_unregister(&pcmtst_pdev); 764 + goto err_clear_debug; 765 + } 766 + 767 + return 0; 768 + 769 + err_clear_debug: 770 + clear_debug_files(); 771 + err_free_patterns: 772 + free_pattern_buffers(); 764 773 return err; 765 774 } 766 775
+1 -1
sound/drivers/vx/vx_cmd.h
··· 199 199 void vx_init_rmh(struct vx_rmh *rmh, unsigned int cmd); 200 200 201 201 /** 202 - * vx_send_pipe_cmd_params - fill first command word for pipe commands 202 + * vx_set_pipe_cmd_params - fill first command word for pipe commands 203 203 * @rmh: the rmh to be modified 204 204 * @is_capture: 0 = playback, 1 = capture operation 205 205 * @param1: first pipe-parameter
+17
sound/hda/codecs/realtek/alc269.c
··· 4111 4111 ALC245_FIXUP_ACER_MICMUTE_LED, 4112 4112 ALC245_FIXUP_CS35L41_I2C_2_MUTE_LED, 4113 4113 ALC236_FIXUP_HP_DMIC, 4114 + ALC256_FIXUP_HONOR_MRB_XXX_M1020_AUDIO, 4114 4115 }; 4115 4116 4116 4117 /* A special fixup for Lenovo C940 and Yoga Duet 7; ··· 6654 6653 { 0x12, 0x90a60160 }, /* use as internal mic */ 6655 6654 { } 6656 6655 }, 6656 + }, 6657 + [ALC256_FIXUP_HONOR_MRB_XXX_M1020_AUDIO] = { 6658 + .type = HDA_FIXUP_PINS, 6659 + .v.pins = (const struct hda_pintbl[]) { 6660 + { 0x14, 0x90170111 }, 6661 + { 0x19, 0x03a1113c }, 6662 + { 0x1a, 0x22a190a0 }, 6663 + { 0x1b, 0x90170110 }, 6664 + { } 6665 + } 6657 6666 } 6658 6667 }; 6659 6668 ··· 6717 6706 SND_PCI_QUIRK(0x1025, 0x159c, "Acer Nitro 5 AN515-58", ALC2XX_FIXUP_HEADSET_MIC), 6718 6707 SND_PCI_QUIRK(0x1025, 0x1597, "Acer Nitro 5 AN517-55", ALC2XX_FIXUP_HEADSET_MIC), 6719 6708 SND_PCI_QUIRK(0x1025, 0x160e, "Acer PT316-51S", ALC2XX_FIXUP_HEADSET_MIC), 6709 + SND_PCI_QUIRK(0x1025, 0x1679, "Acer Nitro 16 AN16-41", ALC2XX_FIXUP_HEADSET_MIC), 6720 6710 SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED), 6721 6711 SND_PCI_QUIRK(0x1025, 0x171e, "Acer Nitro ANV15-51", ALC245_FIXUP_ACER_MICMUTE_LED), 6722 6712 SND_PCI_QUIRK(0x1025, 0x173a, "Acer Swift SFG14-73", ALC245_FIXUP_ACER_MICMUTE_LED), ··· 7154 7142 SND_PCI_QUIRK(0x103c, 0x8d90, "HP EliteBook 16 G12", ALC285_FIXUP_HP_GPIO_LED), 7155 7143 SND_PCI_QUIRK(0x103c, 0x8d91, "HP ZBook Firefly 14 G12", ALC285_FIXUP_HP_GPIO_LED), 7156 7144 SND_PCI_QUIRK(0x103c, 0x8d92, "HP ZBook Firefly 16 G12", ALC285_FIXUP_HP_GPIO_LED), 7145 + SND_PCI_QUIRK(0x103c, 0x8dcd, "HP Victus 15-fa2xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 7157 7146 SND_PCI_QUIRK(0x103c, 0x8d9b, "HP 17 Turbine OmniBook 7 UMA", ALC287_FIXUP_CS35L41_I2C_2), 7158 7147 SND_PCI_QUIRK(0x103c, 0x8d9c, "HP 17 Turbine OmniBook 7 DIS", ALC287_FIXUP_CS35L41_I2C_2), 7159 7148 SND_PCI_QUIRK(0x103c, 0x8d9d, "HP 17 Turbine OmniBook X UMA", ALC287_FIXUP_CS35L41_I2C_2), ··· 7227 7214 SND_PCI_QUIRK(0x103c, 0x8f0e, "HP ZBook X G2i 16W", ALC236_FIXUP_HP_GPIO_LED), 7228 7215 SND_PCI_QUIRK(0x103c, 0x8f2d, "HP Auster 14", ALC287_FIXUP_CS35L41_I2C_2), 7229 7216 SND_PCI_QUIRK(0x103c, 0x8f2e, "HP Auster 14", ALC287_FIXUP_CS35L41_I2C_2), 7217 + SND_PCI_QUIRK(0x103c, 0x8f3c, "HP EliteBook 6 G2a", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 7218 + SND_PCI_QUIRK(0x103c, 0x8f3d, "HP EliteBook 6 G2a", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 7230 7219 SND_PCI_QUIRK(0x103c, 0x8f40, "HP ZBook 8 G2a 14", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED), 7231 7220 SND_PCI_QUIRK(0x103c, 0x8f41, "HP ZBook 8 G2a 16", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED), 7232 7221 SND_PCI_QUIRK(0x103c, 0x8f42, "HP ZBook 8 G2a 14W", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED), ··· 7766 7751 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 7767 7752 SND_PCI_QUIRK(0x1e39, 0xca14, "MEDION NM14LNL", ALC233_FIXUP_MEDION_MTL_SPK), 7768 7753 SND_PCI_QUIRK(0x1ee7, 0x2078, "HONOR BRB-X M1010", ALC2XX_FIXUP_HEADSET_MIC), 7754 + SND_PCI_QUIRK(0x1ee7, 0x2081, "HONOR MRB-XXX M1020", ALC256_FIXUP_HONOR_MRB_XXX_M1020_AUDIO), 7769 7755 SND_PCI_QUIRK(0x1f4c, 0xe001, "Minisforum V3 (SE)", ALC245_FIXUP_BASS_HP_DAC), 7770 7756 SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2), 7771 7757 SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), ··· 7987 7971 {.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"}, 7988 7972 {.id = ALC2XX_FIXUP_HEADSET_MIC, .name = "alc2xx-fixup-headset-mic"}, 7989 7973 {.id = ALC245_FIXUP_BASS_HP_DAC, .name = "alc245-fixup-bass-hp-dac"}, 7974 + {.id = ALC256_FIXUP_HONOR_MRB_XXX_M1020_AUDIO, .name = "alc256-honor-mrb-xxx-m1020-audio"}, 7990 7975 {} 7991 7976 }; 7992 7977 #define ALC225_STANDARD_PINS \
+1
sound/hda/codecs/side-codecs/tas2781_hda_spi.c
··· 788 788 } 789 789 if (strstr(dev_name(&spi->dev), "TXNW2781")) { 790 790 device_name = "TXNW2781"; 791 + tas_hda->priv->chip_id = TAS2781; 791 792 } else { 792 793 dev_err(tas_priv->dev, "Unmatched spi dev %s\n", 793 794 dev_name(&spi->dev));
-4
sound/hda/common/hda_controller.h
··· 127 127 unsigned int beep_mode; 128 128 bool ctl_dev_id; 129 129 130 - #ifdef CONFIG_SND_HDA_PATCH_LOADER 131 - const struct firmware *fw; 132 - #endif 133 - 134 130 /* flags */ 135 131 int bdl_pos_adj; 136 132 unsigned int running:1;
+15 -43
sound/hda/controllers/intel.c
··· 1385 1385 azx_free_streams(chip); 1386 1386 snd_hdac_bus_exit(bus); 1387 1387 1388 - #ifdef CONFIG_SND_HDA_PATCH_LOADER 1389 - release_firmware(chip->fw); 1390 - #endif 1391 1388 display_power(chip, false); 1392 1389 1393 1390 if (chip->driver_caps & AZX_DCAPS_I915_COMPONENT) ··· 2034 2037 return 0; 2035 2038 } 2036 2039 2037 - #ifdef CONFIG_SND_HDA_PATCH_LOADER 2038 - /* callback from request_firmware_nowait() */ 2039 - static void azx_firmware_cb(const struct firmware *fw, void *context) 2040 - { 2041 - struct snd_card *card = context; 2042 - struct azx *chip = card->private_data; 2043 - 2044 - if (fw) 2045 - chip->fw = fw; 2046 - else 2047 - dev_err(card->dev, "Cannot load firmware, continue without patching\n"); 2048 - if (!chip->disabled) { 2049 - /* continue probing */ 2050 - azx_probe_continue(chip); 2051 - } 2052 - } 2053 - #endif 2054 - 2055 2040 static int disable_msi_reset_irq(struct azx *chip) 2056 2041 { 2057 2042 struct hdac_bus *bus = azx_bus(chip); ··· 2110 2131 struct snd_card *card; 2111 2132 struct hda_intel *hda; 2112 2133 struct azx *chip; 2113 - bool schedule_probe; 2114 2134 int dev; 2115 2135 int err; 2116 2136 ··· 2205 2227 chip->disabled = true; 2206 2228 } 2207 2229 2208 - schedule_probe = !chip->disabled; 2209 - 2210 - #ifdef CONFIG_SND_HDA_PATCH_LOADER 2211 - if (patch[dev] && *patch[dev]) { 2212 - dev_info(card->dev, "Applying patch firmware '%s'\n", 2213 - patch[dev]); 2214 - err = request_firmware_nowait(THIS_MODULE, true, patch[dev], 2215 - &pci->dev, GFP_KERNEL, card, 2216 - azx_firmware_cb); 2217 - if (err < 0) 2218 - goto out_free; 2219 - schedule_probe = false; /* continued in azx_firmware_cb() */ 2220 - } 2221 - #endif /* CONFIG_SND_HDA_PATCH_LOADER */ 2222 - 2223 - if (schedule_probe) 2230 + if (!chip->disabled) 2224 2231 schedule_delayed_work(&hda->probe_work, 0); 2225 2232 2226 2233 set_bit(dev, probed_devs); ··· 2334 2371 } 2335 2372 2336 2373 #ifdef CONFIG_SND_HDA_PATCH_LOADER 2337 - if (chip->fw) { 2338 - err = snd_hda_load_patch(&chip->bus, chip->fw->size, 2339 - chip->fw->data); 2340 - if (err < 0) 2341 - goto out_free; 2374 + if (patch[dev] && *patch[dev]) { 2375 + const struct firmware *fw = NULL; 2376 + 2377 + dev_info(&pci->dev, "Applying patch firmware '%s'\n", 2378 + patch[dev]); 2379 + if (request_firmware(&fw, patch[dev], &pci->dev) < 0) { 2380 + dev_err(&pci->dev, 2381 + "Cannot load firmware, continue without patching\n"); 2382 + } else { 2383 + err = snd_hda_load_patch(&chip->bus, fw->size, fw->data); 2384 + release_firmware(fw); 2385 + if (err < 0) 2386 + goto out_free; 2387 + } 2342 2388 } 2343 2389 #endif 2344 2390
+20 -24
sound/pci/als4000.c
··· 421 421 { 422 422 struct snd_sb *chip = snd_pcm_substream_chip(substream); 423 423 int result = 0; 424 - 425 - /* FIXME race condition in here!!! 426 - chip->mode non-atomic update gets consistently protected 427 - by reg_lock always, _except_ for this place!! 428 - Probably need to take reg_lock as outer (or inner??) lock, too. 429 - (or serialize both lock operations? probably not, though... - racy?) 430 - */ 431 - guard(spinlock)(&chip->mixer_lock); 432 - switch (cmd) { 433 - case SNDRV_PCM_TRIGGER_START: 434 - case SNDRV_PCM_TRIGGER_RESUME: 435 - chip->mode |= SB_RATE_LOCK_CAPTURE; 436 - snd_als4_cr_write(chip, ALS4K_CR1E_FIFO2_CONTROL, 437 - capture_cmd(chip)); 438 - break; 439 - case SNDRV_PCM_TRIGGER_STOP: 440 - case SNDRV_PCM_TRIGGER_SUSPEND: 441 - chip->mode &= ~SB_RATE_LOCK_CAPTURE; 442 - snd_als4_cr_write(chip, ALS4K_CR1E_FIFO2_CONTROL, 443 - capture_cmd(chip)); 444 - break; 445 - default: 446 - result = -EINVAL; 447 - break; 424 + 425 + guard(spinlock)(&chip->reg_lock); 426 + scoped_guard(spinlock, &chip->mixer_lock) { 427 + switch (cmd) { 428 + case SNDRV_PCM_TRIGGER_START: 429 + case SNDRV_PCM_TRIGGER_RESUME: 430 + chip->mode |= SB_RATE_LOCK_CAPTURE; 431 + snd_als4_cr_write(chip, ALS4K_CR1E_FIFO2_CONTROL, 432 + capture_cmd(chip)); 433 + break; 434 + case SNDRV_PCM_TRIGGER_STOP: 435 + case SNDRV_PCM_TRIGGER_SUSPEND: 436 + chip->mode &= ~SB_RATE_LOCK_CAPTURE; 437 + snd_als4_cr_write(chip, ALS4K_CR1E_FIFO2_CONTROL, 438 + capture_cmd(chip)); 439 + break; 440 + default: 441 + result = -EINVAL; 442 + break; 443 + } 448 444 } 449 445 return result; 450 446 }
+16 -6
sound/soc/codecs/es8311.c
··· 761 761 { 762 762 struct es8311_priv *es8311 = snd_soc_component_get_drvdata(component); 763 763 struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component); 764 + int ret; 764 765 765 766 switch (level) { 766 767 case SND_SOC_BIAS_ON: ··· 770 769 break; 771 770 case SND_SOC_BIAS_STANDBY: 772 771 if (snd_soc_dapm_get_bias_level(dapm) == SND_SOC_BIAS_OFF) { 773 - int ret = clk_prepare_enable(es8311->mclk); 772 + ret = clk_prepare_enable(es8311->mclk); 774 773 if (ret) { 775 774 dev_err(component->dev, 776 775 "unable to prepare mclk\n"); 777 776 return ret; 778 777 } 779 778 780 - snd_soc_component_update_bits( 781 - component, ES8311_SYS3, 782 - ES8311_SYS3_PDN_VMIDSEL_MASK, 783 - ES8311_SYS3_PDN_VMIDSEL_STARTUP_NORMAL_SPEED); 779 + ret = snd_soc_component_update_bits( 780 + component, ES8311_SYS3, 781 + ES8311_SYS3_PDN_VMIDSEL_MASK, 782 + ES8311_SYS3_PDN_VMIDSEL_STARTUP_NORMAL_SPEED); 783 + if (ret < 0) { 784 + clk_disable_unprepare(es8311->mclk); 785 + return ret; 786 + } 784 787 } 785 788 786 789 break; ··· 867 862 static int es8311_resume(struct snd_soc_component *component) 868 863 { 869 864 struct es8311_priv *es8311; 865 + int ret; 870 866 871 867 es8311 = snd_soc_component_get_drvdata(component); 872 868 873 869 es8311_reset(component, false); 874 870 875 871 regcache_cache_only(es8311->regmap, false); 876 - regcache_sync(es8311->regmap); 872 + ret = regcache_sync(es8311->regmap); 873 + if (ret) { 874 + dev_err(component->dev, "unable to sync regcache\n"); 875 + return ret; 876 + } 877 877 878 878 return 0; 879 879 }
+1
sound/soc/codecs/rt1320-sdw.c
··· 1498 1498 } 1499 1499 if (!retry && !(value & 0x40)) { 1500 1500 dev_err(dev, "%s: RAE is not ready to load\n", __func__); 1501 + release_firmware(rae_fw); 1501 1502 return -ETIMEDOUT; 1502 1503 } 1503 1504
+3 -4
sound/soc/codecs/tas2781-fmwlib.c
··· 2487 2487 if (spec == NULL) 2488 2488 return -ENOMEM; 2489 2489 priv->tasdevice[i].cali_specific = spec; 2490 - rc = tasdevice_dev_bulk_read(priv, i, p->r0_reg, r0_deflt, 4); 2490 + rc = priv->dev_bulk_read(priv, i, p->r0_reg, r0_deflt, 4); 2491 2491 if (rc < 0) { 2492 2492 dev_err(priv->dev, "invalid RE from %d = %d\n", i, rc); 2493 2493 return rc; ··· 2511 2511 TASDEVICE_REG(0, 0x1b, 0x34) : 2512 2512 TASDEVICE_REG(0, 0x18, 0x1c); 2513 2513 2514 - rc = tasdevice_dev_bulk_read(priv, i, 2515 - spec->sin_gni_reg, 2516 - spec->sin_gni, 4); 2514 + rc = priv->dev_bulk_read(priv, i, spec->sin_gni_reg, 2515 + spec->sin_gni, 4); 2517 2516 if (rc < 0) { 2518 2517 dev_err(priv->dev, "wrong sinegaini %d = %d\n", 2519 2518 i, rc);
+7 -8
sound/soc/codecs/tas2781-i2c.c
··· 119 119 { "tas5827", TAS5827 }, 120 120 { "tas5828", TAS5828 }, 121 121 { "tas5830", TAS5830 }, 122 + { "tas5832", TAS5832 }, 122 123 {} 123 124 }; 124 125 125 - #ifdef CONFIG_OF 126 126 static const struct of_device_id tasdevice_of_match[] = { 127 127 { .compatible = "ti,tas2020", .data = &tasdevice_id[TAS2020] }, 128 128 { .compatible = "ti,tas2118", .data = &tasdevice_id[TAS2118] }, ··· 143 143 { .compatible = "ti,tas5827", .data = &tasdevice_id[TAS5827] }, 144 144 { .compatible = "ti,tas5828", .data = &tasdevice_id[TAS5828] }, 145 145 { .compatible = "ti,tas5830", .data = &tasdevice_id[TAS5830] }, 146 + { .compatible = "ti,tas5832", .data = &tasdevice_id[TAS5832] }, 146 147 {}, 147 148 }; 148 149 MODULE_DEVICE_TABLE(of, tasdevice_of_match); 149 - #endif 150 150 151 151 /** 152 152 * tas2781_digital_getvol - get the volum control ··· 1746 1746 case TAS5827: 1747 1747 case TAS5828: 1748 1748 case TAS5830: 1749 + case TAS5832: 1749 1750 /* If DSP FW fail, DSP kcontrol won't be created. */ 1750 1751 tasdevice_dsp_remove(tas_priv); 1751 1752 } ··· 1918 1917 case TAS5827: 1919 1918 case TAS5828: 1920 1919 case TAS5830: 1920 + case TAS5832: 1921 1921 p = (struct snd_kcontrol_new *)tas5825_snd_controls; 1922 1922 size = ARRAY_SIZE(tas5825_snd_controls); 1923 1923 break; ··· 2085 2083 tasdevice_remove(tas_priv); 2086 2084 } 2087 2085 2088 - #ifdef CONFIG_ACPI 2089 2086 static const struct acpi_device_id tasdevice_acpi_match[] = { 2090 2087 { "TXNW2020", (kernel_ulong_t)&tasdevice_id[TAS2020] }, 2091 2088 { "TXNW2118", (kernel_ulong_t)&tasdevice_id[TAS2118] }, ··· 2105 2104 { "TXNW5827", (kernel_ulong_t)&tasdevice_id[TAS5827] }, 2106 2105 { "TXNW5828", (kernel_ulong_t)&tasdevice_id[TAS5828] }, 2107 2106 { "TXNW5830", (kernel_ulong_t)&tasdevice_id[TAS5830] }, 2107 + { "TXNW5832", (kernel_ulong_t)&tasdevice_id[TAS5832] }, 2108 2108 {}, 2109 2109 }; 2110 2110 2111 2111 MODULE_DEVICE_TABLE(acpi, tasdevice_acpi_match); 2112 - #endif 2113 2112 2114 2113 static struct i2c_driver tasdevice_i2c_driver = { 2115 2114 .driver = { 2116 2115 .name = "tasdev-codec", 2117 - .of_match_table = of_match_ptr(tasdevice_of_match), 2118 - #ifdef CONFIG_ACPI 2119 - .acpi_match_table = ACPI_PTR(tasdevice_acpi_match), 2120 - #endif 2116 + .of_match_table = tasdevice_of_match, 2117 + .acpi_match_table = tasdevice_acpi_match, 2121 2118 }, 2122 2119 .probe = tasdevice_i2c_probe, 2123 2120 .remove = tasdevice_i2c_remove,
+19
sound/soc/qcom/x1e80100.c
··· 27 27 { 28 28 struct x1e80100_snd_data *data = snd_soc_card_get_drvdata(rtd->card); 29 29 struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); 30 + struct snd_soc_card *card = rtd->card; 30 31 struct snd_soc_jack *dp_jack = NULL; 31 32 int dp_pcm_id = 0; 32 33 33 34 switch (cpu_dai->id) { 35 + case WSA_CODEC_DMA_RX_0: 36 + case WSA_CODEC_DMA_RX_1: 37 + /* 38 + * Set limit of -3 dB on Digital Volume and 0 dB on PA Volume 39 + * to reduce the risk of speaker damage until we have active 40 + * speaker protection in place. 41 + */ 42 + snd_soc_limit_volume(card, "WSA WSA_RX0 Digital Volume", 81); 43 + snd_soc_limit_volume(card, "WSA WSA_RX1 Digital Volume", 81); 44 + snd_soc_limit_volume(card, "WSA2 WSA_RX0 Digital Volume", 81); 45 + snd_soc_limit_volume(card, "WSA2 WSA_RX1 Digital Volume", 81); 46 + snd_soc_limit_volume(card, "SpkrLeft PA Volume", 6); 47 + snd_soc_limit_volume(card, "SpkrRight PA Volume", 6); 48 + snd_soc_limit_volume(card, "WooferLeft PA Volume", 6); 49 + snd_soc_limit_volume(card, "TweeterLeft PA Volume", 6); 50 + snd_soc_limit_volume(card, "WooferRight PA Volume", 6); 51 + snd_soc_limit_volume(card, "TweeterRight PA Volume", 6); 52 + break; 34 53 case DISPLAY_PORT_RX_0: 35 54 dp_pcm_id = 0; 36 55 dp_jack = &data->dp_jack[dp_pcm_id];
+5 -2
sound/soc/sdca/sdca_functions.c
··· 1006 1006 control->has_fixed = true; 1007 1007 fallthrough; 1008 1008 case SDCA_ACCESS_MODE_RO: 1009 - control->deferrable = fwnode_property_read_bool(control_node, 1010 - "mipi-sdca-control-deferrable"); 1009 + ret = fwnode_property_read_u32(control_node, 1010 + "mipi-sdca-control-deferrable", 1011 + &tmp); 1012 + if (ret == 0) 1013 + control->deferrable = !!tmp; 1011 1014 break; 1012 1015 default: 1013 1016 break;
-6
sound/soc/sdw_utils/soc_sdw_bridge_cs35l56.c
··· 40 40 struct snd_soc_dai *codec_dai; 41 41 struct snd_soc_dai *cpu_dai; 42 42 43 - card->components = devm_kasprintf(card->dev, GFP_KERNEL, 44 - "%s spk:cs35l56-bridge", 45 - card->components); 46 - if (!card->components) 47 - return -ENOMEM; 48 - 49 43 ret = snd_soc_dapm_new_controls(dapm, bridge_widgets, 50 44 ARRAY_SIZE(bridge_widgets)); 51 45 if (ret) {
+1 -11
sound/soc/sdw_utils/soc_sdw_cs42l43.c
··· 107 107 108 108 int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 109 109 { 110 - struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; 110 + struct snd_soc_component *component = dai->component; 111 111 struct snd_soc_card *card = rtd->card; 112 112 struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 113 - struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); 114 113 int ret; 115 - 116 - if (!(ctx->mc_quirk & SOC_SDW_SIDECAR_AMPS)) { 117 - /* Will be set by the bridge code in this case */ 118 - card->components = devm_kasprintf(card->dev, GFP_KERNEL, 119 - "%s spk:cs42l43-spk", 120 - card->components); 121 - if (!card->components) 122 - return -ENOMEM; 123 - } 124 114 125 115 ret = snd_soc_limit_volume(card, "cs42l43 Speaker Digital Volume", 126 116 CS42L43_SPK_VOLUME_0DB);
+16 -4
sound/soc/sdw_utils/soc_sdw_utils.c
··· 758 758 { 759 759 .direction = {true, false}, 760 760 .codec_name = "cs42l43-codec", 761 + .component_name = "cs42l43-spk", 761 762 .dai_name = "cs42l43-dp6", 762 763 .dai_type = SOC_SDW_DAI_TYPE_AMP, 763 764 .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, ··· 1105 1104 int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) 1106 1105 { 1107 1106 struct snd_soc_card *card = rtd->card; 1107 + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); 1108 1108 struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card); 1109 1109 struct asoc_sdw_codec_info *codec_info; 1110 1110 struct snd_soc_dai *dai; ··· 1181 1179 /* Generate the spk component string for card->components string */ 1182 1180 if (codec_info->dais[dai_index].dai_type == SOC_SDW_DAI_TYPE_AMP && 1183 1181 codec_info->dais[dai_index].component_name) { 1182 + const char *component; 1183 + 1184 + /* 1185 + * For the special case of cs42l43 with sidecar amps, use only 1186 + * "cs35l56-bridge" as the component name in card->components 1187 + */ 1188 + if (ctx->mc_quirk & SOC_SDW_SIDECAR_AMPS && 1189 + !strcmp(codec_info->dais[dai_index].component_name, "cs42l43-spk")) 1190 + component = "cs35l56-bridge"; 1191 + else 1192 + component = codec_info->dais[dai_index].component_name; 1193 + 1184 1194 if (strlen (spk_components) == 0) 1185 1195 spk_components = 1186 - devm_kasprintf(card->dev, GFP_KERNEL, "%s", 1187 - codec_info->dais[dai_index].component_name); 1196 + devm_kasprintf(card->dev, GFP_KERNEL, "%s", component); 1188 1197 else 1189 1198 /* Append component name to spk_components */ 1190 1199 spk_components = 1191 1200 devm_kasprintf(card->dev, GFP_KERNEL, 1192 - "%s+%s", spk_components, 1193 - codec_info->dais[dai_index].component_name); 1201 + "%s+%s", spk_components, component); 1194 1202 } 1195 1203 1196 1204 codec_info->dais[dai_index].rtd_init_done = true;
+2
sound/soc/sof/intel/nvl.c
··· 48 48 .power_down_dsp = mtl_power_down_dsp, 49 49 .disable_interrupts = lnl_dsp_disable_interrupts, 50 50 .hw_ip_version = SOF_INTEL_ACE_4_0, 51 + .platform = "nvl", 51 52 }; 52 53 53 54 const struct sof_intel_dsp_desc nvl_s_chip_info = { ··· 73 72 .power_down_dsp = mtl_power_down_dsp, 74 73 .disable_interrupts = lnl_dsp_disable_interrupts, 75 74 .hw_ip_version = SOF_INTEL_ACE_4_0, 75 + .platform = "nvl", 76 76 }; 77 77 78 78 MODULE_IMPORT_NS("SND_SOC_SOF_INTEL_MTL");
+54 -59
sound/usb/6fire/chip.c
··· 31 31 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */ 32 32 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable card */ 33 33 static struct sfire_chip *chips[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 34 - static struct usb_device *devices[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 35 34 36 35 module_param_array(index, int, NULL, 0444); 37 36 MODULE_PARM_DESC(index, "Index value for the 6fire sound device"); ··· 43 44 44 45 static void usb6fire_chip_abort(struct sfire_chip *chip) 45 46 { 46 - if (chip) { 47 - if (chip->pcm) 48 - usb6fire_pcm_abort(chip); 49 - if (chip->midi) 50 - usb6fire_midi_abort(chip); 51 - if (chip->comm) 52 - usb6fire_comm_abort(chip); 53 - if (chip->control) 54 - usb6fire_control_abort(chip); 55 - } 47 + if (chip->pcm) 48 + usb6fire_pcm_abort(chip); 49 + if (chip->midi) 50 + usb6fire_midi_abort(chip); 51 + if (chip->comm) 52 + usb6fire_comm_abort(chip); 53 + if (chip->control) 54 + usb6fire_control_abort(chip); 56 55 } 57 56 58 57 static void usb6fire_card_free(struct snd_card *card) 59 58 { 60 59 struct sfire_chip *chip = card->private_data; 61 60 62 - if (chip) { 63 - if (chip->pcm) 64 - usb6fire_pcm_destroy(chip); 65 - if (chip->midi) 66 - usb6fire_midi_destroy(chip); 67 - if (chip->comm) 68 - usb6fire_comm_destroy(chip); 69 - if (chip->control) 70 - usb6fire_control_destroy(chip); 71 - } 61 + if (chip->pcm) 62 + usb6fire_pcm_destroy(chip); 63 + if (chip->midi) 64 + usb6fire_midi_destroy(chip); 65 + if (chip->comm) 66 + usb6fire_comm_destroy(chip); 67 + if (chip->control) 68 + usb6fire_control_destroy(chip); 72 69 } 73 70 74 71 static int usb6fire_chip_probe(struct usb_interface *intf, ··· 78 83 struct snd_card *card = NULL; 79 84 80 85 /* look if we already serve this card and return if so */ 81 - scoped_guard(mutex, &register_mutex) { 82 - for (i = 0; i < SNDRV_CARDS; i++) { 83 - if (devices[i] == device) { 84 - if (chips[i]) 85 - chips[i]->intf_count++; 86 - usb_set_intfdata(intf, chips[i]); 87 - return 0; 88 - } else if (!devices[i] && regidx < 0) 89 - regidx = i; 90 - } 91 - if (regidx < 0) { 92 - dev_err(&intf->dev, "too many cards registered.\n"); 93 - return -ENODEV; 94 - } 95 - devices[regidx] = device; 86 + guard(mutex)(&register_mutex); 87 + for (i = 0; i < SNDRV_CARDS; i++) { 88 + if (chips[i] && chips[i]->dev == device) { 89 + chips[i]->intf_count++; 90 + usb_set_intfdata(intf, chips[i]); 91 + return 0; 92 + } else if (!chips[i] && regidx < 0) 93 + regidx = i; 94 + } 95 + if (regidx < 0) { 96 + dev_err(&intf->dev, "too many cards registered.\n"); 97 + return -ENODEV; 96 98 } 97 99 98 100 /* check, if firmware is present on device, upload it if not */ ··· 116 124 device->bus->busnum, device->devnum); 117 125 118 126 chip = card->private_data; 119 - chips[regidx] = chip; 120 127 chip->dev = device; 121 128 chip->regidx = regidx; 122 129 chip->intf_count = 1; ··· 143 152 dev_err(&intf->dev, "cannot register card."); 144 153 goto destroy_chip; 145 154 } 155 + 146 156 usb_set_intfdata(intf, chip); 157 + chips[regidx] = chip; 158 + 147 159 return 0; 148 160 149 161 destroy_chip: ··· 159 165 struct sfire_chip *chip; 160 166 struct snd_card *card; 161 167 168 + guard(mutex)(&register_mutex); 162 169 chip = usb_get_intfdata(intf); 163 - if (chip) { /* if !chip, fw upload has been performed */ 164 - chip->intf_count--; 165 - if (!chip->intf_count) { 166 - scoped_guard(mutex, &register_mutex) { 167 - devices[chip->regidx] = NULL; 168 - chips[chip->regidx] = NULL; 169 - } 170 + /* if !chip, fw upload has been performed */ 171 + if (!chip) 172 + return; 170 173 171 - /* 172 - * Save card pointer before teardown. 173 - * snd_card_free_when_closed() may free card (and 174 - * the embedded chip) immediately, so it must be 175 - * called last and chip must not be accessed after. 176 - */ 177 - card = chip->card; 178 - chip->shutdown = true; 179 - if (card) 180 - snd_card_disconnect(card); 181 - usb6fire_chip_abort(chip); 182 - if (card) 183 - snd_card_free_when_closed(card); 184 - } 185 - } 174 + chip->intf_count--; 175 + if (chip->intf_count) 176 + return; 177 + 178 + chips[chip->regidx] = NULL; 179 + 180 + /* 181 + * Save card pointer before teardown. 182 + * snd_card_free_when_closed() may free card (and 183 + * the embedded chip) immediately, so it must be 184 + * called last and chip must not be accessed after. 185 + */ 186 + card = chip->card; 187 + chip->shutdown = true; 188 + if (card) 189 + snd_card_disconnect(card); 190 + usb6fire_chip_abort(chip); 191 + if (card) 192 + snd_card_free_when_closed(card); 186 193 } 187 194 188 195 static const struct usb_device_id device_table[] = {
+6 -4
sound/usb/6fire/control.c
··· 290 290 struct snd_ctl_elem_value *ucontrol) 291 291 { 292 292 struct control_runtime *rt = snd_kcontrol_chip(kcontrol); 293 + int vol0 = ucontrol->value.integer.value[0] - 15; 294 + int vol1 = ucontrol->value.integer.value[1] - 15; 293 295 int changed = 0; 294 296 295 - if (rt->input_vol[0] != ucontrol->value.integer.value[0]) { 296 - rt->input_vol[0] = ucontrol->value.integer.value[0] - 15; 297 + if (rt->input_vol[0] != vol0) { 298 + rt->input_vol[0] = vol0; 297 299 rt->ivol_updated &= ~(1 << 0); 298 300 changed = 1; 299 301 } 300 - if (rt->input_vol[1] != ucontrol->value.integer.value[1]) { 301 - rt->input_vol[1] = ucontrol->value.integer.value[1] - 15; 302 + if (rt->input_vol[1] != vol1) { 303 + rt->input_vol[1] = vol1; 302 304 rt->ivol_updated &= ~(1 << 1); 303 305 changed = 1; 304 306 }
+36 -16
sound/usb/caiaq/control.c
··· 87 87 struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card); 88 88 int pos = kcontrol->private_value; 89 89 int v = ucontrol->value.integer.value[0]; 90 + int ret; 90 91 unsigned char cmd; 91 92 92 93 switch (cdev->chip.usb_id) { ··· 104 103 105 104 if (pos & CNT_INTVAL) { 106 105 int i = pos & ~CNT_INTVAL; 106 + unsigned char old = cdev->control_state[i]; 107 + 108 + if (old == v) 109 + return 0; 107 110 108 111 cdev->control_state[i] = v; 109 112 ··· 118 113 cdev->ep8_out_buf[0] = i; 119 114 cdev->ep8_out_buf[1] = v; 120 115 121 - usb_bulk_msg(cdev->chip.dev, 122 - usb_sndbulkpipe(cdev->chip.dev, 8), 123 - cdev->ep8_out_buf, sizeof(cdev->ep8_out_buf), 124 - &actual_len, 200); 116 + ret = usb_bulk_msg(cdev->chip.dev, 117 + usb_sndbulkpipe(cdev->chip.dev, 8), 118 + cdev->ep8_out_buf, 119 + sizeof(cdev->ep8_out_buf), 120 + &actual_len, 200); 125 121 } else if (cdev->chip.usb_id == 126 122 USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER)) { 127 123 ··· 134 128 offset = MASCHINE_BANK_SIZE; 135 129 } 136 130 137 - snd_usb_caiaq_send_command_bank(cdev, cmd, bank, 138 - cdev->control_state + offset, 139 - MASCHINE_BANK_SIZE); 131 + ret = snd_usb_caiaq_send_command_bank(cdev, cmd, bank, 132 + cdev->control_state + offset, 133 + MASCHINE_BANK_SIZE); 140 134 } else { 141 - snd_usb_caiaq_send_command(cdev, cmd, 142 - cdev->control_state, sizeof(cdev->control_state)); 135 + ret = snd_usb_caiaq_send_command(cdev, cmd, 136 + cdev->control_state, 137 + sizeof(cdev->control_state)); 138 + } 139 + 140 + if (ret < 0) { 141 + cdev->control_state[i] = old; 142 + return ret; 143 143 } 144 144 } else { 145 - if (v) 146 - cdev->control_state[pos / 8] |= 1 << (pos % 8); 147 - else 148 - cdev->control_state[pos / 8] &= ~(1 << (pos % 8)); 145 + int idx = pos / 8; 146 + unsigned char mask = 1 << (pos % 8); 147 + unsigned char old = cdev->control_state[idx]; 148 + unsigned char val = v ? (old | mask) : (old & ~mask); 149 149 150 - snd_usb_caiaq_send_command(cdev, cmd, 151 - cdev->control_state, sizeof(cdev->control_state)); 150 + if (old == val) 151 + return 0; 152 + 153 + cdev->control_state[idx] = val; 154 + ret = snd_usb_caiaq_send_command(cdev, cmd, 155 + cdev->control_state, 156 + sizeof(cdev->control_state)); 157 + if (ret < 0) { 158 + cdev->control_state[idx] = old; 159 + return ret; 160 + } 152 161 } 153 162 154 163 return 1; ··· 661 640 662 641 return ret; 663 642 } 664 -
+24 -9
sound/usb/caiaq/device.c
··· 290 290 tmp, sizeof(tmp)); 291 291 } 292 292 293 - static void setup_card(struct snd_usb_caiaqdev *cdev) 293 + static int setup_card(struct snd_usb_caiaqdev *cdev) 294 294 { 295 295 int ret; 296 296 char val[4]; ··· 325 325 snd_usb_caiaq_send_command(cdev, EP1_CMD_READ_IO, NULL, 0); 326 326 327 327 if (!wait_event_timeout(cdev->ep1_wait_queue, 328 - cdev->control_state[0] != 0xff, HZ)) 329 - return; 328 + cdev->control_state[0] != 0xff, HZ)) { 329 + dev_err(dev, "Read timeout for control state\n"); 330 + return -EINVAL; 331 + } 330 332 331 333 /* fix up some defaults */ 332 334 if ((cdev->control_state[1] != 2) || ··· 349 347 cdev->spec.num_digital_audio_out + 350 348 cdev->spec.num_digital_audio_in > 0) { 351 349 ret = snd_usb_caiaq_audio_init(cdev); 352 - if (ret < 0) 350 + if (ret < 0) { 353 351 dev_err(dev, "Unable to set up audio system (ret=%d)\n", ret); 352 + return ret; 353 + } 354 354 } 355 355 356 356 if (cdev->spec.num_midi_in + 357 357 cdev->spec.num_midi_out > 0) { 358 358 ret = snd_usb_caiaq_midi_init(cdev); 359 - if (ret < 0) 359 + if (ret < 0) { 360 360 dev_err(dev, "Unable to set up MIDI system (ret=%d)\n", ret); 361 + return ret; 362 + } 361 363 } 362 364 363 365 #ifdef CONFIG_SND_USB_CAIAQ_INPUT 364 366 ret = snd_usb_caiaq_input_init(cdev); 365 - if (ret < 0) 367 + if (ret < 0) { 366 368 dev_err(dev, "Unable to set up input system (ret=%d)\n", ret); 369 + return ret; 370 + } 367 371 #endif 368 372 369 373 /* finally, register the card and all its sub-instances */ 370 374 ret = snd_card_register(cdev->chip.card); 371 375 if (ret < 0) { 372 376 dev_err(dev, "snd_card_register() returned %d\n", ret); 373 - snd_card_free(cdev->chip.card); 377 + return ret; 374 378 } 375 379 376 380 ret = snd_usb_caiaq_control_init(cdev); 377 - if (ret < 0) 381 + if (ret < 0) { 378 382 dev_err(dev, "Unable to set up control system (ret=%d)\n", ret); 383 + return ret; 384 + } 385 + 386 + return 0; 379 387 } 380 388 381 389 static void card_free(struct snd_card *card) ··· 511 499 scnprintf(card->longname, sizeof(card->longname), "%s %s (%s)", 512 500 cdev->vendor_name, cdev->product_name, usbpath); 513 501 514 - setup_card(cdev); 515 502 card->private_free = card_free; 503 + err = setup_card(cdev); 504 + if (err < 0) 505 + return err; 506 + 516 507 return 0; 517 508 518 509 err_kill_urb:
+1 -1
sound/usb/format.c
··· 470 470 nr_rates++; 471 471 if (nr_rates >= MAX_NR_RATES) { 472 472 usb_audio_err(chip, "invalid uac2 rates\n"); 473 - break; 473 + return nr_rates; 474 474 } 475 475 476 476 skip_rate:
+14
sound/usb/line6/podhd.c
··· 28 28 LINE6_PODHD500X, 29 29 LINE6_PODHDDESKTOP, 30 30 LINE6_PODHDPROX, 31 + LINE6_PODHDPRO, 31 32 }; 32 33 33 34 struct usb_line6_podhd { ··· 443 442 { LINE6_IF_NUM(0x4159, 0), .driver_info = LINE6_PODHD500X }, 444 443 { LINE6_IF_NUM(0x4156, 0), .driver_info = LINE6_PODHDDESKTOP }, 445 444 { LINE6_IF_NUM(0x415A, 0), .driver_info = LINE6_PODHDPROX }, 445 + { LINE6_IF_NUM(0x4157, 0), .driver_info = LINE6_PODHDPRO }, 446 446 {} 447 447 }; 448 448 ··· 537 535 .name = "POD HD Pro X", 538 536 .capabilities = LINE6_CAP_CONTROL | LINE6_CAP_CONTROL_INFO 539 537 | LINE6_CAP_PCM | LINE6_CAP_HWMON | LINE6_CAP_IN_NEEDS_OUT, 538 + .altsetting = 1, 539 + .ctrl_if = 1, 540 + .ep_ctrl_r = 0x81, 541 + .ep_ctrl_w = 0x01, 542 + .ep_audio_r = 0x86, 543 + .ep_audio_w = 0x02, 544 + }, 545 + [LINE6_PODHDPRO] = { 546 + .id = "PODHDPRO", 547 + .name = "POD HD PRO", 548 + .capabilities = LINE6_CAP_PCM | LINE6_CAP_CONTROL 549 + | LINE6_CAP_HWMON | LINE6_CAP_HWMON_CTL | LINE6_CAP_IN_NEEDS_OUT, 540 550 .altsetting = 1, 541 551 .ctrl_if = 1, 542 552 .ep_ctrl_r = 0x81,
+15 -19
sound/usb/mixer.c
··· 2664 2664 2665 2665 /* get min/max values */ 2666 2666 switch (type) { 2667 + case USB_XU_CLOCK_RATE: 2668 + /* 2669 + * E-Mu USB 0404/0202/TrackerPre/0204 2670 + * samplerate control quirk 2671 + */ 2672 + cval->min = 0; 2673 + cval->max = 5; 2674 + cval->res = 1; 2675 + cval->initialized = 1; 2676 + break; 2667 2677 case UAC_PROCESS_UP_DOWNMIX: { 2668 2678 bool mode_sel = false; 2669 2679 ··· 2697 2687 cval->max = control_spec[0]; 2698 2688 cval->res = 1; 2699 2689 cval->initialized = 1; 2700 - err = 0; 2701 2690 break; 2702 2691 } 2703 2692 2704 - err = get_min_max(cval, valinfo->min_value); 2705 - break; 2693 + fallthrough; 2706 2694 } 2707 - case USB_XU_CLOCK_RATE: 2708 - /* 2709 - * E-Mu USB 0404/0202/TrackerPre/0204 2710 - * samplerate control quirk 2711 - */ 2712 - cval->min = 0; 2713 - cval->max = 5; 2714 - cval->res = 1; 2715 - cval->initialized = 1; 2716 - err = 0; 2717 - break; 2718 2695 default: 2719 2696 err = get_min_max(cval, valinfo->min_value); 2720 - break; 2721 - } 2722 - if (err < 0 && err != -EAGAIN) { 2723 - usb_mixer_elem_info_free(cval); 2724 - return err; 2697 + if (err < 0 && err != -EAGAIN) { 2698 + usb_mixer_elem_info_free(cval); 2699 + return err; 2700 + } 2725 2701 } 2726 2702 2727 2703 err = get_cur_ctl_value(cval, cval->control << 8, &val);
+7 -5
sound/usb/mixer_quirks.c
··· 1538 1538 { 1539 1539 struct usb_mixer_interface *mixer; 1540 1540 struct usb_mixer_elem_info *cval; 1541 + int err; 1541 1542 int unitid = 12; /* SampleRate ExtensionUnit ID */ 1542 1543 1543 1544 list_for_each_entry(mixer, &chip->mixer_list, list) { 1544 1545 if (mixer->id_elems[unitid]) { 1545 1546 cval = mixer_elem_list_to_info(mixer->id_elems[unitid]); 1546 - snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR, 1547 - cval->control << 8, 1548 - samplerate_id); 1549 - snd_usb_mixer_notify_id(mixer, unitid); 1547 + err = snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR, 1548 + cval->control << 8, 1549 + samplerate_id); 1550 + if (!err) 1551 + snd_usb_mixer_notify_id(mixer, unitid); 1550 1552 break; 1551 1553 } 1552 1554 } ··· 2027 2025 int err; 2028 2026 2029 2027 reg = ucontrol->value.integer.value[0] ? 0x28 : 0x2a; 2030 - if (reg != list->kctl->private_value) 2028 + if (reg == list->kctl->private_value) 2031 2029 return 0; 2032 2030 2033 2031 kcontrol->private_value = reg;
+2
sound/usb/quirks.c
··· 2474 2474 QUIRK_FLAG_ITF_USB_DSD_DAC | QUIRK_FLAG_CTL_MSG_DELAY), 2475 2475 DEVICE_FLG(0x339b, 0x3a07, /* Synaptics HONOR USB-C HEADSET */ 2476 2476 QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE), 2477 + DEVICE_FLG(0x3443, 0x930d, /* NexiGo N930W 60fps Webcam */ 2478 + QUIRK_FLAG_GET_SAMPLE_RATE | QUIRK_FLAG_MIC_RES_16), 2477 2479 DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */ 2478 2480 QUIRK_FLAG_GET_SAMPLE_RATE), 2479 2481 DEVICE_FLG(0x534d, 0x0021, /* MacroSilicon MS2100/MS2106 */
-1
sound/virtio/virtio_pcm.h
··· 37 37 * the device side at resume. 38 38 * @msgs: Allocated I/O messages. 39 39 * @nmsgs: Number of allocated I/O messages. 40 - * @msg_last_enqueued: Index of the last I/O message added to the virtqueue. 41 40 * @msg_count: Number of pending I/O messages in the virtqueue. 42 41 * @msg_empty: Notify when msg_count is zero. 43 42 */