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

Pull sound fixes from Takashi Iwai:
"A collection of small fixes:

- fixes for regressions by the recent ALSA control hash usages

- fixes for UAF with del_timer() at removals in a few drivers

- char signedness fixes

- a few memory leak fixes in error paths

- device-specific fixes / quirks for Intel SOF, AMD, HD-audio,
USB-audio, and various ASoC codecs"

* tag 'sound-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (50 commits)
ALSA: aoa: Fix I2S device accounting
ALSA: Use del_timer_sync() before freeing timer
ALSA: aoa: i2sbus: fix possible memory leak in i2sbus_add_dev()
ALSA: rme9652: use explicitly signed char
ALSA: au88x0: use explicitly signed char
ALSA: hda/realtek: Add another HP ZBook G9 model quirks
ALSA: usb-audio: Add quirks for M-Audio Fast Track C400/600
ASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init()
ASoC: amd: yc: Add Lenovo Thinkbook 14+ 2022 21D0 to quirks table
ASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init()
ALSA: ac97: Use snd_ctl_rename() to rename a control
ALSA: ca0106: Use snd_ctl_rename() to rename a control
ALSA: emu10k1: Use snd_ctl_rename() to rename a control
ALSA: hda/realtek: Use snd_ctl_rename() to rename a control
ALSA: usb-audio: Use snd_ctl_rename() to rename a control
ALSA: control: add snd_ctl_rename()
ALSA: ac97: fix possible memory leak in snd_ac97_dev_register()
ASoC: SOF: Intel: pci-tgl: fix ADL-N descriptor
ASoC: qcom: lpass-cpu: Mark HDMI TX parity register as volatile
ASoC: amd: yc: Adding Lenovo ThinkBook 14 Gen 4+ ARA and Lenovo ThinkBook 16 Gen 4+ ARA to the Quirks List
...

