Linux 6.14-rc1
[linux.git] / include / sound / hda-mlink.h
blob6774f4b9e5fc18248b96071a698b9d9d8d340b90
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.
6 * Copyright(c) 2022-2023 Intel Corporation
7 */
9 struct hdac_bus;
10 struct hdac_ext_link;
12 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_MLINK)
14 int hda_bus_ml_init(struct hdac_bus *bus);
15 void hda_bus_ml_free(struct hdac_bus *bus);
17 int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid);
18 void hdac_bus_eml_enable_interrupt_unlocked(struct hdac_bus *bus, bool alt, int elid, bool enable);
19 void hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable);
20 bool hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid);
22 int hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd);
23 int hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd);
25 int hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid);
26 int hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus);
28 void hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
29 void hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink);
31 int hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid);
32 int hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus);
34 bool hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid);
35 bool hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus);
37 int hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink);
38 int hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
40 int hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink);
41 int hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
43 int hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink);
44 int hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink);
46 int hdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid);
47 int hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num);
49 int hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,
50 int channel_mask, int stream_id, int dir);
52 void hda_bus_ml_put_all(struct hdac_bus *bus);
53 void hda_bus_ml_reset_losidv(struct hdac_bus *bus);
54 int hda_bus_ml_resume(struct hdac_bus *bus);
55 int hda_bus_ml_suspend(struct hdac_bus *bus);
57 struct hdac_ext_link *hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus);
58 struct hdac_ext_link *hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus);
59 struct hdac_ext_link *hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus);
61 struct mutex *hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid);
63 int hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable);
65 #else
67 static inline int
68 hda_bus_ml_init(struct hdac_bus *bus) { return 0; }
70 static inline void hda_bus_ml_free(struct hdac_bus *bus) { }
72 static inline int
73 hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; }
75 static inline void
76 hdac_bus_eml_enable_interrupt_unlocked(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
78 static inline void
79 hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
81 static inline bool
82 hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid) { return false; }
84 static inline int
85 hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd)
87 return 0;
90 static inline int
91 hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd)
93 return 0;
96 static inline int
97 hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid)
99 return 0;
102 static inline int
103 hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus) { return 0; }
105 static inline void
106 hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink) { }
108 static inline void
109 hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink) { }
111 static inline int
112 hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid) { return 0; }
114 static inline int
115 hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus) { return 0; }
117 static inline bool
118 hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid) { return false; }
120 static inline bool
121 hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus) { return false; }
123 static inline int
124 hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink)
126 return 0;
129 static inline int
130 hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
132 return 0;
135 static inline int
136 hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink)
138 return 0;
141 static inline int
142 hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
144 return 0;
147 static inline int
148 hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
150 static inline int
151 hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
153 static inline int
154 hdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid) { return 0; }
156 static inline int
157 hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num) { return 0; }
159 static inline int
160 hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,
161 int channel_mask, int stream_id, int dir)
163 return 0;
166 static inline void hda_bus_ml_put_all(struct hdac_bus *bus) { }
167 static inline void hda_bus_ml_reset_losidv(struct hdac_bus *bus) { }
168 static inline int hda_bus_ml_resume(struct hdac_bus *bus) { return 0; }
169 static inline int hda_bus_ml_suspend(struct hdac_bus *bus) { return 0; }
171 static inline struct hdac_ext_link *
172 hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus) { return NULL; }
174 static inline struct hdac_ext_link *
175 hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus) { return NULL; }
177 static inline struct hdac_ext_link *
178 hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus) { return NULL; }
180 static inline struct mutex *
181 hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid) { return NULL; }
183 static inline int
184 hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable)
186 return 0;
188 #endif /* CONFIG_SND_SOC_SOF_HDA_MLINK */