Skip to content

Commit cea8235

Browse files
committed
ASoC: SOF: Intel: LNL: enable DMIC/SSP offload in probe/resume
In the LunarLake hardware, the default IP ownership changed to the host driver, instead of the firmware in previous generation. In the absence of any capability negotiation, we need to assume a fixed partitioning between host driver and firmware. The OFLEN bit needs to be set as early as possible for resources handled by the firmware, since we can't control when the firmware might try to access the resources. For now DMIC and SSP are handled by the DSP firmware. SoundWire is a separate case, the OFLEN bit can be set when starting-up and resuming the aux device for each link. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent 6ff3a84 commit cea8235

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

sound/soc/sof/intel/lnl.c

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,65 @@ static const struct snd_sof_debugfs_map lnl_dsp_debugfs[] = {
2929
{"dsp", HDA_DSP_BAR, 0, 0x10000, SOF_DEBUGFS_ACCESS_ALWAYS},
3030
};
3131

32+
/* this helps allows the DSP to setup DMIC/SSP */
33+
static int hdac_bus_offload_dmic_ssp(struct hdac_bus *bus)
34+
{
35+
int ret;
36+
37+
ret = hdac_bus_eml_enable_offload(bus, true, AZX_REG_ML_LEPTR_ID_INTEL_SSP, true);
38+
if (ret < 0)
39+
return ret;
40+
41+
ret = hdac_bus_eml_enable_offload(bus, true, AZX_REG_ML_LEPTR_ID_INTEL_DMIC, true);
42+
if (ret < 0)
43+
return ret;
44+
45+
return 0;
46+
}
47+
48+
static int lnl_hda_dsp_probe(struct snd_sof_dev *sdev)
49+
{
50+
int ret;
51+
52+
ret = hda_dsp_probe(sdev);
53+
if (ret < 0)
54+
return ret;
55+
56+
return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev));
57+
}
58+
59+
static int lnl_hda_dsp_resume(struct snd_sof_dev *sdev)
60+
{
61+
int ret;
62+
63+
ret = hda_dsp_resume(sdev);
64+
if (ret < 0)
65+
return ret;
66+
67+
return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev));
68+
}
69+
70+
static int lnl_hda_dsp_runtime_resume(struct snd_sof_dev *sdev)
71+
{
72+
int ret;
73+
74+
ret = hda_dsp_runtime_resume(sdev);
75+
if (ret < 0)
76+
return ret;
77+
78+
return hdac_bus_offload_dmic_ssp(sof_to_bus(sdev));
79+
}
80+
3281
int sof_lnl_ops_init(struct snd_sof_dev *sdev)
3382
{
3483
struct sof_ipc4_fw_data *ipc4_data;
3584

3685
/* common defaults */
3786
memcpy(&sof_lnl_ops, &sof_hda_common_ops, sizeof(struct snd_sof_dsp_ops));
3887

88+
/* probe */
89+
sof_lnl_ops.probe = lnl_hda_dsp_probe;
90+
3991
/* shutdown */
4092
sof_lnl_ops.shutdown = hda_dsp_shutdown;
4193

@@ -63,6 +115,10 @@ int sof_lnl_ops_init(struct snd_sof_dev *sdev)
63115
/* dsp core get/put */
64116
/* TODO: add core_get and core_put */
65117

118+
/* PM */
119+
sof_lnl_ops.resume = lnl_hda_dsp_resume;
120+
sof_lnl_ops.runtime_resume = lnl_hda_dsp_runtime_resume;
121+
66122
sof_lnl_ops.get_stream_position = mtl_dsp_get_stream_hda_link_position;
67123

68124
sdev->private = devm_kzalloc(sdev->dev, sizeof(struct sof_ipc4_fw_data), GFP_KERNEL);

0 commit comments

Comments
 (0)