Skip to content

Commit 4374f69

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: Intel: mtl/lnl: Use the generic get_stream_position callback
Drop the MTL mtl_dsp_get_stream_hda_link_position() function and related defines since it can only work on platforms which have 19 streams because of the use of 0x948 as base offset for the LLP registers. The generic hda_dsp_get_stream_hda_link_position() takes the number of streams into consideration when reading the LLP registers for the stream and can handle different HDA configurations. Cc: [email protected] # 6.8 Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Rander Wang <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 67b182b commit 4374f69

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

sound/soc/sof/intel/lnl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ int sof_lnl_ops_init(struct snd_sof_dev *sdev)
134134
sof_lnl_ops.runtime_resume = lnl_hda_dsp_runtime_resume;
135135
}
136136

137-
sof_lnl_ops.get_stream_position = mtl_dsp_get_stream_hda_link_position;
138-
139137
/* dsp core get/put */
140138
sof_lnl_ops.core_get = mtl_dsp_core_get;
141139
sof_lnl_ops.core_put = mtl_dsp_core_put;

sound/soc/sof/intel/mtl.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -626,18 +626,6 @@ static int mtl_dsp_disable_interrupts(struct snd_sof_dev *sdev)
626626
return mtl_enable_interrupts(sdev, false);
627627
}
628628

629-
u64 mtl_dsp_get_stream_hda_link_position(struct snd_sof_dev *sdev,
630-
struct snd_soc_component *component,
631-
struct snd_pcm_substream *substream)
632-
{
633-
struct hdac_stream *hstream = substream->runtime->private_data;
634-
u32 llp_l, llp_u;
635-
636-
llp_l = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, MTL_PPLCLLPL(hstream->index));
637-
llp_u = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, MTL_PPLCLLPU(hstream->index));
638-
return ((u64)llp_u << 32) | llp_l;
639-
}
640-
641629
int mtl_dsp_core_get(struct snd_sof_dev *sdev, int core)
642630
{
643631
const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
@@ -707,8 +695,6 @@ int sof_mtl_ops_init(struct snd_sof_dev *sdev)
707695
sof_mtl_ops.core_get = mtl_dsp_core_get;
708696
sof_mtl_ops.core_put = mtl_dsp_core_put;
709697

710-
sof_mtl_ops.get_stream_position = mtl_dsp_get_stream_hda_link_position;
711-
712698
sdev->private = kzalloc(sizeof(struct sof_ipc4_fw_data), GFP_KERNEL);
713699
if (!sdev->private)
714700
return -ENOMEM;

sound/soc/sof/intel/mtl.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
* Copyright(c) 2020-2022 Intel Corporation. All rights reserved.
77
*/
88

9-
/* HDA Registers */
10-
#define MTL_PPLCLLPL_BASE 0x948
11-
#define MTL_PPLCLLPU_STRIDE 0x10
12-
#define MTL_PPLCLLPL(x) (MTL_PPLCLLPL_BASE + (x) * MTL_PPLCLLPU_STRIDE)
13-
#define MTL_PPLCLLPU(x) (MTL_PPLCLLPL_BASE + 0x4 + (x) * MTL_PPLCLLPU_STRIDE)
14-
159
/* DSP Registers */
1610
#define MTL_HFDSSCS 0x1000
1711
#define MTL_HFDSSCS_SPA_MASK BIT(16)
@@ -103,9 +97,5 @@ int mtl_dsp_ipc_get_window_offset(struct snd_sof_dev *sdev, u32 id);
10397

10498
void mtl_ipc_dump(struct snd_sof_dev *sdev);
10599

106-
u64 mtl_dsp_get_stream_hda_link_position(struct snd_sof_dev *sdev,
107-
struct snd_soc_component *component,
108-
struct snd_pcm_substream *substream);
109-
110100
int mtl_dsp_core_get(struct snd_sof_dev *sdev, int core);
111101
int mtl_dsp_core_put(struct snd_sof_dev *sdev, int core);

0 commit comments

Comments
 (0)