Skip to content

Commit fdfa38e

Browse files
committed
Merge tag 'sound-fix-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A few more small fixes for 6.18-rc1. Most of changes are about ASoC Intel and SOF drivers, while a few other device-specific fixes are found for HD-audio, USB-audio, ASoC RT722VB and Meson" * tag 'sound-fix-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: rt722: add settings for rt722VB ASoC: meson: aiu-encoder-i2s: fix bit clock polarity ALSA: usb: fpc: replace kmalloc_array followed by copy_from_user with memdup_array_user ALSA: hda/tas2781: Enable init_profile_id for device initialization ALSA: emu10k1: Fix typo in docs ALSA: hda/realtek: Add quirk for ASUS ROG Zephyrus Duo ASoC: SOF: Intel: Read the LLP via the associated Link DMA channel ASoC: SOF: ipc4-pcm: do not report invalid delay values ASoC: SOF: sof-audio: add dev_dbg_ratelimited wrapper ASoC: SOF: Intel: hda-pcm: Place the constraint on period time instead of buffer time ASoC: SOF: ipc4-topology: Account for different ChainDMA host buffer size ASoC: SOF: ipc4-topology: Correct the minimum host DMA buffer size ASoC: SOF: ipc4-pcm: fix start offset calculation for chain DMA ASoC: SOF: ipc4-pcm: fix delay calculation when DSP resamples ASoC: SOF: ipc3-topology: Fix multi-core and static pipelines tear down ALSA: hda/hdmi: Add pin fix for HP ProDesk model
2 parents 06a88f4 + ca7a231 commit fdfa38e

File tree

16 files changed

+206
-55
lines changed

16 files changed

+206
-55
lines changed

Documentation/sound/cards/emu-mixer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ FX-bus
6666

6767
name='Clock Source',index=0
6868
---------------------------
69-
This control allows switching the word clock between interally generated
69+
This control allows switching the word clock between internally generated
7070
44.1 or 48 kHz, or a number of external sources.
7171

7272
Note: the sources for the 1616 CardBus card are unclear. Please report your

sound/hda/codecs/hdmi/hdmi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ static const struct snd_pci_quirk force_connect_list[] = {
15491549
SND_PCI_QUIRK(0x103c, 0x83e2, "HP EliteDesk 800 G4", 1),
15501550
SND_PCI_QUIRK(0x103c, 0x83ef, "HP MP9 G4 Retail System AMS", 1),
15511551
SND_PCI_QUIRK(0x103c, 0x845a, "HP EliteDesk 800 G4 DM 65W", 1),
1552+
SND_PCI_QUIRK(0x103c, 0x83f3, "HP ProDesk 400", 1),
15521553
SND_PCI_QUIRK(0x103c, 0x870f, "HP", 1),
15531554
SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1),
15541555
SND_PCI_QUIRK(0x103c, 0x8711, "HP", 1),

sound/hda/codecs/realtek/alc269.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3735,6 +3735,7 @@ enum {
37353735
ALC285_FIXUP_ASUS_GA605K_HEADSET_MIC,
37363736
ALC285_FIXUP_ASUS_GA605K_I2C_SPEAKER2_TO_DAC1,
37373737
ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC,
3738+
ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK,
37383739
};
37393740

37403741
/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -6164,6 +6165,14 @@ static const struct hda_fixup alc269_fixups[] = {
61646165
.chained = true,
61656166
.chain_id = ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
61666167
},
6168+
[ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK] = {
6169+
.type = HDA_FIXUP_PINS,
6170+
.v.pins = (const struct hda_pintbl[]) {
6171+
{ 0x17, 0x90170151 }, /* Internal Speaker LFE */
6172+
{ 0x1e, 0x90170150 }, /* Internal Speaker */
6173+
{ }
6174+
},
6175+
}
61676176
};
61686177

