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-7.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"A bunch of small fixes. One minor fix is found in the core side for
data race in PCM OSS layer, while remaining changes are various
device-specific fixes and quirks.

- Core: PCM OSS data race fix

- HD-audio: Fixes for TAS2781, CS35L56, and Realtek/Conexant quirks;
avoidance of a WARN_ON for HDMI channel mapping

- USB-audio: Improvements in UAC3 parsing robustness (leaks, size
checks) and fixes for potential endless loops

- ASoC: Driver-specific fixes for CS35L56, Intel bytcr_wm5102,
Spacemit, AW88395, and others, plus a new quirk for Steam Deck
OLED

- Misc: A UAF fix in aloop driver, division by zero fix in ua101
driver and leak fixes in caiaq driver"

* tag 'sound-7.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (32 commits)
ALSA: hda/tas2781: Fix incorrect bit update for non-book-zero or book 0 pages >1
ALSA: hda: cs35l56: Fix uninitialized value in cs35l56_hda_read_acpi()
ALSA: hda/conexant: Fix missing error check for jack detection
ALSA: hda: Avoid WARN_ON() for HDMI chmap slot checks
ALSA: usb-audio: Fix quirk entry placement for PreSonus AudioBox USB
ASoC: spacemit: adjust FIFO trigger threshold to half FIFO size
ASoC: spacemit: move hw constraints from hw_params to startup
ASoC: codecs: ab8500: Fix casting of private data
ASoC: cs35l56: Fix illegal writes to OTP_MEM registers
ASoC: Intel: bytcr_wm5102: Fix MCLK leak on platform_clock_control error
ALSA: usb-audio: Avoid potential endless loop in convert_chmap_v3()
ALSA: usb-audio: Fix potential leak of pd at parsing UAC3 streams
ALSA: caiaq: Don't abort when no input device is available
ALSA: caiaq: Fix potentially leftover ep1_in_urb at error path
ASoC: aw88395: Fix kernel panic caused by invalid GPIO error pointer
ALSA: caiaq: fix usb_dev refcount leak on probe failure
sound: ua101: fix division by zero at probe
ALSA: usb-audio: apply quirk for Playstation PDP Riffmaster
ALSA: hda: Remove duplicate cmedia entries in codecs Makefile
ALSA: hda/realtek: Add micmute LED quirk for Acer Aspire A315-44P
...

