1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
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. All rights reserved.
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(struct hdac_bus *bus, bool alt, int elid, bool enable);
19 bool hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid);
21 int hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd);
22 int hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd);
24 int hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid);
25 int hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus);
27 void hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
28 void hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink);
30 int hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid);
31 int hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus);
33 bool hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid);
34 bool hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus);
36 int hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink);
37 int hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
39 int hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink);
40 int hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
42 int hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink);
43 int hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink);
45 int hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num);
47 void hda_bus_ml_put_all(struct hdac_bus *bus);
48 void hda_bus_ml_reset_losidv(struct hdac_bus *bus);
49 int hda_bus_ml_resume(struct hdac_bus *bus);
50 int hda_bus_ml_suspend(struct hdac_bus *bus);
52 struct hdac_ext_link *hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus);
53 struct hdac_ext_link *hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus);
55 struct mutex *hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid);
57 int hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable);
62 hda_bus_ml_init(struct hdac_bus *bus) { return 0; }
64 static inline void hda_bus_ml_free(struct hdac_bus *bus) { }
67 hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; }
70 hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
73 hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid) { return false; }
76 hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd)
82 hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd)
88 hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid)
94 hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus) { return 0; }
97 hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink) { }
100 hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink) { }
103 hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid) { return 0; }
106 hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus) { return 0; }
109 hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid) { return false; }
112 hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus) { return false; }
115 hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink)
121 hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
127 hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink)
133 hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
139 hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
142 hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
145 hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num) { return 0; }
147 static inline void hda_bus_ml_put_all(struct hdac_bus *bus) { }
148 static inline void hda_bus_ml_reset_losidv(struct hdac_bus *bus) { }
149 static inline int hda_bus_ml_resume(struct hdac_bus *bus) { return 0; }
150 static inline int hda_bus_ml_suspend(struct hdac_bus *bus) { return 0; }
152 static inline struct hdac_ext_link *
153 hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus) { return NULL; }
155 static inline struct hdac_ext_link *
156 hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus) { return NULL; }
158 static inline struct mutex *
159 hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid) { return NULL; }
162 hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable)
166 #endif /* CONFIG_SND_SOC_SOF_HDA */