Skip to content

Commit 782add0

Browse files
committed
ASoC: SOF: Intel: hda: Add sof_tgl_ops for TGL platforms
Separate the dsp ops for TGL ops to specify the use of ICCMAX FW boot sequence in the run op. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent e102586 commit 782add0

3 files changed

Lines changed: 102 additions & 1 deletion

File tree

sound/soc/sof/intel/cnl.c

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,106 @@ const struct snd_sof_dsp_ops sof_cnl_ops = {
331331
};
332332
EXPORT_SYMBOL_NS(sof_cnl_ops, SND_SOC_SOF_INTEL_HDA_COMMON);
333333

334+
/* Tigerlake ops */
335+
const struct snd_sof_dsp_ops sof_tgl_ops = {
336+
/* probe and remove */
337+
.probe = hda_dsp_probe,
338+
.remove = hda_dsp_remove,
339+
340+
/* Register IO */
341+
.write = sof_io_write,
342+
.read = sof_io_read,
343+
.write64 = sof_io_write64,
344+
.read64 = sof_io_read64,
345+
346+
/* Block IO */
347+
.block_read = sof_block_read,
348+
.block_write = sof_block_write,
349+
350+
/* doorbell */
351+
.irq_thread = cnl_ipc_irq_thread,
352+
353+
/* ipc */
354+
.send_msg = cnl_ipc_send_msg,
355+
.fw_ready = sof_fw_ready,
356+
.get_mailbox_offset = hda_dsp_ipc_get_mailbox_offset,
357+
.get_window_offset = hda_dsp_ipc_get_window_offset,
358+
359+
.ipc_msg_data = hda_ipc_msg_data,
360+
.ipc_pcm_params = hda_ipc_pcm_params,
361+
362+
/* machine driver */
363+
.machine_select = hda_machine_select,
364+
.machine_register = sof_machine_register,
365+
.machine_unregister = sof_machine_unregister,
366+
.set_mach_params = hda_set_mach_params,
367+
368+
/* debug */
369+
.debug_map = cnl_dsp_debugfs,
370+
.debug_map_count = ARRAY_SIZE(cnl_dsp_debugfs),
371+
.dbg_dump = hda_dsp_dump,
372+
.ipc_dump = cnl_ipc_dump,
373+
374+
/* stream callbacks */
375+
.pcm_open = hda_dsp_pcm_open,
376+
.pcm_close = hda_dsp_pcm_close,
377+
.pcm_hw_params = hda_dsp_pcm_hw_params,
378+
.pcm_hw_free = hda_dsp_stream_hw_free,
379+
.pcm_trigger = hda_dsp_pcm_trigger,
380+
.pcm_pointer = hda_dsp_pcm_pointer,
381+
382+
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_PROBES)
383+
/* probe callbacks */
384+
.probe_assign = hda_probe_compr_assign,
385+
.probe_free = hda_probe_compr_free,
386+
.probe_set_params = hda_probe_compr_set_params,
387+
.probe_trigger = hda_probe_compr_trigger,
388+
.probe_pointer = hda_probe_compr_pointer,
389+
#endif
390+
391+
/* firmware loading */
392+
.load_firmware = snd_sof_load_firmware_raw,
393+
394+
/* pre/post fw run */
395+
.pre_fw_run = hda_dsp_pre_fw_run,
396+
.post_fw_run = hda_dsp_post_fw_run,
397+
398+
/* dsp core power up/down */
399+
.core_power_up = hda_dsp_enable_core,
400+
.core_power_down = hda_dsp_core_reset_power_down,
401+
402+
/* firmware run */
403+
.run = hda_dsp_cl_boot_firmware_iccmax,
404+
405+
/* trace callback */
406+
.trace_init = hda_dsp_trace_init,
407+
.trace_release = hda_dsp_trace_release,
408+
.trace_trigger = hda_dsp_trace_trigger,
409+
410+
/* DAI drivers */
411+
.drv = skl_dai,
412+
.num_drv = SOF_SKL_NUM_DAIS,
413+
414+
/* PM */
415+
.suspend = hda_dsp_suspend,
416+
.resume = hda_dsp_resume,
417+
.runtime_suspend = hda_dsp_runtime_suspend,
418+
.runtime_resume = hda_dsp_runtime_resume,
419+
.runtime_idle = hda_dsp_runtime_idle,
420+
.set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume,
421+
.set_power_state = hda_dsp_set_power_state,
422+
423+
/* ALSA HW info flags */
424+
.hw_info = SNDRV_PCM_INFO_MMAP |
425+
SNDRV_PCM_INFO_MMAP_VALID |
426+
SNDRV_PCM_INFO_INTERLEAVED |
427+
SNDRV_PCM_INFO_PAUSE |
428+
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
429+
430+
.arch_ops = &sof_xtensa_arch_ops,
431+
};
432+
EXPORT_SYMBOL_NS(sof_tgl_ops, SND_SOC_SOF_INTEL_HDA_COMMON);
433+
334434
const struct sof_intel_dsp_desc cnl_chip_info = {
335435
/* Cannonlake */
336436
.cores_num = 4,

sound/soc/sof/intel/hda.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ extern struct snd_soc_dai_driver skl_dai[];
734734
*/
735735
extern const struct snd_sof_dsp_ops sof_apl_ops;
736736
extern const struct snd_sof_dsp_ops sof_cnl_ops;
737+
extern const struct snd_sof_dsp_ops sof_tgl_ops;
737738

738739
extern const struct sof_intel_dsp_desc apl_chip_info;
739740
extern const struct sof_intel_dsp_desc cnl_chip_info;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static const struct sof_dev_desc tgl_desc = {
201201
.default_tplg_path = "intel/sof-tplg",
202202
.default_fw_filename = "sof-tgl.ri",
203203
.nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
204-
.ops = &sof_cnl_ops,
204+
.ops = &sof_tgl_ops,
205205
};
206206
#endif
207207

0 commit comments

Comments
 (0)