Skip to content

Commit c0fc71e

Browse files
committed
ASoC: SOF/Intel: small fixes and updates for 5.18
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: One important fix from Kai to restore DM1 L1 functionality, one important update from Peter to use DMA trace buffers as capture-only and sync them and a couple of minor updates for Intel/SOF platforms.
2 parents ee60f73 + d7be9e3 commit c0fc71e

5 files changed

Lines changed: 38 additions & 4 deletions

File tree

sound/soc/intel/common/soc-acpi-intel-adl-match.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,15 @@ static const struct snd_soc_acpi_link_adr adl_rvp[] = {
359359
{}
360360
};
361361

362+
static const struct snd_soc_acpi_link_adr adlps_rvp[] = {
363+
{
364+
.mask = BIT(0),
365+
.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
366+
.adr_d = rt711_sdca_0_adr,
367+
},
368+
{}
369+
};
370+
362371
static const struct snd_soc_acpi_link_adr adl_chromebook_base[] = {
363372
{
364373
.mask = BIT(0),
@@ -529,6 +538,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_sdw_machines[] = {
529538
.drv_name = "sof_sdw",
530539
.sof_tplg_filename = "sof-adl-rt711.tplg",
531540
},
541+
{
542+
.link_mask = 0x1, /* link0 required */
543+
.links = adlps_rvp,
544+
.drv_name = "sof_sdw",
545+
.sof_tplg_filename = "sof-adl-rt711.tplg",
546+
},
532547
{
533548
.link_mask = 0x5, /* rt5682 on link0 & 2xmax98373 on link 2 */
534549
.links = adl_chromebook_base,

sound/soc/sof/compress.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ void snd_sof_compr_init_elapsed_work(struct work_struct *work)
4646
*/
4747
void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream)
4848
{
49-
struct snd_soc_pcm_runtime *rtd = cstream->private_data;
50-
struct snd_compr_runtime *crtd = cstream->runtime;
49+
struct snd_soc_pcm_runtime *rtd;
50+
struct snd_compr_runtime *crtd;
5151
struct snd_soc_component *component;
5252
struct snd_compr_tstamp *tstamp;
5353
struct snd_sof_pcm *spcm;
5454

5555
if (!cstream)
5656
return;
5757

58+
rtd = cstream->private_data;
59+
crtd = cstream->runtime;
5860
tstamp = crtd->private_data;
5961
component = snd_soc_rtdcom_lookup(rtd, SOF_AUDIO_PCM_DRV_NAME);
6062

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
315315
runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE;
316316

317317
if (hda_always_enable_dmi_l1 ||
318+
direction == SNDRV_PCM_STREAM_PLAYBACK ||
318319
spcm->stream[substream->stream].d0i3_compatible)
319320
flags |= SOF_HDA_STREAM_DMI_L1_COMPATIBLE;
320321

sound/soc/sof/sof-pci-dev.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ static const struct dmi_system_id sof_tplg_table[] = {
7575
},
7676
.driver_data = "sof-adl-max98360a-rt5682-2way.tplg",
7777
},
78+
{
79+
.callback = sof_tplg_cb,
80+
.matches = {
81+
DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Brya"),
82+
DMI_MATCH(DMI_OEM_STRING, "AUDIO-AUDIO_MAX98357_ALC5682I_I2S_2WAY"),
83+
},
84+
.driver_data = "sof-adl-max98357a-rt5682-2way.tplg",
85+
},
7886

7987
{}
8088
};

sound/soc/sof/trace.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,13 @@ static ssize_t sof_dfsentry_trace_read(struct file *file, char __user *buffer,
320320
if (count > avail)
321321
count = avail;
322322

323+
/*
324+
* make sure that all trace data is available for the CPU as the trace
325+
* data buffer might be allocated from non consistent memory.
326+
* Note: snd_dma_buffer_sync() is called for normal audio playback and
327+
* capture streams also.
328+
*/
329+
snd_dma_buffer_sync(&sdev->dmatb, SNDRV_DMA_SYNC_CPU);
323330
/* copy available trace data to debugfs */
324331
rem = copy_to_user(buffer, ((u8 *)(dfse->buf) + lpos), count);
325332
if (rem)
@@ -464,8 +471,9 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev)
464471
}
465472

466473
/* allocate trace data buffer */
467-
ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV_SG, sdev->dev,
468-
DMA_BUF_SIZE_FOR_TRACE, &sdev->dmatb);
474+
ret = snd_dma_alloc_dir_pages(SNDRV_DMA_TYPE_DEV_SG, sdev->dev,
475+
DMA_FROM_DEVICE, DMA_BUF_SIZE_FOR_TRACE,
476+
&sdev->dmatb);
469477
if (ret < 0) {
470478
dev_err(sdev->dev,
471479
"error: can't alloc buffer for trace %d\n", ret);

0 commit comments

Comments
 (0)