blob: 9ced94686ce3f8936938fe94822947cbf8fc1401 [file] [log] [blame]
Pierre-Louis Bossart18227582023-04-04 13:41:14 +03001/* 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 *
Pierre-Louis Bossartea89a742024-05-03 09:03:59 -05006 * Copyright(c) 2022-2023 Intel Corporation
Pierre-Louis Bossart18227582023-04-04 13:41:14 +03007 */
8
9struct hdac_bus;
Pierre-Louis Bossart2b864e92023-04-04 13:41:25 +030010struct hdac_ext_link;
Pierre-Louis Bossart18227582023-04-04 13:41:14 +030011
12#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_MLINK)
13
Pierre-Louis Bossart17c9b6e2023-04-04 13:41:15 +030014int hda_bus_ml_init(struct hdac_bus *bus);
Pierre-Louis Bossart18227582023-04-04 13:41:14 +030015void hda_bus_ml_free(struct hdac_bus *bus);
Pierre-Louis Bossartfc7dab82023-04-04 13:41:17 +030016
Pierre-Louis Bossart6857c7e2023-04-04 13:41:19 +030017int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid);
Pierre-Louis Bossart2e428832023-04-04 13:41:20 +030018void 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);
Pierre-Louis Bossart6857c7e2023-04-04 13:41:19 +030020
Pierre-Louis Bossart02ba1b02023-04-04 13:41:21 +030021int 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
Pierre-Louis Bossart1f5a6e82023-04-04 13:41:22 +030027void 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
Pierre-Louis Bossartd56d20582023-04-04 13:41:23 +030033bool 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
Pierre-Louis Bossartfc7dab82023-04-04 13:41:17 +030036int 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
Pierre-Louis Bossart725218f2023-04-04 13:41:18 +030042int 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
Pierre-Louis Bossart34e38f02023-08-07 16:09:56 -050045int hdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid);
Pierre-Louis Bossart87a6ddc2023-04-04 13:41:24 +030046int hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num);
47
Pierre-Louis Bossartccc2f0c2023-05-12 12:46:11 -050048int hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,
49 int channel_mask, int stream_id, int dir);
50
Pierre-Louis Bossart18227582023-04-04 13:41:14 +030051void hda_bus_ml_put_all(struct hdac_bus *bus);
52void hda_bus_ml_reset_losidv(struct hdac_bus *bus);
53int hda_bus_ml_resume(struct hdac_bus *bus);
54int hda_bus_ml_suspend(struct hdac_bus *bus);
55
Pierre-Louis Bossart2b864e92023-04-04 13:41:25 +030056struct hdac_ext_link *hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus);
57struct hdac_ext_link *hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus);
Pierre-Louis Bossartdcb88fc2023-05-12 12:46:07 -050058struct hdac_ext_link *hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus);
Pierre-Louis Bossart2b864e92023-04-04 13:41:25 +030059
Pierre-Louis Bossart681f27f2023-04-04 13:41:27 +030060struct mutex *hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid);
61
Pierre-Louis Bossart82958c42023-04-04 13:41:26 +030062int hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable);
63
Pierre-Louis Bossart18227582023-04-04 13:41:14 +030064#else
65
66static inline int
Pierre-Louis Bossart17c9b6e2023-04-04 13:41:15 +030067hda_bus_ml_init(struct hdac_bus *bus) { return 0; }
Pierre-Louis Bossart18227582023-04-04 13:41:14 +030068
69static inline void hda_bus_ml_free(struct hdac_bus *bus) { }
Pierre-Louis Bossartfc7dab82023-04-04 13:41:17 +030070
71static inline int
Pierre-Louis Bossart6857c7e2023-04-04 13:41:19 +030072hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; }
73
Pierre-Louis Bossart2e428832023-04-04 13:41:20 +030074static inline void
75hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
76
77static inline bool
78hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid) { return false; }
79
Pierre-Louis Bossart6857c7e2023-04-04 13:41:19 +030080static inline int
Pierre-Louis Bossart02ba1b02023-04-04 13:41:21 +030081hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd)
82{
83 return 0;
84}
85
86static inline int
87hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd)
88{
89 return 0;
90}
91
92static inline int
93hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid)
94{
95 return 0;
96}
97
98static inline int
99hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus) { return 0; }
100
Pierre-Louis Bossart1f5a6e82023-04-04 13:41:22 +0300101static inline void
102hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink) { }
103
104static inline void
105hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink) { }
106
107static inline int
108hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid) { return 0; }
109
110static inline int
111hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus) { return 0; }
112
Pierre-Louis Bossartd56d20582023-04-04 13:41:23 +0300113static inline bool
114hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid) { return false; }
115
116static inline bool
117hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus) { return false; }
118
Pierre-Louis Bossart02ba1b02023-04-04 13:41:21 +0300119static inline int
Pierre-Louis Bossartfc7dab82023-04-04 13:41:17 +0300120hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink)
121{
122 return 0;
123}
124
125static inline int
126hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
127{
128 return 0;
129}
130
131static inline int
132hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink)
133{
134 return 0;
135}
136
137static inline int
138hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
139{
140 return 0;
141}
142
Pierre-Louis Bossart725218f2023-04-04 13:41:18 +0300143static inline int
144hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
145
146static inline int
147hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
148
Pierre-Louis Bossart87a6ddc2023-04-04 13:41:24 +0300149static inline int
Pierre-Louis Bossart34e38f02023-08-07 16:09:56 -0500150hdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid) { return 0; }
151
152static inline int
Pierre-Louis Bossart87a6ddc2023-04-04 13:41:24 +0300153hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num) { return 0; }
154
Pierre-Louis Bossartccc2f0c2023-05-12 12:46:11 -0500155static inline int
156hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,
157 int channel_mask, int stream_id, int dir)
158{
159 return 0;
160}
161
Pierre-Louis Bossart18227582023-04-04 13:41:14 +0300162static inline void hda_bus_ml_put_all(struct hdac_bus *bus) { }
163static inline void hda_bus_ml_reset_losidv(struct hdac_bus *bus) { }
164static inline int hda_bus_ml_resume(struct hdac_bus *bus) { return 0; }
165static inline int hda_bus_ml_suspend(struct hdac_bus *bus) { return 0; }
166
Pierre-Louis Bossart2b864e92023-04-04 13:41:25 +0300167static inline struct hdac_ext_link *
168hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus) { return NULL; }
169
170static inline struct hdac_ext_link *
171hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus) { return NULL; }
172
Pierre-Louis Bossartdcb88fc2023-05-12 12:46:07 -0500173static inline struct hdac_ext_link *
174hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus) { return NULL; }
175
Pierre-Louis Bossart681f27f2023-04-04 13:41:27 +0300176static inline struct mutex *
177hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid) { return NULL; }
178
Pierre-Louis Bossart82958c42023-04-04 13:41:26 +0300179static inline int
180hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable)
181{
182 return 0;
183}
Pierre-Louis Bossartb85a3dc2024-02-13 13:43:54 +0200184#endif /* CONFIG_SND_SOC_SOF_HDA_MLINK */