+364 -122
+1
include/sound/control.h
··· 138 138 int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol, bool add_on_replace); 139 139 int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id); 140 140 int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id); 141 + void snd_ctl_rename(struct snd_card *card, struct snd_kcontrol *kctl, const char *name); 141 142 int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id, int active); 142 143 struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid); 143 144 struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id);
+1
include/sound/simple_card_utils.h
··· 177 177 struct snd_pcm_hw_params *params); 178 178 void asoc_simple_parse_convert(struct device_node *np, char *prefix, 179 179 struct asoc_simple_data *data); 180 + bool asoc_simple_is_convert_required(const struct asoc_simple_data *data); 180 181 181 182 int asoc_simple_parse_routing(struct snd_soc_card *card, 182 183 char *prefix);
+6 -1
sound/aoa/soundbus/i2sbus/core.c
··· 147 147 return rc; 148 148 } 149 149 150 + /* Returns 1 if added, 0 for otherwise; don't return a negative value! */ 150 151 /* FIXME: look at device node refcounting */ 151 152 static int i2sbus_add_dev(struct macio_dev *macio, 152 153 struct i2sbus_control *control, ··· 214 213 * either as the second one in that case is just a modem. */ 215 214 if (!ok) { 216 215 kfree(dev); 217 - return -ENODEV; 216 + return 0; 218 217 } 219 218 220 219 mutex_init(&dev->lock); ··· 303 302 304 303 if (soundbus_add_one(&dev->sound)) { 305 304 printk(KERN_DEBUG "i2sbus: device registration error!\n"); 305 + if (dev->sound.ofdev.dev.kobj.state_initialized) { 306 + soundbus_dev_put(&dev->sound); 307 + return 0; 308 + } 306 309 goto err; 307 310 } 308 311
+23
sound/core/control.c
··· 753 753 } 754 754 EXPORT_SYMBOL(snd_ctl_rename_id); 755 755 756 + /** 757 + * snd_ctl_rename - rename the control on the card 758 + * @card: the card instance 759 + * @kctl: the control to rename 760 + * @name: the new name 761 + * 762 + * Renames the specified control on the card to the new name. 763 + * 764 + * Make sure to take the control write lock - down_write(&card->controls_rwsem). 765 + */ 766 + void snd_ctl_rename(struct snd_card *card, struct snd_kcontrol *kctl, 767 + const char *name) 768 + { 769 + remove_hash_entries(card, kctl); 770 + 771 + if (strscpy(kctl->id.name, name, sizeof(kctl->id.name)) < 0) 772 + pr_warn("ALSA: Renamed control new name '%s' truncated to '%s'\n", 773 + name, kctl->id.name); 774 + 775 + add_hash_entries(card, kctl); 776 + } 777 + EXPORT_SYMBOL(snd_ctl_rename); 778 + 756 779 #ifndef CONFIG_SND_CTL_FAST_LOOKUP 757 780 static struct snd_kcontrol * 758 781 snd_ctl_find_numid_slow(struct snd_card *card, unsigned int numid)
+25 -8
sound/pci/ac97/ac97_codec.c
··· 2009 2009 err = device_register(&ac97->dev); 2010 2010 if (err < 0) { 2011 2011 ac97_err(ac97, "Can't register ac97 bus\n"); 2012 + put_device(&ac97->dev); 2012 2013 ac97->dev.bus = NULL; 2013 2014 return err; 2014 2015 } ··· 2656 2655 */ 2657 2656 static void set_ctl_name(char *dst, const char *src, const char *suffix) 2658 2657 { 2659 - if (suffix) 2660 - sprintf(dst, "%s %s", src, suffix); 2661 - else 2662 - strcpy(dst, src); 2663 - } 2658 + const size_t msize = SNDRV_CTL_ELEM_ID_NAME_MAXLEN; 2659 + 2660 + if (suffix) { 2661 + if (snprintf(dst, msize, "%s %s", src, suffix) >= msize) 2662 + pr_warn("ALSA: AC97 control name '%s %s' truncated to '%s'\n", 2663 + src, suffix, dst); 2664 + } else { 2665 + if (strscpy(dst, src, msize) < 0) 2666 + pr_warn("ALSA: AC97 control name '%s' truncated to '%s'\n", 2667 + src, dst); 2668 + } 2669 + } 2664 2670 2665 2671 /* remove the control with the given name and optional suffix */ 2666 2672 static int snd_ac97_remove_ctl(struct snd_ac97 *ac97, const char *name, ··· 2694 2686 const char *dst, const char *suffix) 2695 2687 { 2696 2688 struct snd_kcontrol *kctl = ctl_find(ac97, src, suffix); 2689 + char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 2690 + 2697 2691 if (kctl) { 2698 - set_ctl_name(kctl->id.name, dst, suffix); 2692 + set_ctl_name(name, dst, suffix); 2693 + snd_ctl_rename(ac97->bus->card, kctl, name); 2699 2694 return 0; 2700 2695 } 2701 2696 return -ENOENT; ··· 2717 2706 const char *s2, const char *suffix) 2718 2707 { 2719 2708 struct snd_kcontrol *kctl1, *kctl2; 2709 + char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 2710 + 2720 2711 kctl1 = ctl_find(ac97, s1, suffix); 2721 2712 kctl2 = ctl_find(ac97, s2, suffix); 2722 2713 if (kctl1 && kctl2) { 2723 - set_ctl_name(kctl1->id.name, s2, suffix); 2724 - set_ctl_name(kctl2->id.name, s1, suffix); 2714 + set_ctl_name(name, s2, suffix); 2715 + snd_ctl_rename(ac97->bus->card, kctl1, name); 2716 + 2717 + set_ctl_name(name, s1, suffix); 2718 + snd_ctl_rename(ac97->bus->card, kctl2, name); 2719 + 2725 2720 return 0; 2726 2721 } 2727 2722 return -ENOENT;
+3 -3
sound/pci/au88x0/au88x0.h
··· 141 141 #ifndef CHIP_AU8810 142 142 stream_t dma_wt[NR_WT]; 143 143 wt_voice_t wt_voice[NR_WT]; /* WT register cache. */ 144 - char mixwt[(NR_WT / NR_WTPB) * 6]; /* WT mixin objects */ 144 + s8 mixwt[(NR_WT / NR_WTPB) * 6]; /* WT mixin objects */ 145 145 #endif 146 146 147 147 /* Global resources */ ··· 235 235 static void vortex_connect_default(vortex_t * vortex, int en); 236 236 static int vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, 237 237 int dir, int type, int subdev); 238 - static char vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, 239 - int restype); 238 + static int vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, 239 + int restype); 240 240 #ifndef CHIP_AU8810 241 241 static int vortex_wt_allocroute(vortex_t * vortex, int dma, int nr_ch); 242 242 static void vortex_wt_connect(vortex_t * vortex, int en);
+1 -1
sound/pci/au88x0/au88x0_core.c
··· 1998 1998 out: Mean checkout if != 0. Else mean Checkin resource. 1999 1999 restype: Indicates type of resource to be checked in or out. 2000 2000 */ 2001 - static char 2001 + static int 2002 2002 vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype) 2003 2003 { 2004 2004 int i, qty = resnum[restype], resinuse = 0;
+1 -1
sound/pci/ca0106/ca0106_mixer.c
··· 720 720 { 721 721 struct snd_kcontrol *kctl = ctl_find(card, src); 722 722 if (kctl) { 723 - strcpy(kctl->id.name, dst); 723 + snd_ctl_rename(card, kctl, dst); 724 724 return 0; 725 725 } 726 726 return -ENOENT;
+1 -1
sound/pci/emu10k1/emumixer.c
··· 1767 1767 { 1768 1768 struct snd_kcontrol *kctl = ctl_find(card, src); 1769 1769 if (kctl) { 1770 - strcpy(kctl->id.name, dst); 1770 + snd_ctl_rename(card, kctl, dst); 1771 1771 return 0; 1772 1772 } 1773 1773 return -ENOENT;
+5 -7
sound/pci/hda/patch_realtek.c
··· 2142 2142 2143 2143 kctl = snd_hda_find_mixer_ctl(codec, oldname); 2144 2144 if (kctl) 2145 - strcpy(kctl->id.name, newname); 2145 + snd_ctl_rename(codec->card, kctl, newname); 2146 2146 } 2147 2147 2148 2148 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, ··· 6654 6654 { 6655 6655 struct hda_codec *cdc = dev_to_hda_codec(dev); 6656 6656 struct alc_spec *spec = cdc->spec; 6657 - int ret; 6658 6657 6659 - ret = component_bind_all(dev, spec->comps); 6660 - if (ret) 6661 - return ret; 6662 - 6663 - return 0; 6658 + return component_bind_all(dev, spec->comps); 6664 6659 } 6665 6660 6666 6661 static void comp_unbind(struct device *dev) ··· 9323 9328 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 9324 9329 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), 9325 9330 SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED), 9331 + SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9326 9332 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9327 9333 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9328 9334 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), ··· 9342 9346 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED), 9343 9347 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED), 9344 9348 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED), 9349 + SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9345 9350 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 9346 9351 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9347 9352 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), ··· 9397 9400 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), 9398 9401 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401), 9399 9402 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), 9403 + SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2), 9400 9404 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), 9401 9405 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), 9402 9406 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
+13 -13
sound/pci/rme9652/hdsp.c
··· 433 433 struct snd_rawmidi *rmidi; 434 434 struct snd_rawmidi_substream *input; 435 435 struct snd_rawmidi_substream *output; 436 - char istimer; /* timer in use */ 436 + signed char istimer; /* timer in use */ 437 437 struct timer_list timer; 438 438 spinlock_t lock; 439 439 int pending; ··· 480 480 pid_t playback_pid; 481 481 int running; 482 482 int system_sample_rate; 483 - const char *channel_map; 483 + const signed char *channel_map; 484 484 int dev; 485 485 int irq; 486 486 unsigned long port; ··· 502 502 where the data for that channel can be read/written from/to. 503 503 */ 504 504 505 - static const char channel_map_df_ss[HDSP_MAX_CHANNELS] = { 505 + static const signed char channel_map_df_ss[HDSP_MAX_CHANNELS] = { 506 506 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 507 507 18, 19, 20, 21, 22, 23, 24, 25 508 508 }; ··· 517 517 -1, -1, -1, -1, -1, -1, -1, -1 518 518 }; 519 519 520 - static const char channel_map_ds[HDSP_MAX_CHANNELS] = { 520 + static const signed char channel_map_ds[HDSP_MAX_CHANNELS] = { 521 521 /* ADAT channels are remapped */ 522 522 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 523 523 /* channels 12 and 13 are S/PDIF */ ··· 526 526 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 527 527 }; 528 528 529 - static const char channel_map_H9632_ss[HDSP_MAX_CHANNELS] = { 529 + static const signed char channel_map_H9632_ss[HDSP_MAX_CHANNELS] = { 530 530 /* ADAT channels */ 531 531 0, 1, 2, 3, 4, 5, 6, 7, 532 532 /* SPDIF */ ··· 540 540 -1, -1 541 541 }; 542 542 543 - static const char channel_map_H9632_ds[HDSP_MAX_CHANNELS] = { 543 + static const signed char channel_map_H9632_ds[HDSP_MAX_CHANNELS] = { 544 544 /* ADAT */ 545 545 1, 3, 5, 7, 546 546 /* SPDIF */ ··· 554 554 -1, -1, -1, -1, -1, -1 555 555 }; 556 556 557 - static const char channel_map_H9632_qs[HDSP_MAX_CHANNELS] = { 557 + static const signed char channel_map_H9632_qs[HDSP_MAX_CHANNELS] = { 558 558 /* ADAT is disabled in this mode */ 559 559 /* SPDIF */ 560 560 8, 9, ··· 3939 3939 return hdsp_hw_pointer(hdsp); 3940 3940 } 3941 3941 3942 - static char *hdsp_channel_buffer_location(struct hdsp *hdsp, 3942 + static signed char *hdsp_channel_buffer_location(struct hdsp *hdsp, 3943 3943 int stream, 3944 3944 int channel) 3945 3945 ··· 3964 3964 void __user *src, unsigned long count) 3965 3965 { 3966 3966 struct hdsp *hdsp = snd_pcm_substream_chip(substream); 3967 - char *channel_buf; 3967 + signed char *channel_buf; 3968 3968 3969 3969 if (snd_BUG_ON(pos + count > HDSP_CHANNEL_BUFFER_BYTES)) 3970 3970 return -EINVAL; ··· 3982 3982 void *src, unsigned long count) 3983 3983 { 3984 3984 struct hdsp *hdsp = snd_pcm_substream_chip(substream); 3985 - char *channel_buf; 3985 + signed char *channel_buf; 3986 3986 3987 3987 channel_buf = hdsp_channel_buffer_location(hdsp, substream->pstr->stream, channel); 3988 3988 if (snd_BUG_ON(!channel_buf)) ··· 3996 3996 void __user *dst, unsigned long count) 3997 3997 { 3998 3998 struct hdsp *hdsp = snd_pcm_substream_chip(substream); 3999 - char *channel_buf; 3999 + signed char *channel_buf; 4000 4000 4001 4001 if (snd_BUG_ON(pos + count > HDSP_CHANNEL_BUFFER_BYTES)) 4002 4002 return -EINVAL; ··· 4014 4014 void *dst, unsigned long count) 4015 4015 { 4016 4016 struct hdsp *hdsp = snd_pcm_substream_chip(substream); 4017 - char *channel_buf; 4017 + signed char *channel_buf; 4018 4018 4019 4019 channel_buf = hdsp_channel_buffer_location(hdsp, substream->pstr->stream, channel); 4020 4020 if (snd_BUG_ON(!channel_buf)) ··· 4028 4028 unsigned long count) 4029 4029 { 4030 4030 struct hdsp *hdsp = snd_pcm_substream_chip(substream); 4031 - char *channel_buf; 4031 + signed char *channel_buf; 4032 4032 4033 4033 channel_buf = hdsp_channel_buffer_location (hdsp, substream->pstr->stream, channel); 4034 4034 if (snd_BUG_ON(!channel_buf))
+11 -11
sound/pci/rme9652/rme9652.c
··· 230 230 int last_spdif_sample_rate; /* so that we can catch externally ... */ 231 231 int last_adat_sample_rate; /* ... induced rate changes */ 232 232 233 - const char *channel_map; 233 + const signed char *channel_map; 234 234 235 235 struct snd_card *card; 236 236 struct snd_pcm *pcm; ··· 247 247 where the data for that channel can be read/written from/to. 248 248 */ 249 249 250 - static const char channel_map_9652_ss[26] = { 250 + static const signed char channel_map_9652_ss[26] = { 251 251 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 252 252 18, 19, 20, 21, 22, 23, 24, 25 253 253 }; 254 254 255 - static const char channel_map_9636_ss[26] = { 255 + static const signed char channel_map_9636_ss[26] = { 256 256 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 257 257 /* channels 16 and 17 are S/PDIF */ 258 258 24, 25, ··· 260 260 -1, -1, -1, -1, -1, -1, -1, -1 261 261 }; 262 262 263 - static const char channel_map_9652_ds[26] = { 263 + static const signed char channel_map_9652_ds[26] = { 264 264 /* ADAT channels are remapped */ 265 265 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 266 266 /* channels 12 and 13 are S/PDIF */ ··· 269 269 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 270 270 }; 271 271 272 - static const char channel_map_9636_ds[26] = { 272 + static const signed char channel_map_9636_ds[26] = { 273 273 /* ADAT channels are remapped */ 274 274 1, 3, 5, 7, 9, 11, 13, 15, 275 275 /* channels 8 and 9 are S/PDIF */ ··· 1819 1819 return rme9652_hw_pointer(rme9652); 1820 1820 } 1821 1821 1822 - static char *rme9652_channel_buffer_location(struct snd_rme9652 *rme9652, 1822 + static signed char *rme9652_channel_buffer_location(struct snd_rme9652 *rme9652, 1823 1823 int stream, 1824 1824 int channel) 1825 1825 ··· 1847 1847 void __user *src, unsigned long count) 1848 1848 { 1849 1849 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); 1850 - char *channel_buf; 1850 + signed char *channel_buf; 1851 1851 1852 1852 if (snd_BUG_ON(pos + count > RME9652_CHANNEL_BUFFER_BYTES)) 1853 1853 return -EINVAL; ··· 1867 1867 void *src, unsigned long count) 1868 1868 { 1869 1869 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); 1870 - char *channel_buf; 1870 + signed char *channel_buf; 1871 1871 1872 1872 channel_buf = rme9652_channel_buffer_location(rme9652, 1873 1873 substream->pstr->stream, ··· 1883 1883 void __user *dst, unsigned long count) 1884 1884 { 1885 1885 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); 1886 - char *channel_buf; 1886 + signed char *channel_buf; 1887 1887 1888 1888 if (snd_BUG_ON(pos + count > RME9652_CHANNEL_BUFFER_BYTES)) 1889 1889 return -EINVAL; ··· 1903 1903 void *dst, unsigned long count) 1904 1904 { 1905 1905 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); 1906 - char *channel_buf; 1906 + signed char *channel_buf; 1907 1907 1908 1908 channel_buf = rme9652_channel_buffer_location(rme9652, 1909 1909 substream->pstr->stream, ··· 1919 1919 unsigned long count) 1920 1920 { 1921 1921 struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); 1922 - char *channel_buf; 1922 + signed char *channel_buf; 1923 1923 1924 1924 channel_buf = rme9652_channel_buffer_location (rme9652, 1925 1925 substream->pstr->stream,
+21
sound/soc/amd/yc/acp6x-mach.c
··· 49 49 .driver_data = &acp6x_card, 50 50 .matches = { 51 51 DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 52 + DMI_MATCH(DMI_PRODUCT_NAME, "21D0"), 53 + } 54 + }, 55 + { 56 + .driver_data = &acp6x_card, 57 + .matches = { 58 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 59 + DMI_MATCH(DMI_PRODUCT_NAME, "21D0"), 60 + } 61 + }, 62 + { 63 + .driver_data = &acp6x_card, 64 + .matches = { 65 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 66 + DMI_MATCH(DMI_PRODUCT_NAME, "21D1"), 67 + } 68 + }, 69 + { 70 + .driver_data = &acp6x_card, 71 + .matches = { 72 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 52 73 DMI_MATCH(DMI_PRODUCT_NAME, "21D2"), 53 74 } 54 75 },
+1
sound/soc/codecs/Kconfig
··· 1629 1629 config SND_SOC_TLV320ADC3XXX 1630 1630 tristate "Texas Instruments TLV320ADC3001/3101 audio ADC" 1631 1631 depends on I2C 1632 + depends on GPIOLIB 1632 1633 help 1633 1634 Enable support for Texas Instruments TLV320ADC3001 and TLV320ADC3101 1634 1635 ADCs.
+1 -1
sound/soc/codecs/cx2072x.h
··· 177 177 #define CX2072X_PLBK_DRC_PARM_LEN 9 178 178 #define CX2072X_CLASSD_AMP_LEN 6 179 179 180 - /* DAI interfae type */ 180 + /* DAI interface type */ 181 181 #define CX2072X_DAI_HIFI 1 182 182 #define CX2072X_DAI_DSP 2 183 183 #define CX2072X_DAI_DSP_PWM 3 /* 4 ch, including mic and AEC */
+19 -15
sound/soc/codecs/jz4725b.c
··· 136 136 #define REG_CGR3_GO1L_OFFSET 0 137 137 #define REG_CGR3_GO1L_MASK (0x1f << REG_CGR3_GO1L_OFFSET) 138 138 139 + #define REG_CGR10_GIL_OFFSET 0 140 + #define REG_CGR10_GIR_OFFSET 4 141 + 139 142 struct jz_icdc { 140 143 struct regmap *regmap; 141 144 void __iomem *base; 142 145 struct clk *clk; 143 146 }; 144 147 145 - static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_dac_tlv, -2250, 0); 146 - static const SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(jz4725b_line_tlv, -1500, 600); 148 + static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_adc_tlv, 0, 150, 0); 149 + static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(jz4725b_dac_tlv, -2250, 150, 0); 147 150 148 151 static const struct snd_kcontrol_new jz4725b_codec_controls[] = { 149 152 SOC_DOUBLE_TLV("Master Playback Volume", ··· 154 151 REG_CGR1_GODL_OFFSET, 155 152 REG_CGR1_GODR_OFFSET, 156 153 0xf, 1, jz4725b_dac_tlv), 157 - SOC_DOUBLE_R_TLV("Master Capture Volume", 158 - JZ4725B_CODEC_REG_CGR3, 159 - JZ4725B_CODEC_REG_CGR2, 160 - REG_CGR2_GO1R_OFFSET, 161 - 0x1f, 1, jz4725b_line_tlv), 154 + SOC_DOUBLE_TLV("Master Capture Volume", 155 + JZ4725B_CODEC_REG_CGR10, 156 + REG_CGR10_GIL_OFFSET, 157 + REG_CGR10_GIR_OFFSET, 158 + 0xf, 0, jz4725b_adc_tlv), 162 159 163 160 SOC_SINGLE("Master Playback Switch", JZ4725B_CODEC_REG_CR1, 164 161 REG_CR1_DAC_MUTE_OFFSET, 1, 1), ··· 183 180 jz4725b_codec_adc_src_texts, 184 181 jz4725b_codec_adc_src_values); 185 182 static const struct snd_kcontrol_new jz4725b_codec_adc_src_ctrl = 186 - SOC_DAPM_ENUM("Route", jz4725b_codec_adc_src_enum); 183 + SOC_DAPM_ENUM("ADC Source Capture Route", jz4725b_codec_adc_src_enum); 187 184 188 185 static const struct snd_kcontrol_new jz4725b_codec_mixer_controls[] = { 189 186 SOC_DAPM_SINGLE("Line In Bypass", JZ4725B_CODEC_REG_CR1, ··· 228 225 SND_SOC_DAPM_ADC("ADC", "Capture", 229 226 JZ4725B_CODEC_REG_PMR1, REG_PMR1_SB_ADC_OFFSET, 1), 230 227 231 - SND_SOC_DAPM_MUX("ADC Source", SND_SOC_NOPM, 0, 0, 228 + SND_SOC_DAPM_MUX("ADC Source Capture Route", SND_SOC_NOPM, 0, 0, 232 229 &jz4725b_codec_adc_src_ctrl), 233 230 234 231 /* Mixer */ ··· 239 236 SND_SOC_DAPM_MIXER("DAC to Mixer", JZ4725B_CODEC_REG_CR1, 240 237 REG_CR1_DACSEL_OFFSET, 0, NULL, 0), 241 238 242 - SND_SOC_DAPM_MIXER("Line In", SND_SOC_NOPM, 0, 0, NULL, 0), 239 + SND_SOC_DAPM_MIXER("Line In", JZ4725B_CODEC_REG_PMR1, 240 + REG_PMR1_SB_LIN_OFFSET, 1, NULL, 0), 243 241 SND_SOC_DAPM_MIXER("HP Out", JZ4725B_CODEC_REG_CR1, 244 242 REG_CR1_HP_DIS_OFFSET, 1, NULL, 0), 245 243 ··· 287 283 {"Mixer", NULL, "DAC to Mixer"}, 288 284 289 285 {"Mixer to ADC", NULL, "Mixer"}, 290 - {"ADC Source", "Mixer", "Mixer to ADC"}, 291 - {"ADC Source", "Line In", "Line In"}, 292 - {"ADC Source", "Mic 1", "Mic 1"}, 293 - {"ADC Source", "Mic 2", "Mic 2"}, 294 - {"ADC", NULL, "ADC Source"}, 286 + {"ADC Source Capture Route", "Mixer", "Mixer to ADC"}, 287 + {"ADC Source Capture Route", "Line In", "Line In"}, 288 + {"ADC Source Capture Route", "Mic 1", "Mic 1"}, 289 + {"ADC Source Capture Route", "Mic 2", "Mic 2"}, 290 + {"ADC", NULL, "ADC Source Capture Route"}, 295 291 296 292 {"Out Stage", NULL, "Mixer"}, 297 293 {"HP Out", NULL, "Out Stage"},
+4 -4
sound/soc/codecs/mt6660.c
··· 503 503 dev_err(chip->dev, "read chip revision fail\n"); 504 504 goto probe_fail; 505 505 } 506 + pm_runtime_set_active(chip->dev); 507 + pm_runtime_enable(chip->dev); 506 508 507 509 ret = devm_snd_soc_register_component(chip->dev, 508 510 &mt6660_component_driver, 509 511 &mt6660_codec_dai, 1); 510 - if (!ret) { 511 - pm_runtime_set_active(chip->dev); 512 - pm_runtime_enable(chip->dev); 513 - } 512 + if (ret) 513 + pm_runtime_disable(chip->dev); 514 514 515 515 return ret; 516 516
+11 -9
sound/soc/codecs/rt1019.c
··· 391 391 unsigned int rx_mask, int slots, int slot_width) 392 392 { 393 393 struct snd_soc_component *component = dai->component; 394 - unsigned int val = 0, rx_slotnum; 394 + unsigned int cn = 0, cl = 0, rx_slotnum; 395 395 int ret = 0, first_bit; 396 396 397 397 switch (slots) { 398 398 case 4: 399 - val |= RT1019_I2S_TX_4CH; 399 + cn = RT1019_I2S_TX_4CH; 400 400 break; 401 401 case 6: 402 - val |= RT1019_I2S_TX_6CH; 402 + cn = RT1019_I2S_TX_6CH; 403 403 break; 404 404 case 8: 405 - val |= RT1019_I2S_TX_8CH; 405 + cn = RT1019_I2S_TX_8CH; 406 406 break; 407 407 case 2: 408 408 break; ··· 412 412 413 413 switch (slot_width) { 414 414 case 20: 415 - val |= RT1019_I2S_DL_20; 415 + cl = RT1019_TDM_CL_20; 416 416 break; 417 417 case 24: 418 - val |= RT1019_I2S_DL_24; 418 + cl = RT1019_TDM_CL_24; 419 419 break; 420 420 case 32: 421 - val |= RT1019_I2S_DL_32; 421 + cl = RT1019_TDM_CL_32; 422 422 break; 423 423 case 8: 424 - val |= RT1019_I2S_DL_8; 424 + cl = RT1019_TDM_CL_8; 425 425 break; 426 426 case 16: 427 427 break; ··· 470 470 goto _set_tdm_err_; 471 471 } 472 472 473 + snd_soc_component_update_bits(component, RT1019_TDM_1, 474 + RT1019_TDM_CL_MASK, cl); 473 475 snd_soc_component_update_bits(component, RT1019_TDM_2, 474 - RT1019_I2S_CH_TX_MASK | RT1019_I2S_DF_MASK, val); 476 + RT1019_I2S_CH_TX_MASK, cn); 475 477 476 478 _set_tdm_err_: 477 479 return ret;
+6
sound/soc/codecs/rt1019.h
··· 95 95 #define RT1019_TDM_BCLK_MASK (0x1 << 6) 96 96 #define RT1019_TDM_BCLK_NORM (0x0 << 6) 97 97 #define RT1019_TDM_BCLK_INV (0x1 << 6) 98 + #define RT1019_TDM_CL_MASK (0x7) 99 + #define RT1019_TDM_CL_8 (0x4) 100 + #define RT1019_TDM_CL_32 (0x3) 101 + #define RT1019_TDM_CL_24 (0x2) 102 + #define RT1019_TDM_CL_20 (0x1) 103 + #define RT1019_TDM_CL_16 (0x0) 98 104 99 105 /* 0x0401 TDM Control-2 */ 100 106 #define RT1019_I2S_CH_TX_MASK (0x3 << 6)
+14 -3
sound/soc/codecs/rt1308-sdw.c
··· 50 50 case 0x3008: 51 51 case 0x300a: 52 52 case 0xc000: 53 + case 0xc710: 53 54 case 0xc860 ... 0xc863: 54 55 case 0xc870 ... 0xc873: 55 56 return true; ··· 201 200 { 202 201 struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(dev); 203 202 int ret = 0; 203 + unsigned int tmp; 204 204 205 205 if (rt1308->hw_init) 206 206 return 0; ··· 233 231 /* sw reset */ 234 232 regmap_write(rt1308->regmap, RT1308_SDW_RESET, 0); 235 233 234 + regmap_read(rt1308->regmap, 0xc710, &tmp); 235 + rt1308->hw_ver = tmp; 236 + dev_dbg(dev, "%s, hw_ver=0x%x\n", __func__, rt1308->hw_ver); 237 + 236 238 /* initial settings */ 237 239 regmap_write(rt1308->regmap, 0xc103, 0xc0); 238 240 regmap_write(rt1308->regmap, 0xc030, 0x17); ··· 252 246 regmap_write(rt1308->regmap, 0xc062, 0x05); 253 247 regmap_write(rt1308->regmap, 0xc171, 0x07); 254 248 regmap_write(rt1308->regmap, 0xc173, 0x0d); 255 - regmap_write(rt1308->regmap, 0xc311, 0x7f); 256 - regmap_write(rt1308->regmap, 0xc900, 0x90); 249 + if (rt1308->hw_ver == RT1308_VER_C) { 250 + regmap_write(rt1308->regmap, 0xc311, 0x7f); 251 + regmap_write(rt1308->regmap, 0xc300, 0x09); 252 + } else { 253 + regmap_write(rt1308->regmap, 0xc311, 0x4f); 254 + regmap_write(rt1308->regmap, 0xc300, 0x0b); 255 + } 256 + regmap_write(rt1308->regmap, 0xc900, 0x5a); 257 257 regmap_write(rt1308->regmap, 0xc1a0, 0x84); 258 258 regmap_write(rt1308->regmap, 0xc1a1, 0x01); 259 259 regmap_write(rt1308->regmap, 0xc360, 0x78); ··· 269 257 regmap_write(rt1308->regmap, 0xc070, 0x00); 270 258 regmap_write(rt1308->regmap, 0xc100, 0xd7); 271 259 regmap_write(rt1308->regmap, 0xc101, 0xd7); 272 - regmap_write(rt1308->regmap, 0xc300, 0x09); 273 260 274 261 if (rt1308->first_hw_init) { 275 262 regcache_cache_bypass(rt1308->regmap, false);
+3
sound/soc/codecs/rt1308-sdw.h
··· 139 139 { 0x3005, 0x23 }, 140 140 { 0x3008, 0x02 }, 141 141 { 0x300a, 0x00 }, 142 + { 0xc000 | (RT1308_DATA_PATH << 4), 0x00 }, 142 143 { 0xc003 | (RT1308_DAC_SET << 4), 0x00 }, 143 144 { 0xc000 | (RT1308_POWER << 4), 0x00 }, 144 145 { 0xc001 | (RT1308_POWER << 4), 0x00 }, 145 146 { 0xc002 | (RT1308_POWER << 4), 0x00 }, 147 + { 0xc000 | (RT1308_POWER_STATUS << 4), 0x00 }, 146 148 }; 147 149 148 150 #define RT1308_SDW_OFFSET 0xc000 ··· 165 163 bool first_hw_init; 166 164 int rx_mask; 167 165 int slots; 166 + int hw_ver; 168 167 }; 169 168 170 169 struct sdw_stream_data {
+5
sound/soc/codecs/rt1308.h
··· 286 286 RT1308_AIFS 287 287 }; 288 288 289 + enum rt1308_hw_ver { 290 + RT1308_VER_C = 2, 291 + RT1308_VER_D 292 + }; 293 + 289 294 #endif /* end of _RT1308_H_ */
+13 -2
sound/soc/codecs/rt5682s.c
··· 1981 1981 unsigned int rx_mask, int slots, int slot_width) 1982 1982 { 1983 1983 struct snd_soc_component *component = dai->component; 1984 - unsigned int cl, val = 0; 1984 + unsigned int cl, val = 0, tx_slotnum; 1985 1985 1986 1986 if (tx_mask || rx_mask) 1987 1987 snd_soc_component_update_bits(component, ··· 1989 1989 else 1990 1990 snd_soc_component_update_bits(component, 1991 1991 RT5682S_TDM_ADDA_CTRL_2, RT5682S_TDM_EN, 0); 1992 + 1993 + /* Tx slot configuration */ 1994 + tx_slotnum = hweight_long(tx_mask); 1995 + if (tx_slotnum) { 1996 + if (tx_slotnum > slots) { 1997 + dev_err(component->dev, "Invalid or oversized Tx slots.\n"); 1998 + return -EINVAL; 1999 + } 2000 + val |= (tx_slotnum - 1) << RT5682S_TDM_ADC_DL_SFT; 2001 + } 1992 2002 1993 2003 switch (slots) { 1994 2004 case 4: ··· 2020 2010 } 2021 2011 2022 2012 snd_soc_component_update_bits(component, RT5682S_TDM_CTRL, 2023 - RT5682S_TDM_TX_CH_MASK | RT5682S_TDM_RX_CH_MASK, val); 2013 + RT5682S_TDM_TX_CH_MASK | RT5682S_TDM_RX_CH_MASK | 2014 + RT5682S_TDM_ADC_DL_MASK, val); 2024 2015 2025 2016 switch (slot_width) { 2026 2017 case 8:
+1
sound/soc/codecs/rt5682s.h
··· 899 899 #define RT5682S_TDM_RX_CH_8 (0x3 << 8) 900 900 #define RT5682S_TDM_ADC_LCA_MASK (0x7 << 4) 901 901 #define RT5682S_TDM_ADC_LCA_SFT 4 902 + #define RT5682S_TDM_ADC_DL_MASK (0x3 << 0) 902 903 #define RT5682S_TDM_ADC_DL_SFT 0 903 904 904 905 /* TDM control 2 (0x007a) */
+1 -1
sound/soc/codecs/tlv320adc3xxx.c
··· 1449 1449 .of_match_table = tlv320adc3xxx_of_match, 1450 1450 }, 1451 1451 .probe_new = adc3xxx_i2c_probe, 1452 - .remove = adc3xxx_i2c_remove, 1452 + .remove = __exit_p(adc3xxx_i2c_remove), 1453 1453 .id_table = adc3xxx_i2c_id, 1454 1454 }; 1455 1455
+4 -3
sound/soc/codecs/wm5102.c
··· 2099 2099 regmap_update_bits(arizona->regmap, wm5102_digital_vu[i], 2100 2100 WM5102_DIG_VU, WM5102_DIG_VU); 2101 2101 2102 + pm_runtime_enable(&pdev->dev); 2103 + pm_runtime_idle(&pdev->dev); 2104 + 2102 2105 ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, 2103 2106 "ADSP2 Compressed IRQ", wm5102_adsp2_irq, 2104 2107 wm5102); ··· 2134 2131 goto err_spk_irqs; 2135 2132 } 2136 2133 2137 - pm_runtime_enable(&pdev->dev); 2138 - pm_runtime_idle(&pdev->dev); 2139 - 2140 2134 return ret; 2141 2135 2142 2136 err_spk_irqs: ··· 2142 2142 arizona_set_irq_wake(arizona, ARIZONA_IRQ_DSP_IRQ1, 0); 2143 2143 arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, wm5102); 2144 2144 err_jack_codec_dev: 2145 + pm_runtime_disable(&pdev->dev); 2145 2146 arizona_jack_codec_dev_remove(&wm5102->core); 2146 2147 2147 2148 return ret;
+4 -3
sound/soc/codecs/wm5110.c
··· 2457 2457 regmap_update_bits(arizona->regmap, wm5110_digital_vu[i], 2458 2458 WM5110_DIG_VU, WM5110_DIG_VU); 2459 2459 2460 + pm_runtime_enable(&pdev->dev); 2461 + pm_runtime_idle(&pdev->dev); 2462 + 2460 2463 ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, 2461 2464 "ADSP2 Compressed IRQ", wm5110_adsp2_irq, 2462 2465 wm5110); ··· 2492 2489 goto err_spk_irqs; 2493 2490 } 2494 2491 2495 - pm_runtime_enable(&pdev->dev); 2496 - pm_runtime_idle(&pdev->dev); 2497 - 2498 2492 return ret; 2499 2493 2500 2494 err_spk_irqs: ··· 2500 2500 arizona_set_irq_wake(arizona, ARIZONA_IRQ_DSP_IRQ1, 0); 2501 2501 arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, wm5110); 2502 2502 err_jack_codec_dev: 2503 + pm_runtime_disable(&pdev->dev); 2503 2504 arizona_jack_codec_dev_remove(&wm5110->core); 2504 2505 2505 2506 return ret;
+52 -2
sound/soc/codecs/wm8962.c
··· 1840 1840 4, 1, 0, inmix_tlv), 1841 1841 }; 1842 1842 1843 + static int tp_event(struct snd_soc_dapm_widget *w, 1844 + struct snd_kcontrol *kcontrol, int event) 1845 + { 1846 + int ret, reg, val, mask; 1847 + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); 1848 + 1849 + ret = pm_runtime_resume_and_get(component->dev); 1850 + if (ret < 0) { 1851 + dev_err(component->dev, "Failed to resume device: %d\n", ret); 1852 + return ret; 1853 + } 1854 + 1855 + reg = WM8962_ADDITIONAL_CONTROL_4; 1856 + 1857 + if (!strcmp(w->name, "TEMP_HP")) { 1858 + mask = WM8962_TEMP_ENA_HP_MASK; 1859 + val = WM8962_TEMP_ENA_HP; 1860 + } else if (!strcmp(w->name, "TEMP_SPK")) { 1861 + mask = WM8962_TEMP_ENA_SPK_MASK; 1862 + val = WM8962_TEMP_ENA_SPK; 1863 + } else { 1864 + pm_runtime_put(component->dev); 1865 + return -EINVAL; 1866 + } 1867 + 1868 + switch (event) { 1869 + case SND_SOC_DAPM_POST_PMD: 1870 + val = 0; 1871 + fallthrough; 1872 + case SND_SOC_DAPM_POST_PMU: 1873 + ret = snd_soc_component_update_bits(component, reg, mask, val); 1874 + break; 1875 + default: 1876 + WARN(1, "Invalid event %d\n", event); 1877 + pm_runtime_put(component->dev); 1878 + return -EINVAL; 1879 + } 1880 + 1881 + pm_runtime_put(component->dev); 1882 + 1883 + return 0; 1884 + } 1885 + 1843 1886 static int cp_event(struct snd_soc_dapm_widget *w, 1844 1887 struct snd_kcontrol *kcontrol, int event) 1845 1888 { ··· 2183 2140 SND_SOC_DAPM_SUPPLY_S("DSP2", 1, WM8962_DSP2_POWER_MANAGEMENT, 2184 2141 WM8962_DSP2_ENA_SHIFT, 0, dsp2_event, 2185 2142 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 2186 - SND_SOC_DAPM_SUPPLY("TEMP_HP", WM8962_ADDITIONAL_CONTROL_4, 2, 0, NULL, 0), 2187 - SND_SOC_DAPM_SUPPLY("TEMP_SPK", WM8962_ADDITIONAL_CONTROL_4, 1, 0, NULL, 0), 2143 + SND_SOC_DAPM_SUPPLY("TEMP_HP", SND_SOC_NOPM, 0, 0, tp_event, 2144 + SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD), 2145 + SND_SOC_DAPM_SUPPLY("TEMP_SPK", SND_SOC_NOPM, 0, 0, tp_event, 2146 + SND_SOC_DAPM_POST_PMU|SND_SOC_DAPM_POST_PMD), 2188 2147 2189 2148 SND_SOC_DAPM_MIXER("INPGAL", WM8962_LEFT_INPUT_PGA_CONTROL, 4, 0, 2190 2149 inpgal, ARRAY_SIZE(inpgal)), ··· 3807 3762 &soc_component_dev_wm8962, &wm8962_dai, 1); 3808 3763 if (ret < 0) 3809 3764 goto err_pm_runtime; 3765 + 3766 + regmap_update_bits(wm8962->regmap, WM8962_ADDITIONAL_CONTROL_4, 3767 + WM8962_TEMP_ENA_HP_MASK, 0); 3768 + regmap_update_bits(wm8962->regmap, WM8962_ADDITIONAL_CONTROL_4, 3769 + WM8962_TEMP_ENA_SPK_MASK, 0); 3810 3770 3811 3771 regcache_cache_only(wm8962->regmap, true); 3812 3772
+4 -3
sound/soc/codecs/wm8997.c
··· 1161 1161 regmap_update_bits(arizona->regmap, wm8997_digital_vu[i], 1162 1162 WM8997_DIG_VU, WM8997_DIG_VU); 1163 1163 1164 + pm_runtime_enable(&pdev->dev); 1165 + pm_runtime_idle(&pdev->dev); 1166 + 1164 1167 arizona_init_common(arizona); 1165 1168 1166 1169 ret = arizona_init_vol_limit(arizona); ··· 1182 1179 goto err_spk_irqs; 1183 1180 } 1184 1181 1185 - pm_runtime_enable(&pdev->dev); 1186 - pm_runtime_idle(&pdev->dev); 1187 - 1188 1182 return ret; 1189 1183 1190 1184 err_spk_irqs: 1191 1185 arizona_free_spk_irqs(arizona); 1192 1186 err_jack_codec_dev: 1187 + pm_runtime_disable(&pdev->dev); 1193 1188 arizona_jack_codec_dev_remove(&wm8997->core); 1194 1189 1195 1190 return ret;
+1 -1
sound/soc/generic/audio-graph-card.c
··· 417 417 * or has convert-xxx property 418 418 */ 419 419 if ((of_get_child_count(codec_port) > 1) || 420 - (adata->convert_rate || adata->convert_channels)) 420 + asoc_simple_is_convert_required(adata)) 421 421 return true; 422 422 423 423 return false;
+15
sound/soc/generic/simple-card-utils.c
··· 85 85 } 86 86 EXPORT_SYMBOL_GPL(asoc_simple_parse_convert); 87 87 88 + /** 89 + * asoc_simple_is_convert_required() - Query if HW param conversion was requested 90 + * @data: Link data. 91 + * 92 + * Returns true if any HW param conversion was requested for this DAI link with 93 + * any "convert-xxx" properties. 94 + */ 95 + bool asoc_simple_is_convert_required(const struct asoc_simple_data *data) 96 + { 97 + return data->convert_rate || 98 + data->convert_channels || 99 + data->convert_sample_format; 100 + } 101 + EXPORT_SYMBOL_GPL(asoc_simple_is_convert_required); 102 + 88 103 int asoc_simple_parse_daifmt(struct device *dev, 89 104 struct device_node *node, 90 105 struct device_node *codec,
+1 -2
sound/soc/generic/simple-card.c
··· 393 393 * or has convert-xxx property 394 394 */ 395 395 if (dpcm_selectable && 396 - (num > 2 || 397 - adata.convert_rate || adata.convert_channels)) { 396 + (num > 2 || asoc_simple_is_convert_required(&adata))) { 398 397 /* 399 398 * np 400 399 * |1(CPU)|0(Codec) li->cpu
+12
sound/soc/intel/boards/sof_rt5682.c
··· 223 223 SOF_RT5682_SSP_AMP(2) | 224 224 SOF_RT5682_NUM_HDMIDEV(4)), 225 225 }, 226 + { 227 + .callback = sof_rt5682_quirk_cb, 228 + .matches = { 229 + DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Rex"), 230 + }, 231 + .driver_data = (void *)(SOF_RT5682_MCLK_EN | 232 + SOF_RT5682_SSP_CODEC(2) | 233 + SOF_SPEAKER_AMP_PRESENT | 234 + SOF_RT5682_SSP_AMP(0) | 235 + SOF_RT5682_NUM_HDMIDEV(4) 236 + ), 237 + }, 226 238 {} 227 239 }; 228 240
+11
sound/soc/intel/boards/sof_sdw.c
··· 202 202 SOF_SDW_PCH_DMIC | 203 203 RT711_JD1), 204 204 }, 205 + { 206 + /* NUC15 LAPBC710 skews */ 207 + .callback = sof_sdw_quirk_cb, 208 + .matches = { 209 + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), 210 + DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"), 211 + }, 212 + .driver_data = (void *)(SOF_SDW_TGL_HDMI | 213 + SOF_SDW_PCH_DMIC | 214 + RT711_JD1), 215 + }, 205 216 /* TigerLake-SDCA devices */ 206 217 { 207 218 .callback = sof_sdw_quirk_cb,
+1 -7
sound/soc/intel/skylake/skl.c
··· 689 689 690 690 #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */ 691 691 692 - static void skl_codec_device_exit(struct device *dev) 693 - { 694 - snd_hdac_device_exit(dev_to_hdac_dev(dev)); 695 - } 696 - 697 692 static struct hda_codec *skl_codec_device_init(struct hdac_bus *bus, int addr) 698 693 { 699 694 struct hda_codec *codec; ··· 701 706 } 702 707 703 708 codec->core.type = HDA_DEV_ASOC; 704 - codec->core.dev.release = skl_codec_device_exit; 705 709 706 710 ret = snd_hdac_device_register(&codec->core); 707 711 if (ret) { 708 712 dev_err(bus->dev, "failed to register hdac device\n"); 709 - snd_hdac_device_exit(&codec->core); 713 + put_device(&codec->core.dev); 710 714 return ERR_PTR(ret); 711 715 } 712 716
+1
sound/soc/qcom/Kconfig
··· 187 187 config SND_SOC_SC7180 188 188 tristate "SoC Machine driver for SC7180 boards" 189 189 depends on I2C && GPIOLIB 190 + depends on SOUNDWIRE || SOUNDWIRE=n 190 191 select SND_SOC_QCOM_COMMON 191 192 select SND_SOC_LPASS_SC7180 192 193 select SND_SOC_MAX98357A
+10
sound/soc/qcom/lpass-cpu.c
··· 782 782 return true; 783 783 if (reg == LPASS_HDMI_TX_LEGACY_ADDR(v)) 784 784 return true; 785 + if (reg == LPASS_HDMI_TX_VBIT_CTL_ADDR(v)) 786 + return true; 787 + if (reg == LPASS_HDMI_TX_PARITY_ADDR(v)) 788 + return true; 785 789 786 790 for (i = 0; i < v->hdmi_rdma_channels; ++i) { 787 791 if (reg == LPAIF_HDMI_RDMACURR_REG(v, i)) 792 + return true; 793 + if (reg == LPASS_HDMI_TX_DMA_ADDR(v, i)) 794 + return true; 795 + if (reg == LPASS_HDMI_TX_CH_LSB_ADDR(v, i)) 796 + return true; 797 + if (reg == LPASS_HDMI_TX_CH_MSB_ADDR(v, i)) 788 798 return true; 789 799 } 790 800 return false;
+4 -2
sound/soc/soc-component.c
··· 1213 1213 int i; 1214 1214 1215 1215 for_each_rtd_components(rtd, i, component) { 1216 - int ret = pm_runtime_resume_and_get(component->dev); 1217 - if (ret < 0 && ret != -EACCES) 1216 + int ret = pm_runtime_get_sync(component->dev); 1217 + if (ret < 0 && ret != -EACCES) { 1218 + pm_runtime_put_noidle(component->dev); 1218 1219 return soc_component_ret(component, ret); 1220 + } 1219 1221 /* mark stream if succeeded */ 1220 1222 soc_component_mark_push(component, stream, pm); 1221 1223 }
+1 -7
sound/soc/sof/intel/hda-codec.c
··· 109 109 #define is_generic_config(x) 0 110 110 #endif 111 111 112 - static void hda_codec_device_exit(struct device *dev) 113 - { 114 - snd_hdac_device_exit(dev_to_hdac_dev(dev)); 115 - } 116 - 117 112 static struct hda_codec *hda_codec_device_init(struct hdac_bus *bus, int addr, int type) 118 113 { 119 114 struct hda_codec *codec; ··· 121 126 } 122 127 123 128 codec->core.type = type; 124 - codec->core.dev.release = hda_codec_device_exit; 125 129 126 130 ret = snd_hdac_device_register(&codec->core); 127 131 if (ret) { 128 132 dev_err(bus->dev, "failed to register hdac device\n"); 129 - snd_hdac_device_exit(&codec->core); 133 + put_device(&codec->core.dev); 130 134 return ERR_PTR(ret); 131 135 } 132 136
+1 -1
sound/soc/sof/intel/pci-mtl.c
··· 38 38 [SOF_INTEL_IPC4] = "intel/sof-ace-tplg", 39 39 }, 40 40 .default_fw_filename = { 41 - [SOF_INTEL_IPC4] = "dsp_basefw.bin", 41 + [SOF_INTEL_IPC4] = "sof-mtl.ri", 42 42 }, 43 43 .nocodec_tplg_filename = "sof-mtl-nocodec.tplg", 44 44 .ops = &sof_mtl_ops,
+29 -1
sound/soc/sof/intel/pci-tgl.c
··· 159 159 .ops_init = sof_tgl_ops_init, 160 160 }; 161 161 162 + static const struct sof_dev_desc adl_n_desc = { 163 + .machines = snd_soc_acpi_intel_adl_machines, 164 + .alt_machines = snd_soc_acpi_intel_adl_sdw_machines, 165 + .use_acpi_target_states = true, 166 + .resindex_lpe_base = 0, 167 + .resindex_pcicfg_base = -1, 168 + .resindex_imr_base = -1, 169 + .irqindex_host_ipc = -1, 170 + .chip_info = &tgl_chip_info, 171 + .ipc_supported_mask = BIT(SOF_IPC) | BIT(SOF_INTEL_IPC4), 172 + .ipc_default = SOF_IPC, 173 + .default_fw_path = { 174 + [SOF_IPC] = "intel/sof", 175 + [SOF_INTEL_IPC4] = "intel/avs/adl-n", 176 + }, 177 + .default_tplg_path = { 178 + [SOF_IPC] = "intel/sof-tplg", 179 + [SOF_INTEL_IPC4] = "intel/avs-tplg", 180 + }, 181 + .default_fw_filename = { 182 + [SOF_IPC] = "sof-adl-n.ri", 183 + [SOF_INTEL_IPC4] = "dsp_basefw.bin", 184 + }, 185 + .nocodec_tplg_filename = "sof-adl-nocodec.tplg", 186 + .ops = &sof_tgl_ops, 187 + .ops_init = sof_tgl_ops_init, 188 + }; 189 + 162 190 static const struct sof_dev_desc rpls_desc = { 163 191 .machines = snd_soc_acpi_intel_rpl_machines, 164 192 .alt_machines = snd_soc_acpi_intel_rpl_sdw_machines, ··· 274 246 { PCI_DEVICE(0x8086, 0x51cf), /* RPL-PX */ 275 247 .driver_data = (unsigned long)&rpl_desc}, 276 248 { PCI_DEVICE(0x8086, 0x54c8), /* ADL-N */ 277 - .driver_data = (unsigned long)&adl_desc}, 249 + .driver_data = (unsigned long)&adl_n_desc}, 278 250 { 0, } 279 251 }; 280 252 MODULE_DEVICE_TABLE(pci, sof_pci_ids);
+18 -2
sound/soc/sof/ipc4-mtrace.c
··· 108 108 int id; 109 109 u32 slot_offset; 110 110 void *log_buffer; 111 + struct mutex buffer_lock; /* for log_buffer alloc/free */ 111 112 u32 host_read_ptr; 112 113 u32 dsp_write_ptr; 113 114 /* pos update IPC arrived before the slot offset is known, queried */ ··· 129 128 struct sof_mtrace_core_data *core_data = inode->i_private; 130 129 int ret; 131 130 131 + mutex_lock(&core_data->buffer_lock); 132 + 133 + if (core_data->log_buffer) { 134 + ret = -EBUSY; 135 + goto out; 136 + } 137 + 132 138 ret = debugfs_file_get(file->f_path.dentry); 133 139 if (unlikely(ret)) 134 - return ret; 140 + goto out; 135 141 136 142 core_data->log_buffer = kmalloc(SOF_MTRACE_SLOT_SIZE, GFP_KERNEL); 137 143 if (!core_data->log_buffer) { 138 144 debugfs_file_put(file->f_path.dentry); 139 - return -ENOMEM; 145 + ret = -ENOMEM; 146 + goto out; 140 147 } 141 148 142 149 ret = simple_open(inode, file); ··· 152 143 kfree(core_data->log_buffer); 153 144 debugfs_file_put(file->f_path.dentry); 154 145 } 146 + 147 + out: 148 + mutex_unlock(&core_data->buffer_lock); 155 149 156 150 return ret; 157 151 } ··· 292 280 293 281 debugfs_file_put(file->f_path.dentry); 294 282 283 + mutex_lock(&core_data->buffer_lock); 295 284 kfree(core_data->log_buffer); 285 + core_data->log_buffer = NULL; 286 + mutex_unlock(&core_data->buffer_lock); 296 287 297 288 return 0; 298 289 } ··· 578 563 struct sof_mtrace_core_data *core_data = &priv->cores[i]; 579 564 580 565 init_waitqueue_head(&core_data->trace_sleep); 566 + mutex_init(&core_data->buffer_lock); 581 567 core_data->sdev = sdev; 582 568 core_data->id = i; 583 569 }
+1 -6
sound/synth/emux/emux.c
··· 126 126 */ 127 127 int snd_emux_free(struct snd_emux *emu) 128 128 { 129 - unsigned long flags; 130 - 131 129 if (! emu) 132 130 return -EINVAL; 133 131 134 - spin_lock_irqsave(&emu->voice_lock, flags); 135 - if (emu->timer_active) 136 - del_timer(&emu->tlist); 137 - spin_unlock_irqrestore(&emu->voice_lock, flags); 132 + del_timer_sync(&emu->tlist); 138 133 139 134 snd_emux_proc_free(emu); 140 135 snd_emux_delete_virmidi(emu);
+2
sound/usb/implicit.c
··· 47 47 static const struct snd_usb_implicit_fb_match playback_implicit_fb_quirks[] = { 48 48 /* Fixed EP */ 49 49 /* FIXME: check the availability of generic matching */ 50 + IMPLICIT_FB_FIXED_DEV(0x0763, 0x2030, 0x81, 3), /* M-Audio Fast Track C400 */ 51 + IMPLICIT_FB_FIXED_DEV(0x0763, 0x2031, 0x81, 3), /* M-Audio Fast Track C600 */ 50 52 IMPLICIT_FB_FIXED_DEV(0x0763, 0x2080, 0x81, 2), /* M-Audio FastTrack Ultra */ 51 53 IMPLICIT_FB_FIXED_DEV(0x0763, 0x2081, 0x81, 2), /* M-Audio FastTrack Ultra */ 52 54 IMPLICIT_FB_FIXED_DEV(0x2466, 0x8010, 0x81, 2), /* Fractal Audio Axe-Fx III */
+1 -1
sound/usb/mixer.c
··· 1631 1631 if (!found) 1632 1632 return; 1633 1633 1634 - strscpy(kctl->id.name, "Headphone", sizeof(kctl->id.name)); 1634 + snd_ctl_rename(card, kctl, "Headphone"); 1635 1635 } 1636 1636 1637 1637 static const struct usb_feature_control_info *get_feature_control_info(int control)