Skip to content

Commit d18bbb7

Browse files
committed
Merge branch 'for-linus' into for-next
Sync with the pending 6.15 fixes. Signed-off-by: Takashi Iwai <[email protected]>
2 parents 547c577 + 62f134a commit d18bbb7

File tree

16 files changed

+100
-19
lines changed

16 files changed

+100
-19
lines changed

include/sound/hdaudio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ struct hdac_driver {
223223
struct device_driver driver;
224224
int type;
225225
const struct hda_device_id *id_table;
226-
int (*match)(struct hdac_device *dev, struct hdac_driver *drv);
226+
int (*match)(struct hdac_device *dev, const struct hdac_driver *drv);
227227
void (*unsol_event)(struct hdac_device *dev, unsigned int event);
228228

229229
/* fields used by ext bus APIs */
@@ -235,7 +235,7 @@ struct hdac_driver {
235235
#define drv_to_hdac_driver(_drv) container_of(_drv, struct hdac_driver, driver)
236236

237237
const struct hda_device_id *
238-
hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv);
238+
hdac_get_device_id(struct hdac_device *hdev, const struct hdac_driver *drv);
239239

240240
/*
241241
* Bus verb operators

include/sound/pcm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,8 @@ int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_s
14021402
#define snd_pcm_lib_mmap_iomem NULL
14031403
#endif
14041404

1405+
void snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime);
1406+
14051407
/**
14061408
* snd_pcm_limit_isa_dma_size - Get the max size fitting with ISA DMA transfer
14071409
* @dma: DMA number

sound/core/oss/pcm_oss.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,7 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream)
10741074
runtime->oss.params = 0;
10751075
runtime->oss.prepare = 1;
10761076
runtime->oss.buffer_used = 0;
1077-
if (runtime->dma_area)
1078-
snd_pcm_format_set_silence(runtime->format, runtime->dma_area, bytes_to_samples(runtime, runtime->dma_bytes));
1077+
snd_pcm_runtime_buffer_set_silence(runtime);
10791078

10801079
runtime->oss.period_frames = snd_pcm_alsa_frames(substream, oss_period_size);
10811080

sound/core/pcm_native.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,17 @@ static void snd_pcm_buffer_access_unlock(struct snd_pcm_runtime *runtime)
723723
atomic_inc(&runtime->buffer_accessing);
724724
}
725725

726+
/* fill the PCM buffer with the current silence format; called from pcm_oss.c */
727+
void snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime)
728+
{
729+
snd_pcm_buffer_access_lock(runtime);
730+
if (runtime->dma_area)
731+
snd_pcm_format_set_silence(runtime->format, runtime->dma_area,
732+
bytes_to_samples(runtime, runtime->dma_bytes));
733+
snd_pcm_buffer_access_unlock(runtime);
734+
}
735+
EXPORT_SYMBOL_GPL(snd_pcm_runtime_buffer_set_silence);
736+
726737
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
727738
#define is_oss_stream(substream) ((substream)->oss.oss)
728739
#else

sound/core/seq_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
4343
static int snd_seq_bus_match(struct device *dev, const struct device_driver *drv)
4444
{
4545
struct snd_seq_device *sdev = to_seq_dev(dev);
46-
struct snd_seq_driver *sdrv = to_seq_drv(drv);
46+
const struct snd_seq_driver *sdrv = to_seq_drv(drv);
4747

4848
return strcmp(sdrv->id, sdev->id) == 0 &&
4949
sdrv->argsize == sdev->argsize;

sound/hda/hda_bus_type.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ MODULE_LICENSE("GPL");
2121
* driver id_table and returns the matching device id entry.
2222
*/
2323
const struct hda_device_id *
24-
hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv)
24+
hdac_get_device_id(struct hdac_device *hdev, const struct hdac_driver *drv)
2525
{
2626
if (drv->id_table) {
2727
const struct hda_device_id *id = drv->id_table;
@@ -38,7 +38,7 @@ hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv)
3838
}
3939
EXPORT_SYMBOL_GPL(hdac_get_device_id);
4040

