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

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

‎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+
staticinthdac_bus_offload_dmic_ssp(structhdac_bus*bus)
34+
{
35+
intret;
36+
37+
ret=hdac_bus_eml_enable_offload(bus, true, AZX_REG_ML_LEPTR_ID_INTEL_SSP, true);
38+
if (ret<0)
39+
returnret;
40+
41+
ret=hdac_bus_eml_enable_offload(bus, true, AZX_REG_ML_LEPTR_ID_INTEL_DMIC, true);
42+
if (ret<0)
43+
returnret;
44+
45+
return0;
46+
}
47+
48+
staticintlnl_hda_dsp_probe(structsnd_sof_dev*sdev)
49+
{
50+
intret;
51+
52+
ret=hda_dsp_probe(sdev);
53+
if (ret<0)
54+
returnret;
55+
56+
returnhdac_bus_offload_dmic_ssp(sof_to_bus(sdev));
57+
}
58+
59+
staticintlnl_hda_dsp_resume(structsnd_sof_dev*sdev)
60+
{
61+
intret;
62+
63+
ret=hda_dsp_resume(sdev);
64+
if (ret<0)
65+
returnret;
66+
67+
returnhdac_bus_offload_dmic_ssp(sof_to_bus(sdev));
68+
}
69+
70+
staticintlnl_hda_dsp_runtime_resume(structsnd_sof_dev*sdev)
71+
{
72+
intret;
73+
74+
ret=hda_dsp_runtime_resume(sdev);
75+
if (ret<0)
76+
returnret;
77+
78+
returnhdac_bus_offload_dmic_ssp(sof_to_bus(sdev));
79+
}
80+
3281
intsof_lnl_ops_init(structsnd_sof_dev*sdev)
3382
{
3483
structsof_ipc4_fw_data*ipc4_data;
3584

3685
/* common defaults */
3786
memcpy(&sof_lnl_ops, &sof_hda_common_ops, sizeof(structsnd_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(structsof_ipc4_fw_data), GFP_KERNEL);

0 commit comments

Comments
 (0)