61696178
static const struct hda_quirk alc269_fixup_tbl[] = {
@@ -6718,6 +6727,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
67186727
SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
67196728
SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
67206729
SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC),
6730+
SND_PCI_QUIRK(0x1043, 0x1652, "ASUS ROG Zephyrus Do 15 SE", ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK),
67216731
SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
67226732
SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
67236733
SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),

sound/hda/codecs/side-codecs/tas2781_hda_i2c.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@ static void tasdevice_dspfw_init(void *context)
474474
if (tas_priv->fmw->nr_configurations > 0)
475475
tas_priv->cur_conf = 0;
476476

477+
/* Init common setting for different audio profiles */
478+
if (tas_priv->rcabin.init_profile_id >= 0)
479+
tasdevice_select_cfg_blk(tas_priv,
480+
tas_priv->rcabin.init_profile_id,
481+
TASDEVICE_BIN_BLK_PRE_POWER_UP);
482+
477483
/* If calibrated data occurs error, dsp will still works with default
478484
* calibrated data inside algo.
479485
*/
@@ -770,6 +776,12 @@ static int tas2781_system_resume(struct device *dev)
770776
tasdevice_reset(tas_hda->priv);
771777
tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog);
772778

779+
/* Init common setting for different audio profiles */
780+
if (tas_hda->priv->rcabin.init_profile_id >= 0)
781+
tasdevice_select_cfg_blk(tas_hda->priv,
782+
tas_hda->priv->rcabin.init_profile_id,
783+
TASDEVICE_BIN_BLK_PRE_POWER_UP);
784+
773785
if (tas_hda->priv->playback_started)
774786
tasdevice_tuning_switch(tas_hda->priv, 0);
775787

sound/soc/codecs/rt722-sdca-sdw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static int rt722_sdca_mbq_size(struct device *dev, unsigned int reg)
2121
switch (reg) {
2222
case 0x2f01 ... 0x2f0a:
2323
case 0x2f35 ... 0x2f36:
24-
case 0x2f50:
24+
case 0x2f50 ... 0x2f52:
2525
case 0x2f54:
2626
case 0x2f58 ... 0x2f5d:
2727
case SDW_SDCA_CTL(FUNC_NUM_JACK_CODEC, RT722_SDCA_ENT0, RT722_SDCA_CTL_FUNC_STATUS, 0):

sound/soc/codecs/rt722-sdca.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,9 @@ static void rt722_sdca_dmic_preset(struct rt722_sdca_priv *rt722)
13781378
/* PHYtiming TDZ/TZD control */
13791379
regmap_write(rt722->regmap, 0x2f03, 0x06);
13801380

1381+
if (rt722->hw_vid == RT722_VB)
1382+
regmap_write(rt722->regmap, 0x2f52, 0x00);
1383+
13811384
/* clear flag */
13821385
regmap_write(rt722->regmap,
13831386
SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT0, RT722_SDCA_CTL_FUNC_STATUS, 0),
@@ -1415,6 +1418,9 @@ static void rt722_sdca_amp_preset(struct rt722_sdca_priv *rt722)
14151418
SDW_SDCA_CTL(FUNC_NUM_AMP, RT722_SDCA_ENT_OT23,
14161419
RT722_SDCA_CTL_VENDOR_DEF, CH_08), 0x04);
14171420

1421+
if (rt722->hw_vid == RT722_VB)
1422+
regmap_write(rt722->regmap, 0x2f54, 0x00);
1423+
14181424
/* clear flag */
14191425
regmap_write(rt722->regmap,
14201426
SDW_SDCA_CTL(FUNC_NUM_AMP, RT722_SDCA_ENT0, RT722_SDCA_CTL_FUNC_STATUS, 0),
@@ -1506,6 +1512,9 @@ static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722)
15061512
rt722_sdca_index_write(rt722, RT722_VENDOR_REG, RT722_DIGITAL_MISC_CTRL4,
15071513
0x0010);
15081514