41-
static int hdac_codec_match(struct hdac_device *dev, struct hdac_driver *drv)
41+
static int hdac_codec_match(struct hdac_device *dev, const struct hdac_driver *drv)
4242
{
4343
if (hdac_get_device_id(dev, drv))
4444
return 1;
@@ -49,7 +49,7 @@ static int hdac_codec_match(struct hdac_device *dev, struct hdac_driver *drv)
4949
static int hda_bus_match(struct device *dev, const struct device_driver *drv)
5050
{
5151
struct hdac_device *hdev = dev_to_hdac_dev(dev);
52-
struct hdac_driver *hdrv = drv_to_hdac_driver(drv);
52+
const struct hdac_driver *hdrv = drv_to_hdac_driver(drv);
5353

5454
if (hdev->type != hdrv->type)
5555
return 0;

sound/pci/hda/hda_bind.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
/*
1919
* find a matching codec id
2020
*/
21-
static int hda_codec_match(struct hdac_device *dev, struct hdac_driver *drv)
21+
static int hda_codec_match(struct hdac_device *dev, const struct hdac_driver *drv)
2222
{
2323
struct hda_codec *codec = container_of(dev, struct hda_codec, core);
24-
struct hda_codec_driver *driver =
24+
const struct hda_codec_driver *driver =
2525
container_of(drv, struct hda_codec_driver, core);
2626
const struct hda_device_id *list;
2727
/* check probe_id instead of vendor_id if set */

sound/pci/hda/patch_realtek.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6830,7 +6830,10 @@ static void alc256_fixup_chromebook(struct hda_codec *codec,
68306830

68316831
switch (action) {
68326832
case HDA_FIXUP_ACT_PRE_PROBE:
6833-
spec->gen.suppress_auto_mute = 1;
6833+
if (codec->core.subsystem_id == 0x10280d76)
6834+
spec->gen.suppress_auto_mute = 0;
6835+
else
6836+
spec->gen.suppress_auto_mute = 1;
68346837
spec->gen.suppress_auto_mic = 1;
68356838
spec->en_3kpull_low = false;
68366839
break;
@@ -10892,9 +10895,12 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1089210895
SND_PCI_QUIRK(0x103c, 0x8e1a, "HP ZBook Firefly 14 G12A", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
1089310896
SND_PCI_QUIRK(0x103c, 0x8e1b, "HP EliteBook G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
1089410897
SND_PCI_QUIRK(0x103c, 0x8e1c, "HP EliteBook G12", ALC245_FIXUP_HP_ZBOOK_FIREFLY_G12A),
10898+
SND_PCI_QUIRK(0x103c, 0x8e1d, "HP ZBook X Gli 16 G12", ALC236_FIXUP_HP_GPIO_LED),
1089510899
SND_PCI_QUIRK(0x103c, 0x8e2c, "HP EliteBook 16 G12", ALC285_FIXUP_HP_GPIO_LED),
1089610900
SND_PCI_QUIRK(0x103c, 0x8e36, "HP 14 Enstrom OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
1089710901
SND_PCI_QUIRK(0x103c, 0x8e37, "HP 16 Piston OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
10902+
SND_PCI_QUIRK(0x103c, 0x8e3a, "HP Agusta", ALC287_FIXUP_CS35L41_I2C_2),
10903+
SND_PCI_QUIRK(0x103c, 0x8e3b, "HP Agusta", ALC287_FIXUP_CS35L41_I2C_2),
1089810904
SND_PCI_QUIRK(0x103c, 0x8e60, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
1089910905
SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
1090010906
SND_PCI_QUIRK(0x103c, 0x8e62, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
@@ -11310,6 +11316,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1131011316
SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
1131111317
SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C),
1131211318
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
11319+
SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
1131311320
SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
1131411321
SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C),
1131511322
SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C),

sound/soc/apple/mca.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,28 @@ static int mca_configure_serdes(struct mca_cluster *cl, int serdes_unit,
464464
return -EINVAL;
465465
}
466466

467+
static int mca_fe_startup(struct snd_pcm_substream *substream,
468+
struct snd_soc_dai *dai)
469+
{
470+
struct mca_cluster *cl = mca_dai_to_cluster(dai);
471+
unsigned int mask, nchannels;
472+
473+
if (cl->tdm_slots) {
474+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
475+
mask = cl->tdm_tx_mask;
476+
else
477+
mask = cl->tdm_rx_mask;
478+
479+
nchannels = hweight32(mask);
480+
} else {
481+
nchannels = 2;
482+
}
483+
484+
return snd_pcm_hw_constraint_minmax(substream->runtime,
485+
SNDRV_PCM_HW_PARAM_CHANNELS,
486+
1, nchannels);
487+
}
488+
467489
static int mca_fe_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
468490
unsigned int rx_mask, int slots, int slot_width)
469491
{
@@ -680,6 +702,7 @@ static int mca_fe_hw_params(struct snd_pcm_substream *substream,
680702
}
681703

682704
static const struct snd_soc_dai_ops mca_fe_ops = {
705+
.startup = mca_fe_startup,
683706
.set_fmt = mca_fe_set_fmt,
684707
.set_bclk_ratio = mca_set_bclk_ratio,
685708
.set_tdm_slot = mca_fe_set_tdm_slot,

sound/soc/mediatek/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ config SND_SOC_MT8188
228228
config SND_SOC_MT8188_MT6359
229229
tristate "ASoC Audio driver for MT8188 with MT6359 and I2S codecs"
230230
depends on SND_SOC_MT8188 && MTK_PMIC_WRAP
231+
depends on SND_SOC_MT6359_ACCDET || !SND_SOC_MT6359_ACCDET
231232
depends on I2C
232233
select SND_SOC_MT6359
233234
select SND_SOC_HDMI_CODEC

sound/soc/qcom/sdm845.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ static int sdm845_slim_snd_hw_params(struct snd_pcm_substream *substream,
9191
else
9292
ret = snd_soc_dai_set_channel_map(cpu_dai, tx_ch_cnt,
9393
tx_ch, 0, NULL);
94+
if (ret != 0 && ret != -ENOTSUPP) {
95+
dev_err(rtd->dev, "failed to set cpu chan map, err:%d\n", ret);
96+
return ret;
97+
}
9498
}
9599

96100
return 0;

sound/soc/sof/intel/hda-bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void sof_hda_bus_init(struct snd_sof_dev *sdev, struct device *dev)
7676

7777
snd_hdac_ext_bus_init(bus, dev, &bus_core_ops, sof_hda_ext_ops);
7878

79-
if (chip && chip->hw_ip_version == SOF_INTEL_ACE_2_0)
79+
if (chip && chip->hw_ip_version >= SOF_INTEL_ACE_2_0)
8080
bus->use_pio_for_commands = true;
8181
#else
8282
snd_hdac_ext_bus_init(bus, dev, NULL, NULL);

sound/soc/sof/intel/hda.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,21 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev,
10491049
if (!*mach && codec_num <= 2) {
10501050
bool tplg_fixup = false;
10511051

1052-
hda_mach = snd_soc_acpi_intel_hda_machines;
1052+
/*
1053+
* make a local copy of the match array since we might
1054+
* be modifying it
1055+
*/
1056+
hda_mach = devm_kmemdup_array(sdev->dev,
1057+
snd_soc_acpi_intel_hda_machines,
1058+
2, /* we have one entry + sentinel in the array */
1059+
sizeof(snd_soc_acpi_intel_hda_machines[0]),
1060+
GFP_KERNEL);
1061+
if (!hda_mach) {
1062+
dev_err(bus->dev,
1063+
"%s: failed to duplicate the HDA match table\n",
1064+
__func__);
1065+
return;
1066+
}
10531067

10541068
dev_info(bus->dev, "using HDA machine driver %s now\n",
10551069
hda_mach->drv_name);

sound/soc/sof/ipc4-control.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,14 @@ static int sof_ipc4_bytes_ext_put(struct snd_sof_control *scontrol,
531531
return -EINVAL;
532532
}
533533

534+
/* Check header id */
535+
if (header.numid != SOF_CTRL_CMD_BINARY) {
536+
dev_err_ratelimited(scomp->dev,
537+
"Incorrect numid for bytes put %d\n",
538+
header.numid);
539+
return -EINVAL;
540+
}
541+
534542
/* Verify the ABI header first */
535543
if (copy_from_user(&abi_hdr, tlvd->tlv, sizeof(abi_hdr)))
536544
return -EFAULT;
@@ -613,7 +621,8 @@ static int _sof_ipc4_bytes_ext_get(struct snd_sof_control *scontrol,
613621
if (data_size > size)
614622
return -ENOSPC;
615623

616-
header.numid = scontrol->comp_id;
624+
/* Set header id and length */
625+
header.numid = SOF_CTRL_CMD_BINARY;
617626
header.length = data_size;
618627

619628
if (copy_to_user(tlvd, &header, sizeof(struct snd_ctl_tlv)))

sound/soc/sof/ipc4-pcm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,8 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm
799799

800800
spcm->stream[stream].private = stream_priv;
801801

802-
if (!support_info)
802+
/* Delay reporting is only supported on playback */
803+
if (!support_info || stream == SNDRV_PCM_STREAM_CAPTURE)
803804
continue;
804805

805806
time_info = kzalloc(sizeof(*time_info), GFP_KERNEL);

sound/soc/sof/topology.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ static int sof_connect_dai_widget(struct snd_soc_component *scomp,
10711071
struct snd_sof_dai *dai)
10721072
{
10731073
struct snd_soc_card *card = scomp->card;
1074-
struct snd_soc_pcm_runtime *rtd;
1074+
struct snd_soc_pcm_runtime *rtd, *full, *partial;
10751075
struct snd_soc_dai *cpu_dai;
10761076
int stream;
10771077
int i;
@@ -1088,12 +1088,22 @@ static int sof_connect_dai_widget(struct snd_soc_component *scomp,
10881088
else
10891089
goto end;
10901090

1091+
full = NULL;
1092+
partial = NULL;
10911093
list_for_each_entry(rtd, &card->rtd_list, list) {
10921094
/* does stream match DAI link ? */
1093-
if (!rtd->dai_link->stream_name ||
1094-
!strstr(rtd->dai_link->stream_name, w->sname))
1095-
continue;
1095+
if (rtd->dai_link->stream_name) {
1096+
if (!strcmp(rtd->dai_link->stream_name, w->sname)) {
1097+
full = rtd;
1098+
break;
1099+
} else if (strstr(rtd->dai_link->stream_name, w->sname)) {
1100+
partial = rtd;
1101+
}
1102+
}
1103+
}
10961104

1105+
rtd = full ? full : partial;
1106+
if (rtd) {
10971107
for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
10981108
/*
10991109
* Please create DAI widget in the right order

0 commit comments

Comments
 (0)