+266 -122
+23 -6
sound/core/oss/pcm_oss.c
··· 2155 2155 2156 2156 psubstream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; 2157 2157 csubstream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; 2158 - if (psubstream && psubstream->runtime && psubstream->runtime->oss.trigger) 2159 - result |= PCM_ENABLE_OUTPUT; 2160 - if (csubstream && csubstream->runtime && csubstream->runtime->oss.trigger) 2161 - result |= PCM_ENABLE_INPUT; 2158 + if (psubstream && psubstream->runtime) { 2159 + guard(mutex)(&psubstream->runtime->oss.params_lock); 2160 + if (psubstream->runtime->oss.trigger) 2161 + result |= PCM_ENABLE_OUTPUT; 2162 + } 2163 + if (csubstream && csubstream->runtime) { 2164 + guard(mutex)(&csubstream->runtime->oss.params_lock); 2165 + if (csubstream->runtime->oss.trigger) 2166 + result |= PCM_ENABLE_INPUT; 2167 + } 2162 2168 return result; 2163 2169 } 2164 2170 ··· 2838 2832 runtime->oss.period_frames; 2839 2833 } 2840 2834 2835 + static bool need_input_retrigger(struct snd_pcm_runtime *runtime) 2836 + { 2837 + bool ret; 2838 + 2839 + guard(mutex)(&runtime->oss.params_lock); 2840 + ret = runtime->oss.trigger; 2841 + if (ret) 2842 + runtime->oss.trigger = 0; 2843 + return ret; 2844 + } 2845 + 2841 2846 static __poll_t snd_pcm_oss_poll(struct file *file, poll_table * wait) 2842 2847 { 2843 2848 struct snd_pcm_oss_file *pcm_oss_file; ··· 2881 2864 snd_pcm_oss_capture_ready(csubstream)) 2882 2865 mask |= EPOLLIN | EPOLLRDNORM; 2883 2866 } 2884 - if (ostate != SNDRV_PCM_STATE_RUNNING && runtime->oss.trigger) { 2867 + if (ostate != SNDRV_PCM_STATE_RUNNING && 2868 + need_input_retrigger(runtime)) { 2885 2869 struct snd_pcm_oss_file ofile; 2886 2870 memset(&ofile, 0, sizeof(ofile)); 2887 2871 ofile.streams[SNDRV_PCM_STREAM_CAPTURE] = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; 2888 - runtime->oss.trigger = 0; 2889 2872 snd_pcm_oss_set_trigger(&ofile, PCM_ENABLE_INPUT); 2890 2873 } 2891 2874 }
+30 -13
sound/drivers/aloop.c
··· 99 99 struct loopback_cable { 100 100 spinlock_t lock; 101 101 struct loopback_pcm *streams[2]; 102 + /* in-flight peer stops running outside cable->lock */ 103 + atomic_t stop_count; 104 + wait_queue_head_t stop_wait; 102 105 struct snd_pcm_hardware hw; 103 106 /* flags */ 104 107 unsigned int valid; ··· 369 366 return 0; 370 367 if (stream == SNDRV_PCM_STREAM_CAPTURE) 371 368 return -EIO; 372 - else if (cruntime->state == SNDRV_PCM_STATE_RUNNING) 369 + else if (cruntime->state == SNDRV_PCM_STATE_RUNNING) { 370 + /* close must not free the peer runtime below */ 371 + atomic_inc(&cable->stop_count); 373 372 stop_capture = true; 373 + } 374 374 } 375 375 376 376 setup = get_setup(dpcm_play); ··· 402 396 } 403 397 } 404 398 405 - if (stop_capture) 399 + if (stop_capture) { 406 400 snd_pcm_stop(dpcm_capt->substream, SNDRV_PCM_STATE_DRAINING); 401 + if (atomic_dec_and_test(&cable->stop_count)) 402 + wake_up(&cable->stop_wait); 403 + } 407 404 408 405 return 0; 409 406 } ··· 1058 1049 struct loopback *loopback = substream->private_data; 1059 1050 int dev = get_cable_index(substream); 1060 1051 struct loopback_cable *cable; 1052 + struct loopback_pcm *dpcm; 1053 + bool other_alive; 1061 1054 1062 1055 cable = loopback->cables[substream->number][dev]; 1063 1056 if (!cable) 1064 1057 return; 1065 - if (cable->streams[!substream->stream]) { 1066 - /* other stream is still alive */ 1067 - guard(spinlock_irq)(&cable->lock); 1068 - cable->streams[substream->stream] = NULL; 1069 - } else { 1070 - struct loopback_pcm *dpcm = substream->runtime->private_data; 1071 1058 1072 - if (cable->ops && cable->ops->close_cable && dpcm) 1073 - cable->ops->close_cable(dpcm); 1074 - /* free the cable */ 1075 - loopback->cables[substream->number][dev] = NULL; 1076 - kfree(cable); 1059 + scoped_guard(spinlock_irq, &cable->lock) { 1060 + cable->streams[substream->stream] = NULL; 1061 + other_alive = cable->streams[!substream->stream]; 1077 1062 } 1063 + 1064 + /* Pair with the stop_count increment in loopback_check_format(). */ 1065 + wait_event(cable->stop_wait, !atomic_read(&cable->stop_count)); 1066 + if (other_alive) 1067 + return; 1068 + 1069 + dpcm = substream->runtime->private_data; 1070 + if (cable->ops && cable->ops->close_cable && dpcm) 1071 + cable->ops->close_cable(dpcm); 1072 + /* free the cable */ 1073 + loopback->cables[substream->number][dev] = NULL; 1074 + kfree(cable); 1078 1075 } 1079 1076 1080 1077 static int loopback_jiffies_timer_open(struct loopback_pcm *dpcm) ··· 1275 1260 goto unlock; 1276 1261 } 1277 1262 spin_lock_init(&cable->lock); 1263 + atomic_set(&cable->stop_count, 0); 1264 + init_waitqueue_head(&cable->stop_wait); 1278 1265 cable->hw = loopback_pcm_hardware; 1279 1266 if (loopback->timer_source) 1280 1267 cable->ops = &loopback_snd_timer_ops;
-2
sound/hda/codecs/Makefile
··· 7 7 snd-hda-codec-analog-y := analog.o 8 8 snd-hda-codec-ca0110-y := ca0110.o 9 9 snd-hda-codec-ca0132-y := ca0132.o 10 - snd-hda-codec-cmedia-y := cmedia.o 11 10 snd-hda-codec-conexant-y := conexant.o 12 11 snd-hda-codec-idt-y := sigmatel.o 13 12 snd-hda-codec-senarytech-y := senarytech.o ··· 25 26 obj-$(CONFIG_SND_HDA_CODEC_ANALOG) += snd-hda-codec-analog.o 26 27 obj-$(CONFIG_SND_HDA_CODEC_CA0110) += snd-hda-codec-ca0110.o 27 28 obj-$(CONFIG_SND_HDA_CODEC_CA0132) += snd-hda-codec-ca0132.o 28 - obj-$(CONFIG_SND_HDA_CODEC_CMEDIA) += snd-hda-codec-cmedia.o 29 29 obj-$(CONFIG_SND_HDA_CODEC_CONEXANT) += snd-hda-codec-conexant.o 30 30 obj-$(CONFIG_SND_HDA_CODEC_SIGMATEL) += snd-hda-codec-idt.o 31 31 obj-$(CONFIG_SND_HDA_CODEC_SENARYTECH) += snd-hda-codec-senarytech.o
+7 -1
sound/hda/codecs/conexant.c
··· 1175 1175 static int cx_probe(struct hda_codec *codec, const struct hda_device_id *id) 1176 1176 { 1177 1177 struct conexant_spec *spec; 1178 + struct hda_jack_callback *callback; 1178 1179 int err; 1179 1180 1180 1181 codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name); ··· 1191 1190 case 0x14f11f86: 1192 1191 case 0x14f11f87: 1193 1192 spec->is_cx11880_sn6140 = true; 1194 - snd_hda_jack_detect_enable_callback(codec, 0x19, cx_update_headset_mic_vref); 1193 + callback = snd_hda_jack_detect_enable_callback(codec, 0x19, 1194 + cx_update_headset_mic_vref); 1195 + if (IS_ERR(callback)) { 1196 + err = PTR_ERR(callback); 1197 + goto error; 1198 + } 1195 1199 break; 1196 1200 } 1197 1201
+13 -1
sound/hda/codecs/realtek/alc269.c
··· 3694 3694 spec->power_hook = alc287_s4_power_gpio3_default; 3695 3695 spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook; 3696 3696 } 3697 + 3698 + static void alc287_fixup_tb_vmaster_led(struct hda_codec *codec, 3699 + const struct hda_fixup *fix, int action) 3700 + { 3701 + struct alc_spec *spec = codec->spec; 3702 + 3703 + if (action == HDA_FIXUP_ACT_PRE_PROBE) 3704 + spec->gen.vmaster_mute_led = 1; 3705 + 3706 + alc287_fixup_bind_dacs(codec, fix, action); 3707 + } 3697 3708 /* GPIO2: mute led GPIO3: micmute led */ 3698 3709 static void alc245_tas2781_spi_hp_fixup_muteled(struct hda_codec *codec, 3699 3710 const struct hda_fixup *fix, int action) ··· 6459 6448 }, 6460 6449 [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = { 6461 6450 .type = HDA_FIXUP_FUNC, 6462 - .v.func = alc287_fixup_bind_dacs, 6451 + .v.func = alc287_fixup_tb_vmaster_led, 6463 6452 .chained = true, 6464 6453 .chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI, 6465 6454 }, ··· 6728 6717 SND_PCI_QUIRK(0x1025, 0x159c, "Acer Nitro 5 AN515-58", ALC2XX_FIXUP_HEADSET_MIC), 6729 6718 SND_PCI_QUIRK(0x1025, 0x1597, "Acer Nitro 5 AN517-55", ALC2XX_FIXUP_HEADSET_MIC), 6730 6719 SND_PCI_QUIRK(0x1025, 0x160e, "Acer PT316-51S", ALC2XX_FIXUP_HEADSET_MIC), 6720 + SND_PCI_QUIRK(0x1025, 0x1640, "Acer Aspire A315-44P", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED), 6731 6721 SND_PCI_QUIRK(0x1025, 0x1679, "Acer Nitro 16 AN16-41", ALC2XX_FIXUP_HEADSET_MIC), 6732 6722 SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED), 6733 6723 SND_PCI_QUIRK(0x1025, 0x171e, "Acer Nitro ANV15-51", ALC245_FIXUP_ACER_MICMUTE_LED),
+21 -10
sound/hda/codecs/side-codecs/cs35l56_hda.c
··· 180 180 { 181 181 struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol); 182 182 unsigned int reg_val; 183 - int i; 183 + int i, ret; 184 184 185 185 cs35l56_hda_wait_dsp_ready(cs35l56); 186 186 187 - regmap_read(cs35l56->base.regmap, kcontrol->private_value, &reg_val); 187 + ret = regmap_read(cs35l56->base.regmap, kcontrol->private_value, 188 + &reg_val); 189 + if (ret) 190 + return ret; 191 + 188 192 reg_val &= CS35L56_ASP_TXn_SRC_MASK; 189 193 190 194 for (i = 0; i < CS35L56_NUM_INPUT_SRC; ++i) { ··· 207 203 struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol); 208 204 unsigned int item = ucontrol->value.enumerated.item[0]; 209 205 bool changed; 206 + int ret; 210 207 211 208 if (item >= CS35L56_NUM_INPUT_SRC) 212 209 return -EINVAL; 213 210 214 211 cs35l56_hda_wait_dsp_ready(cs35l56); 215 212 216 - regmap_update_bits_check(cs35l56->base.regmap, kcontrol->private_value, 217 - CS35L56_INPUT_MASK, cs35l56_tx_input_values[item], 218 - &changed); 213 + ret = regmap_update_bits_check(cs35l56->base.regmap, 214 + kcontrol->private_value, 215 + CS35L56_INPUT_MASK, 216 + cs35l56_tx_input_values[item], 217 + &changed); 218 + if (ret) 219 + return ret; 219 220 220 221 return changed; 221 222 } ··· 976 967 static int cs35l56_hda_fixup_yoga9(struct cs35l56_hda *cs35l56, int *bus_addr) 977 968 { 978 969 /* The cirrus,dev-index property has the wrong values */ 970 + cs35l56->num_amps = 2; 979 971 switch (*bus_addr) { 980 972 case 0x30: 981 973 cs35l56->index = 1; ··· 1026 1016 char hid_string[8]; 1027 1017 struct acpi_device *adev; 1028 1018 const char *property, *sub; 1029 - size_t nval; 1030 1019 int i, ret; 1031 1020 1032 1021 /* ··· 1061 1052 ret = -EINVAL; 1062 1053 goto err; 1063 1054 } 1064 - nval = ret; 1055 + cs35l56->num_amps = ret; 1065 1056 1066 - ret = device_property_read_u32_array(cs35l56->base.dev, property, values, nval); 1057 + ret = device_property_read_u32_array(cs35l56->base.dev, property, values, 1058 + cs35l56->num_amps); 1067 1059 if (ret) 1068 1060 goto err; 1069 1061 1070 - for (i = 0; i < nval; i++) { 1062 + for (i = 0; i < cs35l56->num_amps; i++) { 1071 1063 if (values[i] == id) { 1072 1064 cs35l56->index = i; 1073 1065 break; ··· 1091 1081 "Read ACPI _SUB failed(%ld): fallback to generic firmware\n", 1092 1082 PTR_ERR(sub)); 1093 1083 } else { 1094 - ret = cirrus_scodec_get_speaker_id(cs35l56->base.dev, cs35l56->index, nval, -1); 1084 + ret = cirrus_scodec_get_speaker_id(cs35l56->base.dev, cs35l56->index, 1085 + cs35l56->num_amps, -1); 1095 1086 if (ret == -ENOENT) { 1096 1087 cs35l56->system_name = sub; 1097 1088 } else if (ret >= 0) {
+1
sound/hda/codecs/side-codecs/cs35l56_hda.h
··· 26 26 struct work_struct dsp_work; 27 27 28 28 int index; 29 + int num_amps; 29 30 const char *system_name; 30 31 const char *amp_name; 31 32
+11 -3
sound/hda/codecs/side-codecs/tas2781_hda_spi.c
··· 132 132 int ret, val; 133 133 134 134 /* 135 - * In our TAS2781 SPI mode, read/write was masked in last bit of 136 - * address, it cause regmap_update_bits() not work as expected. 135 + * In TAS2781 SPI mode, when accessing non-book-zero or page numbers 136 + * greater than 1 in book 0, an additional byte must be read. The 137 + * first byte in such cases is a dummy byte and should be ignored. 137 138 */ 138 - ret = tasdevice_dev_read(tas_priv, chn, reg, &val); 139 + if ((TASDEVICE_BOOK_ID(reg) > 0) || (TASDEVICE_PAGE_ID(reg) > 1)) { 140 + unsigned char buf[2]; 141 + 142 + ret = tasdevice_dev_bulk_read(tas_priv, chn, reg, buf, 2); 143 + val = buf[1]; 144 + } else { 145 + ret = tasdevice_dev_read(tas_priv, chn, reg, &val); 146 + } 139 147 if (ret < 0) { 140 148 dev_err(tas_priv->dev, "%s, E=%d\n", __func__, ret); 141 149 return ret;
+7 -4
sound/hda/core/hdmi_chmap.c
··· 353 353 if (hdmi_channel_mapping[ca][1] == 0) { 354 354 int hdmi_slot = 0; 355 355 /* fill actual channel mappings in ALSA channel (i) order */ 356 - for (i = 0; i < ch_alloc->channels; i++) { 357 - while (!WARN_ON(hdmi_slot >= 8) && 358 - !ch_alloc->speakers[7 - hdmi_slot]) 359 - hdmi_slot++; /* skip zero slots */ 356 + for (i = 0; i < ch_alloc->channels && hdmi_slot < 8; i++) { 357 + while (!ch_alloc->speakers[7 - hdmi_slot]) { 358 + /* skip zero slots */ 359 + if (++hdmi_slot >= 8) 360 + goto out; 361 + } 360 362 361 363 hdmi_channel_mapping[ca][i] = (i << 4) | hdmi_slot++; 362 364 } 365 + out: 363 366 /* fill the rest of the slots with ALSA channel 0xf */ 364 367 for (hdmi_slot = 0; hdmi_slot < 8; hdmi_slot++) 365 368 if (!ch_alloc->speakers[7 - hdmi_slot])
+1 -1
sound/soc/amd/acp/acp-legacy-mach.c
··· 174 174 acp_card_drvdata->acp_rev = mach->mach_params.subsystem_rev; 175 175 176 176 dmi_id = dmi_first_match(acp_quirk_table); 177 - if (dmi_id && dmi_id->driver_data) 177 + if (dmi_id && dmi_id->driver_data == (void *)QUIRK_TDM_MODE_ENABLE) 178 178 acp_card_drvdata->tdm_mode = dmi_id->driver_data; 179 179 180 180 ret = acp_legacy_dai_links_create(card);
+19 -3
sound/soc/amd/acp/acp-mach-common.c
··· 20 20 #include <sound/soc.h> 21 21 #include <linux/input.h> 22 22 #include <linux/module.h> 23 + #include <linux/dmi.h> 23 24 24 25 #include "../../codecs/rt5682.h" 25 26 #include "../../codecs/rt1019.h" ··· 38 37 #define NAU8821_FREQ_OUT 12288000 39 38 #define MAX98388_CODEC_DAI "max98388-aif1" 40 39 41 - #define TDM_MODE_ENABLE 1 42 - 43 40 const struct dmi_system_id acp_quirk_table[] = { 44 41 { 45 42 /* Google skyrim proto-0 */ 46 43 .matches = { 47 44 DMI_EXACT_MATCH(DMI_PRODUCT_FAMILY, "Google_Skyrim"), 48 45 }, 49 - .driver_data = (void *)TDM_MODE_ENABLE, 46 + .driver_data = (void *)QUIRK_TDM_MODE_ENABLE, 47 + }, 48 + { 49 + /* Valve Steam Deck OLED */ 50 + .matches = { 51 + DMI_MATCH(DMI_SYS_VENDOR, "Valve"), 52 + DMI_MATCH(DMI_PRODUCT_NAME, "Galileo"), 53 + }, 54 + .driver_data = (void *)QUIRK_REMAP_DMIC_BT, 50 55 }, 51 56 {} 52 57 }; ··· 1408 1401 struct snd_soc_dai_link *links; 1409 1402 struct device *dev = card->dev; 1410 1403 struct acp_card_drvdata *drv_data = card->drvdata; 1404 + const struct dmi_system_id *dmi_id = dmi_first_match(acp_quirk_table); 1411 1405 int i = 0, num_links = 0; 1412 1406 1413 1407 if (drv_data->hs_cpu_id) ··· 1580 1572 links[i].codecs = &snd_soc_dummy_dlc; 1581 1573 links[i].num_codecs = 1; 1582 1574 } 1575 + 1576 + if (dmi_id && dmi_id->driver_data == (void *)QUIRK_REMAP_DMIC_BT) 1577 + links[i].id = DMIC_BE_ID; 1583 1578 i++; 1584 1579 } 1585 1580 ··· 1598 1587 links[i].capture_only = 1; 1599 1588 links[i].nonatomic = true; 1600 1589 links[i].no_pcm = 1; 1590 + 1591 + if (dmi_id && dmi_id->driver_data == (void *)QUIRK_REMAP_DMIC_BT) { 1592 + links[i].id = BT_BE_ID; 1593 + dev_dbg(dev, "quirk REMAP_DMIC_BT enabled\n"); 1594 + } 1601 1595 } 1602 1596 1603 1597 card->dai_link = links;
+4
sound/soc/amd/acp/acp-mach.h
··· 26 26 27 27 #define acp_get_drvdata(card) ((struct acp_card_drvdata *)(card)->drvdata) 28 28 29 + /* List of DMI quirks - check acp-mach-common.c for usage. */ 30 + #define QUIRK_TDM_MODE_ENABLE 1 31 + #define QUIRK_REMAP_DMIC_BT 2 32 + 29 33 enum be_id { 30 34 HEADSET_BE_ID = 0, 31 35 AMP_BE_ID,
+1 -1
sound/soc/amd/acp/acp-sof-mach.c
··· 110 110 111 111 acp_card_drvdata = card->drvdata; 112 112 dmi_id = dmi_first_match(acp_quirk_table); 113 - if (dmi_id && dmi_id->driver_data) 113 + if (dmi_id && dmi_id->driver_data == (void *)QUIRK_TDM_MODE_ENABLE) 114 114 acp_card_drvdata->tdm_mode = dmi_id->driver_data; 115 115 116 116 acp_card_drvdata->acp_rev = mach->mach_params.subsystem_rev;
+3 -3
sound/soc/codecs/ab8500-codec.c
··· 2496 2496 return status; 2497 2497 } 2498 2498 fc = (struct filter_control *) 2499 - &ab8500_filter_controls[AB8500_FILTER_ANC_FIR].private_value; 2499 + ab8500_filter_controls[AB8500_FILTER_ANC_FIR].private_value; 2500 2500 drvdata->anc_fir_values = (long *)fc->value; 2501 2501 fc = (struct filter_control *) 2502 - &ab8500_filter_controls[AB8500_FILTER_ANC_IIR].private_value; 2502 + ab8500_filter_controls[AB8500_FILTER_ANC_IIR].private_value; 2503 2503 drvdata->anc_iir_values = (long *)fc->value; 2504 2504 fc = (struct filter_control *) 2505 - &ab8500_filter_controls[AB8500_FILTER_SID_FIR].private_value; 2505 + ab8500_filter_controls[AB8500_FILTER_SID_FIR].private_value; 2506 2506 drvdata->sid_fir_values = (long *)fc->value; 2507 2507 2508 2508 snd_soc_dapm_disable_pin(dapm, "ANC Configure Input");
+4 -5
sound/soc/codecs/aw88395/aw88395.c
··· 456 456 usleep_range(AW88395_1000_US, AW88395_1000_US + 10); 457 457 gpiod_set_value_cansleep(aw88395->reset_gpio, 1); 458 458 usleep_range(AW88395_1000_US, AW88395_1000_US + 10); 459 - } else { 460 - dev_err(aw88395->aw_pa->dev, "%s failed", __func__); 461 459 } 462 460 } 463 461 ··· 520 522 i2c_set_clientdata(i2c, aw88395); 521 523 522 524 aw88395->reset_gpio = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_LOW); 523 - if (IS_ERR(aw88395->reset_gpio)) 524 - dev_info(&i2c->dev, "reset gpio not defined\n"); 525 - 525 + if (IS_ERR(aw88395->reset_gpio)) { 526 + return dev_err_probe(&i2c->dev, PTR_ERR(aw88395->reset_gpio), 527 + "failed to get reset gpio\n"); 528 + } 526 529 /* hardware reset */ 527 530 aw88395_hw_reset(aw88395); 528 531
+3 -4
sound/soc/codecs/cs35l56-shared.c
··· 108 108 EXPORT_SYMBOL_NS_GPL(cs35l56_set_patch, "SND_SOC_CS35L56_SHARED"); 109 109 110 110 static const struct reg_default cs35l56_reg_defaults[] = { 111 - /* no defaults for OTP_MEM - first read populates cache */ 112 - 113 111 { CS35L56_ASP1_ENABLES1, 0x00000000 }, 114 112 { CS35L56_ASP1_CONTROL1, 0x00000028 }, 115 113 { CS35L56_ASP1_CONTROL2, 0x18180200 }, ··· 136 138 }; 137 139 138 140 static const struct reg_default cs35l63_reg_defaults[] = { 139 - /* no defaults for OTP_MEM - first read populates cache */ 140 - 141 141 { CS35L56_ASP1_ENABLES1, 0x00000000 }, 142 142 { CS35L56_ASP1_CONTROL1, 0x00000028 }, 143 143 { CS35L56_ASP1_CONTROL2, 0x18180200 }, ··· 278 282 case CS35L56_GLOBAL_ENABLES: /* owned by firmware */ 279 283 case CS35L56_BLOCK_ENABLES: /* owned by firmware */ 280 284 case CS35L56_BLOCK_ENABLES2: /* owned by firmware */ 285 + case CS35L56_OTP_MEM_53: 286 + case CS35L56_OTP_MEM_54: 287 + case CS35L56_OTP_MEM_55: 281 288 case CS35L56_SYNC_GPIO1_CFG ... CS35L56_ASP2_DIO_GPIO13_CFG: 282 289 case CS35L56_UPDATE_REGS: 283 290 case CS35L56_REFCLK_INPUT: /* owned by firmware */
+1 -1
sound/soc/codecs/es8389.c
··· 892 892 return ret; 893 893 } 894 894 895 - es8389->mclk = devm_clk_get(component->dev, "mclk"); 895 + es8389->mclk = devm_clk_get_optional(component->dev, "mclk"); 896 896 if (IS_ERR(es8389->mclk)) 897 897 return dev_err_probe(component->dev, PTR_ERR(es8389->mclk), 898 898 "ES8389 is unable to get mclk\n");
+1
sound/soc/codecs/tas2764.c
··· 904 904 { 905 905 switch (reg) { 906 906 case TAS2764_SW_RST: 907 + case TAS2764_TEMP: 907 908 case TAS2764_INT_LTCH0 ... TAS2764_INT_LTCH4: 908 909 case TAS2764_INT_CLK_CFG: 909 910 return true;
+2 -2
sound/soc/codecs/tas2770.c
··· 624 624 /* 625 625 * As per datasheet: divide register by 16 and subtract 93 to get 626 626 * degrees Celsius. hwmon requires millidegrees. Let's avoid rounding 627 - * errors by subtracting 93 * 16 then multiplying by 1000 / 16. 627 + * errors by subtracting 93 * 16 and scaling before dividing. 628 628 * 629 629 * NOTE: The ADC registers are initialised to 0 on reset. This means 630 630 * that the temperature will read -93 *C until the chip is brought out ··· 633 633 * value read back from its registers will be the last value sampled 634 634 * before entering software shutdown. 635 635 */ 636 - *result = (reading - (93 * 16)) * (1000 / 16); 636 + *result = (reading - (93 * 16)) * 1000 / 16; 637 637 return 0; 638 638 } 639 639
+25 -1
sound/soc/codecs/wcd937x.c
··· 547 547 WCD937X_DIGITAL_CDC_ANA_CLK_CTL, 548 548 BIT(2), BIT(2)); 549 549 snd_soc_component_update_bits(component, 550 + WCD937X_AUX_AUXPA, 551 + BIT(4), BIT(4)); 552 + snd_soc_component_update_bits(component, 550 553 WCD937X_DIGITAL_CDC_DIG_CLK_CTL, 551 554 BIT(2), BIT(2)); 552 555 snd_soc_component_update_bits(component, ··· 565 562 snd_soc_component_update_bits(component, 566 563 WCD937X_DIGITAL_CDC_ANA_CLK_CTL, 567 564 BIT(2), 0x00); 565 + snd_soc_component_update_bits(component, 566 + WCD937X_AUX_AUXPA, 567 + BIT(4), 0x00); 568 568 break; 569 569 } 570 570 ··· 736 730 snd_soc_component_update_bits(component, 737 731 WCD937X_ANA_RX_SUPPLIES, 738 732 BIT(1), BIT(1)); 733 + /* Enable AUX PA related RX supplies */ 734 + snd_soc_component_update_bits(component, 735 + WCD937X_ANA_RX_SUPPLIES, 736 + BIT(6), BIT(6)); 737 + snd_soc_component_update_bits(component, 738 + WCD937X_ANA_RX_SUPPLIES, 739 + BIT(7), BIT(7)); 739 740 enable_irq(wcd937x->aux_pdm_wd_int); 740 741 break; 741 742 case SND_SOC_DAPM_PRE_PMD: 742 743 disable_irq_nosync(wcd937x->aux_pdm_wd_int); 744 + snd_soc_component_update_bits(component, 745 + WCD937X_ANA_RX_SUPPLIES, 746 + BIT(6), 0x00); 747 + snd_soc_component_update_bits(component, 748 + WCD937X_ANA_RX_SUPPLIES, 749 + BIT(7), 0x00); 743 750 break; 744 751 case SND_SOC_DAPM_POST_PMD: 745 752 usleep_range(2000, 2010); ··· 2070 2051 wcd937x_get_swr_port, wcd937x_set_swr_port), 2071 2052 SOC_SINGLE_EXT("LO Switch", WCD937X_LO, 0, 1, 0, 2072 2053 wcd937x_get_swr_port, wcd937x_set_swr_port), 2073 - 2054 + SOC_SINGLE_EXT("CLSH PA Switch", WCD937X_CLSH, 0, 1, 0, 2055 + wcd937x_get_swr_port, wcd937x_set_swr_port), 2056 + SOC_SINGLE_EXT("DSD_L Switch", WCD937X_DSD_L, 0, 1, 0, 2057 + wcd937x_get_swr_port, wcd937x_set_swr_port), 2058 + SOC_SINGLE_EXT("DSD_R Switch", WCD937X_DSD_R, 0, 1, 0, 2059 + wcd937x_get_swr_port, wcd937x_set_swr_port), 2074 2060 SOC_SINGLE_EXT("ADC1 Switch", WCD937X_ADC1, 1, 1, 0, 2075 2061 wcd937x_get_swr_port, wcd937x_set_swr_port), 2076 2062 SOC_SINGLE_EXT("ADC2 Switch", WCD937X_ADC2, 1, 1, 0,
+1
sound/soc/intel/boards/bytcr_wm5102.c
··· 170 170 ret = byt_wm5102_prepare_and_enable_pll1(codec_dai, 48000); 171 171 if (ret) { 172 172 dev_err(card->dev, "Error setting codec sysclk: %d\n", ret); 173 + clk_disable_unprepare(priv->mclk); 173 174 return ret; 174 175 } 175 176 } else {
+2 -1
sound/soc/sof/intel/hda.c
··· 1412 1412 link_mask |= BIT(peripherals->array[i]->bus->link_id); 1413 1413 1414 1414 link_num = hweight32(link_mask); 1415 - links = devm_kcalloc(sdev->dev, link_num, sizeof(*links), GFP_KERNEL); 1415 + /* An empty adr_link is needed to terminate the adr_link loop */ 1416 + links = devm_kcalloc(sdev->dev, link_num + 1, sizeof(*links), GFP_KERNEL); 1416 1417 if (!links) 1417 1418 return NULL; 1418 1419
+34 -15
sound/soc/spacemit/k1_i2s.c
··· 93 93 u32 sscr_val, sspsp_val, ssfcr_val, ssrwt_val; 94 94 95 95 sscr_val = SSCR_TRAIL | SSCR_FRF_PSP; 96 - ssfcr_val = FIELD_PREP(SSFCR_FIELD_TFT, 5) | 97 - FIELD_PREP(SSFCR_FIELD_RFT, 5) | 96 + ssfcr_val = FIELD_PREP(SSFCR_FIELD_TFT, 0xF) | 97 + FIELD_PREP(SSFCR_FIELD_RFT, 0xF) | 98 98 SSFCR_RSRE | SSFCR_TSRE; 99 99 ssrwt_val = SSRWT_RWOT; 100 100 sspsp_val = SSPSP_SFRMP; ··· 104 104 writel(sspsp_val, i2s->base + SSPSP); 105 105 writel(ssrwt_val, i2s->base + SSRWT); 106 106 writel(0, i2s->base + SSINTEN); 107 + } 108 + 109 + static int spacemit_i2s_startup(struct snd_pcm_substream *substream, 110 + struct snd_soc_dai *dai) 111 + { 112 + struct spacemit_i2s_dev *i2s = snd_soc_dai_get_drvdata(dai); 113 + 114 + switch (i2s->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) { 115 + case SND_SOC_DAIFMT_I2S: 116 + snd_pcm_hw_constraint_minmax(substream->runtime, 117 + SNDRV_PCM_HW_PARAM_CHANNELS, 118 + 2, 2); 119 + snd_pcm_hw_constraint_mask64(substream->runtime, 120 + SNDRV_PCM_HW_PARAM_FORMAT, 121 + SNDRV_PCM_FMTBIT_S16_LE); 122 + break; 123 + case SND_SOC_DAIFMT_DSP_A: 124 + case SND_SOC_DAIFMT_DSP_B: 125 + snd_pcm_hw_constraint_minmax(substream->runtime, 126 + SNDRV_PCM_HW_PARAM_CHANNELS, 127 + 1, 1); 128 + snd_pcm_hw_constraint_mask64(substream->runtime, 129 + SNDRV_PCM_HW_PARAM_FORMAT, 130 + SNDRV_PCM_FMTBIT_S32_LE); 131 + break; 132 + default: 133 + dev_dbg(i2s->dev, "unexpected format type"); 134 + return -EINVAL; 135 + } 136 + 137 + return 0; 107 138 } 108 139 109 140 static int spacemit_i2s_hw_params(struct snd_pcm_substream *substream, ··· 188 157 dma_data->maxburst = 32; 189 158 dma_data->addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 190 159 } 191 - 192 - snd_pcm_hw_constraint_minmax(substream->runtime, 193 - SNDRV_PCM_HW_PARAM_CHANNELS, 194 - 1, 2); 195 - snd_pcm_hw_constraint_mask64(substream->runtime, 196 - SNDRV_PCM_HW_PARAM_FORMAT, 197 - SNDRV_PCM_FMTBIT_S16_LE); 198 160 break; 199 161 case SND_SOC_DAIFMT_DSP_A: 200 162 case SND_SOC_DAIFMT_DSP_B: 201 - snd_pcm_hw_constraint_minmax(substream->runtime, 202 - SNDRV_PCM_HW_PARAM_CHANNELS, 203 - 1, 1); 204 - snd_pcm_hw_constraint_mask64(substream->runtime, 205 - SNDRV_PCM_HW_PARAM_FORMAT, 206 - SNDRV_PCM_FMTBIT_S32_LE); 207 163 break; 208 164 default: 209 165 dev_dbg(i2s->dev, "unexpected format type"); ··· 321 303 static const struct snd_soc_dai_ops spacemit_i2s_dai_ops = { 322 304 .probe = spacemit_i2s_dai_probe, 323 305 .remove = spacemit_i2s_dai_remove, 306 + .startup = spacemit_i2s_startup, 324 307 .hw_params = spacemit_i2s_hw_params, 325 308 .set_sysclk = spacemit_i2s_set_sysclk, 326 309 .set_fmt = spacemit_i2s_set_fmt,
-1
sound/soc/tegra/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Tegra platform Support 3 3 snd-soc-tegra-pcm-y := tegra_pcm.o 4 - snd-soc-tegra-utils-y += tegra_asoc_utils.o 5 4 snd-soc-tegra20-ac97-y := tegra20_ac97.o 6 5 snd-soc-tegra20-das-y := tegra20_das.o 7 6 snd-soc-tegra20-i2s-y := tegra20_i2s.o
+3 -3
sound/usb/caiaq/device.c
··· 366 366 367 367 #ifdef CONFIG_SND_USB_CAIAQ_INPUT 368 368 ret = snd_usb_caiaq_input_init(cdev); 369 - if (ret < 0) { 369 + if (ret < 0 && ret != -ENODEV) { 370 370 dev_err(dev, "Unable to set up input system (ret=%d)\n", ret); 371 371 return ret; 372 372 } ··· 423 423 424 424 cdev = caiaqdev(card); 425 425 cdev->chip.dev = usb_get_dev(usb_dev); 426 + card->private_free = card_free; 426 427 cdev->chip.card = card; 427 428 cdev->chip.usb_id = USB_ID(le16_to_cpu(usb_dev->descriptor.idVendor), 428 429 le16_to_cpu(usb_dev->descriptor.idProduct)); ··· 512 511 scnprintf(card->longname, sizeof(card->longname), "%s %s (%s)", 513 512 cdev->vendor_name, cdev->product_name, usbpath); 514 513 515 - card->private_free = card_free; 516 514 err = setup_card(cdev); 517 515 if (err < 0) 518 - return err; 516 + goto err_kill_urb; 519 517 520 518 return 0; 521 519
+1 -1
sound/usb/caiaq/input.c
··· 804 804 805 805 default: 806 806 /* no input methods supported on this device */ 807 - ret = -EINVAL; 807 + ret = -ENODEV; 808 808 goto exit_free_idev; 809 809 } 810 810
+7
sound/usb/misc/ua101.c
··· 974 974 975 975 ua->capture.channels = fmt_capture->bNrChannels; 976 976 ua->playback.channels = fmt_playback->bNrChannels; 977 + if (!ua->capture.channels || !ua->playback.channels) { 978 + dev_err(&ua->dev->dev, 979 + "invalid channel count: capture %u, playback %u\n", 980 + ua->capture.channels, ua->playback.channels); 981 + return -EINVAL; 982 + } 983 + 977 984 ua->capture.frame_bytes = 978 985 fmt_capture->bSubframeSize * ua->capture.channels; 979 986 ua->playback.frame_bytes =
+10
sound/usb/mixer.c
··· 1190 1190 cval->res = 1; 1191 1191 } 1192 1192 break; 1193 + 1194 + case USB_ID(0x0e6f, 0x024a): /* PDP Riffmaster for PS4 */ 1195 + case USB_ID(0x0e6f, 0x0249): /* PDP Riffmaster for PS5 */ 1196 + if (!strcmp(kctl->id.name, "PCM Playback Volume")) { 1197 + usb_audio_info(chip, 1198 + "set volume quirk for PDP Riffmaster for PS4/PS5\n"); 1199 + cval->min = -2560; /* Mute under it */ 1200 + } 1201 + break; 1202 + 1193 1203 case USB_ID(0x3302, 0x12db): /* MOONDROP Quark2 */ 1194 1204 if (!strcmp(kctl->id.name, "PCM Playback Volume")) { 1195 1205 usb_audio_info(chip,
+3 -1
sound/usb/quirks-table.h
··· 2652 2652 } 2653 2653 } 2654 2654 }, 2655 + 2656 + #endif /* disabled */ 2657 + 2655 2658 { 2656 2659 /* 2657 2660 * The AudioBox USB advertises S24_3LE as the only supported format ··· 2703 2700 } 2704 2701 } 2705 2702 }, 2706 - #endif /* disabled */ 2707 2703 2708 2704 { 2709 2705 /*
+1 -1
sound/usb/quirks.c
··· 125 125 126 126 snd_usb_audioformat_set_sync_ep(chip, fp); 127 127 128 - err = snd_usb_add_audio_stream(chip, stream, fp); 128 + err = snd_usb_add_audio_stream(chip, stream, fp, NULL); 129 129 if (err < 0) 130 130 return err; 131 131
+25 -37
sound/usb/stream.c
··· 79 79 static void snd_usb_init_substream(struct snd_usb_stream *as, 80 80 int stream, 81 81 struct audioformat *fp, 82 - struct snd_usb_power_domain *pd) 82 + struct snd_usb_power_domain **pdptr) 83 83 { 84 84 struct snd_usb_substream *subs = &as->substream[stream]; 85 85 ··· 105 105 if (fp->channels > subs->channels_max) 106 106 subs->channels_max = fp->channels; 107 107 108 - if (pd) { 109 - subs->str_pd = pd; 108 + if (pdptr && *pdptr) { 109 + subs->str_pd = *pdptr; 110 + *pdptr = NULL; /* assigned */ 110 111 /* Initialize Power Domain to idle status D1 */ 111 - snd_usb_power_domain_set(subs->stream->chip, pd, 112 + snd_usb_power_domain_set(subs->stream->chip, subs->str_pd, 112 113 UAC3_PD_STATE_D1); 113 114 } 114 115 ··· 353 352 if (len < sizeof(*cs_desc)) 354 353 break; 355 354 cs_len = le16_to_cpu(cs_desc->wLength); 355 + if (cs_len < sizeof(*cs_desc)) 356 + break; 356 357 if (len < cs_len) 357 358 break; 358 359 cs_type = cs_desc->bSegmentType; ··· 495 492 * if not, create a new pcm stream. note, fp is added to the substream 496 493 * fmt_list and will be freed on the chip instance release. do not free 497 494 * fp or do remove it from the substream fmt_list to avoid double-free. 495 + * 496 + * pdptr is optional and can be NULL. When it's non-NULL and the PD gets 497 + * assigned to the stream, *pdptr is cleared to NULL upon return. 498 498 */ 499 - static int __snd_usb_add_audio_stream(struct snd_usb_audio *chip, 500 - int stream, 501 - struct audioformat *fp, 502 - struct snd_usb_power_domain *pd) 499 + int snd_usb_add_audio_stream(struct snd_usb_audio *chip, 500 + int stream, 501 + struct audioformat *fp, 502 + struct snd_usb_power_domain **pdptr) 503 503 504 504 { 505 505 struct snd_usb_stream *as; ··· 535 529 err = snd_pcm_new_stream(as->pcm, stream, 1); 536 530 if (err < 0) 537 531 return err; 538 - snd_usb_init_substream(as, stream, fp, pd); 532 + snd_usb_init_substream(as, stream, fp, pdptr); 539 533 return add_chmap(as->pcm, stream, subs); 540 534 } 541 535 ··· 564 558 else 565 559 strscpy(pcm->name, "USB Audio"); 566 560 567 - snd_usb_init_substream(as, stream, fp, pd); 561 + snd_usb_init_substream(as, stream, fp, pdptr); 568 562 569 563 /* 570 564 * Keep using head insertion for M-Audio Audiophile USB (tm) which has a ··· 580 574 snd_usb_proc_pcm_format_add(as); 581 575 582 576 return add_chmap(pcm, stream, &as->substream[stream]); 583 - } 584 - 585 - int snd_usb_add_audio_stream(struct snd_usb_audio *chip, 586 - int stream, 587 - struct audioformat *fp) 588 - { 589 - return __snd_usb_add_audio_stream(chip, stream, fp, NULL); 590 - } 591 - 592 - static int snd_usb_add_audio_stream_v3(struct snd_usb_audio *chip, 593 - int stream, 594 - struct audioformat *fp, 595 - struct snd_usb_power_domain *pd) 596 - { 597 - return __snd_usb_add_audio_stream(chip, stream, fp, pd); 598 577 } 599 578 600 579 static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip, ··· 994 1003 * and request Cluster Descriptor 995 1004 */ 996 1005 wLength = le16_to_cpu(hc_header.wLength); 997 - if (wLength < sizeof(cluster)) 1006 + if (wLength < sizeof(*cluster)) 998 1007 return NULL; 999 1008 cluster = kzalloc(wLength, GFP_KERNEL); 1000 1009 if (!cluster) ··· 1104 1113 } 1105 1114 } 1106 1115 1107 - if (pd) 1108 - *pd_out = pd; 1116 + *pd_out = pd; 1109 1117 1110 1118 return fp; 1111 1119 } ··· 1119 1129 struct usb_interface_descriptor *altsd; 1120 1130 int i, altno, err, stream; 1121 1131 struct audioformat *fp = NULL; 1122 - struct snd_usb_power_domain *pd = NULL; 1123 1132 bool set_iface_first; 1124 1133 int num, protocol; 1125 1134 ··· 1159 1170 1160 1171 if (snd_usb_apply_interface_quirk(chip, iface_no, altno)) 1161 1172 continue; 1173 + 1174 + /* pd may be allocated at snd_usb_get_audioformat_uac3() and 1175 + * assigned at snd_usb_add_audio_stream(); otherwise it'll be 1176 + * freed automatically by cleanup at each loop. 1177 + */ 1178 + struct snd_usb_power_domain *pd __free(kfree) = NULL; 1162 1179 1163 1180 /* 1164 1181 * Roland audio streaming interfaces are marked with protocols ··· 1221 1226 *has_non_pcm = true; 1222 1227 if ((fp->fmt_type == UAC_FORMAT_TYPE_I) == non_pcm) { 1223 1228 audioformat_free(fp); 1224 - kfree(pd); 1225 1229 fp = NULL; 1226 - pd = NULL; 1227 1230 continue; 1228 1231 } 1229 1232 1230 1233 snd_usb_audioformat_set_sync_ep(chip, fp); 1231 1234 1232 1235 dev_dbg(&dev->dev, "%u:%d: add audio endpoint %#x\n", iface_no, altno, fp->endpoint); 1233 - if (protocol == UAC_VERSION_3) 1234 - err = snd_usb_add_audio_stream_v3(chip, stream, fp, pd); 1235 - else 1236 - err = snd_usb_add_audio_stream(chip, stream, fp); 1237 - 1236 + err = snd_usb_add_audio_stream(chip, stream, fp, &pd); 1238 1237 if (err < 0) { 1239 1238 audioformat_free(fp); 1240 - kfree(pd); 1241 1239 return err; 1242 1240 } 1243 1241
+2 -1
sound/usb/stream.h
··· 7 7 8 8 int snd_usb_add_audio_stream(struct snd_usb_audio *chip, 9 9 int stream, 10 - struct audioformat *fp); 10 + struct audioformat *fp, 11 + struct snd_usb_power_domain **pdptr); 11 12 12 13 #endif /* __USBAUDIO_STREAM_H */ 13 14