1515+
if (rt722->hw_vid == RT722_VB)
1516+
regmap_write(rt722->regmap, 0x2f51, 0x00);
1517+
15091518
/* clear flag */
15101519
regmap_write(rt722->regmap,
15111520
SDW_SDCA_CTL(FUNC_NUM_JACK_CODEC, RT722_SDCA_ENT0, RT722_SDCA_CTL_FUNC_STATUS, 0),
@@ -1516,6 +1525,7 @@ static void rt722_sdca_jack_preset(struct rt722_sdca_priv *rt722)
15161525
int rt722_sdca_io_init(struct device *dev, struct sdw_slave *slave)
15171526
{
15181527
struct rt722_sdca_priv *rt722 = dev_get_drvdata(dev);
1528+
unsigned int val;
15191529

15201530
rt722->disable_irq = false;
15211531

@@ -1545,6 +1555,10 @@ int rt722_sdca_io_init(struct device *dev, struct sdw_slave *slave)
15451555

15461556
pm_runtime_get_noresume(&slave->dev);
15471557

1558+
rt722_sdca_index_read(rt722, RT722_VENDOR_REG, RT722_JD_PRODUCT_NUM, &val);
1559+
rt722->hw_vid = (val & 0x0f00) >> 8;
1560+
dev_dbg(&slave->dev, "%s hw_vid=0x%x\n", __func__, rt722->hw_vid);
1561+
15481562
rt722_sdca_dmic_preset(rt722);
15491563
rt722_sdca_amp_preset(rt722);
15501564
rt722_sdca_jack_preset(rt722);

sound/soc/codecs/rt722-sdca.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct rt722_sdca_priv {
3939
/* For DMIC */
4040
bool fu1e_dapm_mute;
4141
bool fu1e_mixer_mute[4];
42+
int hw_vid;
4243
};
4344

4445
struct rt722_sdca_dmic_kctrl_priv {
@@ -233,6 +234,11 @@ enum rt722_sdca_jd_src {
233234
RT722_JD1,
234235
};
235236

237+
enum rt722_sdca_version {
238+
RT722_VA,
239+
RT722_VB,
240+
};
241+
236242
int rt722_sdca_io_init(struct device *dev, struct sdw_slave *slave);
237243
int rt722_sdca_init(struct device *dev, struct regmap *regmap, struct sdw_slave *slave);
238244
int rt722_sdca_index_write(struct rt722_sdca_priv *rt722,

sound/soc/meson/aiu-encoder-i2s.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,12 @@ static int aiu_encoder_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
236236
inv == SND_SOC_DAIFMT_IB_IF)
237237
val |= AIU_CLK_CTRL_LRCLK_INVERT;
238238

239-
if (inv == SND_SOC_DAIFMT_IB_NF ||
240-
inv == SND_SOC_DAIFMT_IB_IF)
239+
/*
240+
* The SoC changes data on the rising edge of the bitclock
241+
* so an inversion of the bitclock is required in normal mode
242+
*/
243+
if (inv == SND_SOC_DAIFMT_NB_NF ||
244+
inv == SND_SOC_DAIFMT_NB_IF)
241245
val |= AIU_CLK_CTRL_AOCLK_INVERT;
242246

243247
/* Signal skew */
@@ -328,4 +332,3 @@ const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = {
328332
.startup = aiu_encoder_i2s_startup,
329333
.shutdown = aiu_encoder_i2s_shutdown,
330334
};
331-

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

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#define SDnFMT_BITS(x) ((x) << 4)
3030
#define SDnFMT_CHAN(x) ((x) << 0)
3131

32+
#define HDA_MAX_PERIOD_TIME_HEADROOM 10
33+
3234
static bool hda_always_enable_dmi_l1;
3335
module_param_named(always_enable_dmi_l1, hda_always_enable_dmi_l1, bool, 0444);
3436
MODULE_PARM_DESC(always_enable_dmi_l1, "SOF HDA always enable DMI l1");
@@ -291,19 +293,30 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
291293
* On playback start the DMA will transfer dsp_max_burst_size_in_ms
292294
* amount of data in one initial burst to fill up the host DMA buffer.
293295
* Consequent DMA burst sizes are shorter and their length can vary.
294-
* To make sure that userspace allocate large enough ALSA buffer we need
295-
* to place a constraint on the buffer time.
296+
* To avoid immediate xrun by the initial burst we need to place
297+
* constraint on the period size (via PERIOD_TIME) to cover the size of
298+
* the host buffer.
299+
* We need to add headroom of max 10ms as the firmware needs time to
300+
* settle to the 1ms pacing and initially it can run faster for few
301+
* internal periods.
296302
*
297303
* On capture the DMA will transfer 1ms chunks.
298-
*
299-
* Exact dsp_max_burst_size_in_ms constraint is racy, so set the
300-
* constraint to a minimum of 2x dsp_max_burst_size_in_ms.
301304
*/
302-
if (spcm->stream[direction].dsp_max_burst_size_in_ms)
305+
if (spcm->stream[direction].dsp_max_burst_size_in_ms) {
306+
unsigned int period_time = spcm->stream[direction].dsp_max_burst_size_in_ms;
307+
308+
/*
309+
* add headroom over the maximum burst size to cover the time
310+
* needed for the DMA pace to settle.
311+
* Limit the headroom time to HDA_MAX_PERIOD_TIME_HEADROOM
312+
*/
313+
period_time += min(period_time, HDA_MAX_PERIOD_TIME_HEADROOM);
314+
303315
snd_pcm_hw_constraint_minmax(substream->runtime,
304-
SNDRV_PCM_HW_PARAM_BUFFER_TIME,
305-
spcm->stream[direction].dsp_max_burst_size_in_ms * USEC_PER_MSEC * 2,
316+
SNDRV_PCM_HW_PARAM_PERIOD_TIME,
317+
period_time * USEC_PER_MSEC,
306318
UINT_MAX);
319+
}
307320

308321
/* binding pcm substream to hda stream */
309322
substream->runtime->private_data = &dsp_stream->hstream;

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

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,10 +1129,35 @@ u64 hda_dsp_get_stream_llp(struct snd_sof_dev *sdev,
11291129
struct snd_soc_component *component,
11301130
struct snd_pcm_substream *substream)
11311131
{
1132-
struct hdac_stream *hstream = substream->runtime->private_data;
1133-
struct hdac_ext_stream *hext_stream = stream_to_hdac_ext_stream(hstream);
1132+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
1133+
struct snd_soc_pcm_runtime *be_rtd = NULL;
1134+
struct hdac_ext_stream *hext_stream;
1135+
struct snd_soc_dai *cpu_dai;
1136+
struct snd_soc_dpcm *dpcm;
11341137
u32 llp_l, llp_u;
11351138

1139+
/*
1140+
* The LLP needs to be read from the Link DMA used for this FE as it is
1141+
* allowed to use any combination of Link and Host channels
1142+
*/
1143+
for_each_dpcm_be(rtd, substream->stream, dpcm) {
1144+
if (dpcm->fe != rtd)
1145+
continue;
1146+
1147+
be_rtd = dpcm->be;
1148+
}
1149+
1150+
if (!be_rtd)
1151+
return 0;
1152+
1153+
cpu_dai = snd_soc_rtd_to_cpu(be_rtd, 0);
1154+
if (!cpu_dai)
1155+
return 0;
1156+
1157+
hext_stream = snd_soc_dai_get_dma_data(cpu_dai, substream);
1158+
if (!hext_stream)
1159+
return 0;
1160+
11361161
/*
11371162
* The pplc_addr have been calculated during probe in
11381163
* hda_dsp_stream_init():

0 commit comments

Comments
 (0)