xref: /linux/sound/soc/sof/intel/hda-common-ops.c (revision 576d7fed09c7edbae7600f29a8a3ed6c1ead904f)
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
2 //
3 // This file is provided under a dual BSD/GPLv2 license.  When using or
4 // redistributing this file, you may do so under either license.
5 //
6 // Copyright(c) 2022 Intel Corporation. All rights reserved.
7 //
8 
9 /*
10  * common ops for SKL+ HDAudio platforms
11  */
12 
13 #include "../sof-priv.h"
14 #include "hda.h"
15 #include "../sof-audio.h"
16 
17 struct snd_sof_dsp_ops sof_hda_common_ops = {
18 	/* probe/remove/shutdown */
19 	.probe_early	= hda_dsp_probe_early,
20 	.probe		= hda_dsp_probe,
21 	.remove		= hda_dsp_remove,
22 	.remove_late	= hda_dsp_remove_late,
23 
24 	/* Register IO uses direct mmio */
25 
26 	/* Block IO */
27 	.block_read	= sof_block_read,
28 	.block_write	= sof_block_write,
29 
30 	/* Mailbox IO */
31 	.mailbox_read	= sof_mailbox_read,
32 	.mailbox_write	= sof_mailbox_write,
33 
34 	/* ipc */
35 	.get_mailbox_offset = hda_dsp_ipc_get_mailbox_offset,
36 	.get_window_offset = hda_dsp_ipc_get_window_offset,
37 
38 	.ipc_msg_data	= hda_ipc_msg_data,
39 	.set_stream_data_offset = hda_set_stream_data_offset,
40 
41 	/* machine driver */
42 	.machine_select = hda_machine_select,
43 	.machine_register = sof_machine_register,
44 	.machine_unregister = sof_machine_unregister,
45 	.set_mach_params = hda_set_mach_params,
46 
47 	/* debug */
48 	.dbg_dump	= hda_dsp_dump,
49 	.debugfs_add_region_item = snd_sof_debugfs_add_region_item_iomem,
50 
51 	/* stream callbacks */
52 	.pcm_open	= hda_dsp_pcm_open,
53 	.pcm_close	= hda_dsp_pcm_close,
54 	.pcm_hw_params	= hda_dsp_pcm_hw_params,
55 	.pcm_hw_free	= hda_dsp_stream_hw_free,
56 	.pcm_trigger	= hda_dsp_pcm_trigger,
57 	.pcm_pointer	= hda_dsp_pcm_pointer,
58 	.pcm_ack	= hda_dsp_pcm_ack,
59 
60 	/* firmware loading */
61 	.load_firmware = snd_sof_load_firmware_raw,
62 
63 	/* pre/post fw run */
64 	.pre_fw_run = hda_dsp_pre_fw_run,
65 
66 	/* firmware run */
67 	.run = hda_dsp_cl_boot_firmware,
68 
69 	/* parse platform specific extended manifest */
70 	.parse_platform_ext_manifest = hda_dsp_ext_man_get_cavs_config_data,
71 
72 	/* dsp core get/put */
73 
74 	/* trace callback */
75 	.trace_init = hda_dsp_trace_init,
76 	.trace_release = hda_dsp_trace_release,
77 	.trace_trigger = hda_dsp_trace_trigger,
78 
79 	/* client ops */
80 	.register_ipc_clients = hda_register_clients,
81 	.unregister_ipc_clients = hda_unregister_clients,
82 
83 	/* DAI drivers */
84 	.drv		= skl_dai,
85 	.num_drv	= SOF_SKL_NUM_DAIS,
86 
87 	/* PM */
88 	.suspend		= hda_dsp_suspend,
89 	.resume			= hda_dsp_resume,
90 	.runtime_suspend	= hda_dsp_runtime_suspend,
91 	.runtime_resume		= hda_dsp_runtime_resume,
92 	.runtime_idle		= hda_dsp_runtime_idle,
93 	.set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume,
94 
95 	/* ALSA HW info flags */
96 	.hw_info =	SNDRV_PCM_INFO_MMAP |
97 			SNDRV_PCM_INFO_MMAP_VALID |
98 			SNDRV_PCM_INFO_INTERLEAVED |
99 			SNDRV_PCM_INFO_PAUSE |
100 			SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
101 
102 	.dsp_arch_ops = &sof_xtensa_arch_ops,
103 };
104