Pull sound fixes from Takashi Iwai: "Just a few small fixes. The only change to the core code is for a minor race in ALSA OSS sequencer, and the rest are all device-specific fixes (regression fixes and a usual quirk)" * tag 'sound-6.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: Add quirk flag for HEM devices to enable native DSD playback ALSA: usb-audio: Fix broken resume due to UAC3 power state ALSA: seq: oss: Fix racy open/close of MIDI devices ASoC: tegra: Fix Master Volume Control ALSA: hda/realtek: Add a quirk for Compaq N14JP6 firmware: cs_dsp: Log correct region name in bin error messages
Unified · Split
| @@ -2124,6 +2124,7 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware · 2123 unmodified lines | |||
| 2124 | file, blocks, le32_to_cpu(blk->len), | 2124 | file, blocks, le32_to_cpu(blk->len), |
| 2125 | type, le32_to_cpu(blk->id)); | 2125 | type, le32_to_cpu(blk->id)); |
| 2126 | 2126 | ||
| 2127 | region_name = cs_dsp_mem_region_name(type); | ||
| 2127 | mem = cs_dsp_find_region(dsp, type); | 2128 | mem = cs_dsp_find_region(dsp, type); |
| 2128 | if (!mem) { | 2129 | if (!mem) { |
| 2129 | cs_dsp_err(dsp, "No base for region %x\n", type); | 2130 | cs_dsp_err(dsp, "No base for region %x\n", type); |
| @@ -2147,8 +2148,8 @@ static int cs_dsp_load_coeff(struct cs_dsp *dsp, const struct firmware *firmware · 17 unmodified lines | |||
| 2147 | reg = dsp->ops->region_to_reg(mem, reg); | 2148 | reg = dsp->ops->region_to_reg(mem, reg); |
| 2148 | reg += offset; | 2149 | reg += offset; |
| 2149 | } else { | 2150 | } else { |
| 2150 | cs_dsp_err(dsp, "No %x for algorithm %x\n", | 2151 | cs_dsp_err(dsp, "No %s for algorithm %x\n", |
| 2151 | type, le32_to_cpu(blk->id)); | 2152 | region_name, le32_to_cpu(blk->id)); |
| 2152 | } | 2153 | } |
| 2153 | break; | 2154 | break; |
| 2154 | 2155 | ||
| @@ -37,6 +37,7 @@ struct seq_oss_midi { · 36 unmodified lines | |||
| 37 | struct snd_midi_event *coder; /* MIDI event coder */ | 37 | struct snd_midi_event *coder; /* MIDI event coder */ |
| 38 | struct seq_oss_devinfo *devinfo; /* assigned OSSseq device */ | 38 | struct seq_oss_devinfo *devinfo; /* assigned OSSseq device */ |
| 39 | snd_use_lock_t use_lock; | 39 | snd_use_lock_t use_lock; |
| 40 | struct mutex open_mutex; | ||
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | 43 | ||
| @@ -172,6 +173,7 @@ snd_seq_oss_midi_check_new_port(struct snd_seq_port_info *pinfo) · 129 unmodified lines | |||
| 172 | mdev->flags = pinfo->capability; | 173 | mdev->flags = pinfo->capability; |
| 173 | mdev->opened = 0; | 174 | mdev->opened = 0; |
| 174 | snd_use_lock_init(&mdev->use_lock); | 175 | snd_use_lock_init(&mdev->use_lock); |
| 176 | mutex_init(&mdev->open_mutex); | ||
| 175 | 177 | ||
| 176 | /* copy and truncate the name of synth device */ | 178 | /* copy and truncate the name of synth device */ |
| 177 | strscpy(mdev->name, pinfo->name, sizeof(mdev->name)); | 179 | strscpy(mdev->name, pinfo->name, sizeof(mdev->name)); |
| @@ -322,15 +324,17 @@ snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode) · 144 unmodified lines | |||
| 322 | int perm; | 324 | int perm; |
| 323 | struct seq_oss_midi *mdev; | 325 | struct seq_oss_midi *mdev; |
| 324 | struct snd_seq_port_subscribe subs; | 326 | struct snd_seq_port_subscribe subs; |
| 327 | int err; | ||
| 325 | 328 | ||
| 326 | mdev = get_mididev(dp, dev); | 329 | mdev = get_mididev(dp, dev); |
| 327 | if (!mdev) | 330 | if (!mdev) |
| 328 | return -ENODEV; | 331 | return -ENODEV; |
| 329 | 332 | ||
| 333 | mutex_lock(&mdev->open_mutex); | ||
| 330 | /* already used? */ | 334 | /* already used? */ |
| 331 | if (mdev->opened && mdev->devinfo != dp) { | 335 | if (mdev->opened && mdev->devinfo != dp) { |
| 332 | snd_use_lock_free(&mdev->use_lock); | 336 | err = -EBUSY; |
| 333 | return -EBUSY; | 337 | goto unlock; |
| 334 | } | 338 | } |
| 335 | 339 | ||
| 336 | perm = 0; | 340 | perm = 0; |
| @@ -340,14 +344,14 @@ snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode) · 3 unmodified lines | |||
| 340 | perm |= PERM_READ; | 344 | perm |= PERM_READ; |
| 341 | perm &= mdev->flags; | 345 | perm &= mdev->flags; |
| 342 | if (perm == 0) { | 346 | if (perm == 0) { |
| 343 | snd_use_lock_free(&mdev->use_lock); | 347 | err = -ENXIO; |
| 344 | return -ENXIO; | 348 | goto unlock; |
| 345 | } | 349 | } |
| 346 | 350 | ||
| 347 | /* already opened? */ | 351 | /* already opened? */ |
| 348 | if ((mdev->opened & perm) == perm) { | 352 | if ((mdev->opened & perm) == perm) { |
| 349 | snd_use_lock_free(&mdev->use_lock); | 353 | err = 0; |
| 350 | return 0; | 354 | goto unlock; |
| 351 | } | 355 | } |
| 352 | 356 | ||
| 353 | perm &= ~mdev->opened; | 357 | perm &= ~mdev->opened; |
| @@ -372,13 +376,17 @@ snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode) · 18 unmodified lines | |||
| 372 | } | 376 | } |
| 373 | 377 | ||
| 374 | if (! mdev->opened) { | 378 | if (! mdev->opened) { |
| 375 | snd_use_lock_free(&mdev->use_lock); | 379 | err = -ENXIO; |
| 376 | return -ENXIO; | 380 | goto unlock; |
| 377 | } | 381 | } |
| 378 | 382 | ||
| 379 | mdev->devinfo = dp; | 383 | mdev->devinfo = dp; |
| 384 | err = 0; | ||
| 385 | |||
| 386 | unlock: | ||
| 387 | mutex_unlock(&mdev->open_mutex); | ||
| 380 | snd_use_lock_free(&mdev->use_lock); | 388 | snd_use_lock_free(&mdev->use_lock); |
| 381 | return 0; | 389 | return err; |
| 382 | } | 390 | } |
| 383 | 391 | ||
| 384 | /* | 392 | /* |
| @@ -393,10 +401,9 @@ snd_seq_oss_midi_close(struct seq_oss_devinfo *dp, int dev) · 8 unmodified lines | |||
| 393 | mdev = get_mididev(dp, dev); | 401 | mdev = get_mididev(dp, dev); |
| 394 | if (!mdev) | 402 | if (!mdev) |
| 395 | return -ENODEV; | 403 | return -ENODEV; |
| 396 | if (! mdev->opened || mdev->devinfo != dp) { | 404 | mutex_lock(&mdev->open_mutex); |
| 397 | snd_use_lock_free(&mdev->use_lock); | 405 | if (!mdev->opened || mdev->devinfo != dp) |
| 398 | return 0; | 406 | goto unlock; |
| 399 | } | ||
| 400 | 407 | ||
| 401 | memset(&subs, 0, sizeof(subs)); | 408 | memset(&subs, 0, sizeof(subs)); |
| 402 | if (mdev->opened & PERM_WRITE) { | 409 | if (mdev->opened & PERM_WRITE) { |
| @@ -415,6 +422,8 @@ snd_seq_oss_midi_close(struct seq_oss_devinfo *dp, int dev) · 12 unmodified lines | |||
| 415 | mdev->opened = 0; | 422 | mdev->opened = 0; |
| 416 | mdev->devinfo = NULL; | 423 | mdev->devinfo = NULL; |
| 417 | 424 | ||
| 425 | unlock: | ||
| 426 | mutex_unlock(&mdev->open_mutex); | ||
| 418 | snd_use_lock_free(&mdev->use_lock); | 427 | snd_use_lock_free(&mdev->use_lock); |
| 419 | return 0; | 428 | return 0; |
| 420 | } | 429 | } |
| @@ -11740,6 +11740,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { · 11739 unmodified lines | |||
| 11740 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), | 11740 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
| 11741 | SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), | 11741 | SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), |
| 11742 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), | 11742 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
| 11743 | SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB), | ||
| 11743 | 11744 | ||
| 11744 | #if 0 | 11745 | #if 0 |
| 11745 | /* Below is a quirk table taken from the old code. | 11746 | /* Below is a quirk table taken from the old code. |
| @@ -117,6 +117,9 @@ int tegra_pcm_open(struct snd_soc_component *component, · 116 unmodified lines | |||
| 117 | return ret; | 117 | return ret; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | /* Set wait time to 500ms by default */ | ||
| 121 | substream->wait_time = 500; | ||
| 122 | |||
| 120 | return 0; | 123 | return 0; |
| 121 | } | 124 | } |
| 122 | EXPORT_SYMBOL_GPL(tegra_pcm_open); | 125 | EXPORT_SYMBOL_GPL(tegra_pcm_open); |
| @@ -650,6 +650,10 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) · 649 unmodified lines | |||
| 650 | goto unlock; | 650 | goto unlock; |
| 651 | } | 651 | } |
| 652 | 652 | ||
| 653 | ret = snd_usb_pcm_change_state(subs, UAC3_PD_STATE_D0); | ||
| 654 | if (ret < 0) | ||
| 655 | goto unlock; | ||
| 656 | |||
| 653 | again: | 657 | again: |
| 654 | if (subs->sync_endpoint) { | 658 | if (subs->sync_endpoint) { |
| 655 | ret = snd_usb_endpoint_prepare(chip, subs->sync_endpoint); | 659 | ret = snd_usb_endpoint_prepare(chip, subs->sync_endpoint); |
| @@ -2191,6 +2191,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { · 2190 unmodified lines | |||
| 2191 | QUIRK_FLAG_DSD_RAW), | 2191 | QUIRK_FLAG_DSD_RAW), |
| 2192 | VENDOR_FLG(0x2ab6, /* T+A devices */ | 2192 | VENDOR_FLG(0x2ab6, /* T+A devices */ |
| 2193 | QUIRK_FLAG_DSD_RAW), | 2193 | QUIRK_FLAG_DSD_RAW), |
| 2194 | VENDOR_FLG(0x3336, /* HEM devices */ | ||
| 2195 | QUIRK_FLAG_DSD_RAW), | ||
| 2194 | VENDOR_FLG(0x3353, /* Khadas devices */ | 2196 | VENDOR_FLG(0x3353, /* Khadas devices */ |
| 2195 | QUIRK_FLAG_DSD_RAW), | 2197 | QUIRK_FLAG_DSD_RAW), |
| 2196 | VENDOR_FLG(0x3842, /* EVGA */ | 2198 | VENDOR_FLG(0x3842, /* EVGA */ |