Merge tag 'kvm-s390-next-6.4-2' of https://git.kernel.org/pub/scm/linux/kernel/git...
[linux-block.git] / include / sound / hda-mlink.h
CommitLineData
18227585
PLB
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-2023 Intel Corporation. All rights reserved.
7 */
8
9struct hdac_bus;
2b864e96 10struct hdac_ext_link;
18227585
PLB
11
12#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_MLINK)
13
17c9b6ec 14int hda_bus_ml_init(struct hdac_bus *bus);
18227585 15void hda_bus_ml_free(struct hdac_bus *bus);
fc7dab8e 16
6857c7ee 17int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid);
2e428831
PLB
18void hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable);
19bool hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid);
6857c7ee 20
02ba1b02
PLB
21int hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd);
22int hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd);
23
24int hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid);
25int hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus);
26
1f5a6e8b
PLB
27void hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
28void hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink);
29
30int hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid);
31int hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus);
32
d56d2058
PLB
33bool hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid);
34bool hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus);
35
fc7dab8e
PLB
36int hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink);
37int hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
38
39int hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink);
40int hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
41
725218f1
PLB
42int hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink);
43int hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink);
44
87a6ddc0
PLB
45int hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num);
46
18227585
PLB
47void hda_bus_ml_put_all(struct hdac_bus *bus);
48void hda_bus_ml_reset_losidv(struct hdac_bus *bus);
49int hda_bus_ml_resume(struct hdac_bus *bus);
50int hda_bus_ml_suspend(struct hdac_bus *bus);
51
2b864e96
PLB
52struct hdac_ext_link *hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus);
53struct hdac_ext_link *hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus);
54
681f27f3
PLB
55struct mutex *hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid);
56
82958c40
PLB
57int hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable);
58
18227585
PLB
59#else
60
61static inline int
17c9b6ec 62hda_bus_ml_init(struct hdac_bus *bus) { return 0; }
18227585
PLB
63
64static inline void hda_bus_ml_free(struct hdac_bus *bus) { }
fc7dab8e 65
6857c7ee
PLB
66static inline int
67hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; }
68
2e428831
PLB
69static inline void
70hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
71
72static inline bool
73hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid) { return false; }
74
02ba1b02
PLB
75static inline int
76hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd)
77{
78 return 0;
79}
80
81static inline int
82hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd)
83{
84 return 0;
85}
86
87static inline int
88hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid)
89{
90 return 0;
91}
92
93static inline int
94hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus) { return 0; }
1f5a6e8b
PLB
95
96static inline void
97hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink) { }
98
99static inline void
100hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink) { }
101
102static inline int
103hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid) { return 0; }
104
105static inline int
106hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus) { return 0; }
02ba1b02 107
d56d2058
PLB
108static inline bool
109hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid) { return false; }
110
111static inline bool
112hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus) { return false; }
113
fc7dab8e
PLB
114static inline int
115hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink)
116{
117 return 0;
118}
119
120static inline int
121hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
122{
123 return 0;
124}
125
126static inline int
127hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink)
128{
129 return 0;
130}
131
132static inline int
133hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
134{
135 return 0;
136}
137
725218f1
PLB
138static inline int
139hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
140
141static inline int
142hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
143
87a6ddc0
PLB
144static inline int
145hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num) { return 0; }
146
18227585
PLB
147static inline void hda_bus_ml_put_all(struct hdac_bus *bus) { }
148static inline void hda_bus_ml_reset_losidv(struct hdac_bus *bus) { }
149static inline int hda_bus_ml_resume(struct hdac_bus *bus) { return 0; }
150static inline int hda_bus_ml_suspend(struct hdac_bus *bus) { return 0; }
151
2b864e96
PLB
152static inline struct hdac_ext_link *
153hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus) { return NULL; }
154
155static inline struct hdac_ext_link *
156hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus) { return NULL; }
157
681f27f3
PLB
158static inline struct mutex *
159hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid) { return NULL; }
160
82958c40
PLB
161static inline int
162hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable)
163{
164 return 0;
165}
18227585 166#endif /* CONFIG_SND_SOC_SOF_HDA */