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 7 */ 8 9struct hdac_bus; 10struct hdac_ext_link; 11 12#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_MLINK) 13 14int hda_bus_ml_init(struct hdac_bus *bus); 15void hda_bus_ml_free(struct hdac_bus *bus); 16 17int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid); 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); 20 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 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 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 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 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 45int hdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid); 46int hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num); 47 48int 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 51void 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 56struct 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); 58struct hdac_ext_link *hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus); 59 60struct mutex *hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid); 61 62int hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable); 63 64#else 65 66static inline int 67hda_bus_ml_init(struct hdac_bus *bus) { return 0; } 68 69static inline void hda_bus_ml_free(struct hdac_bus *bus) { } 70 71static inline int 72hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; } 73 74static 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 80static inline int 81hdac_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 101static 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 113static 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 119static inline int 120hdac_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 143static 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 149static inline int 150hdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid) { return 0; } 151 152static inline int 153hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num) { return 0; } 154 155static 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 162static 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 167static 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 173static inline struct hdac_ext_link * 174hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus) { return NULL; } 175 176static inline struct mutex * 177hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid) { return NULL; } 178 179static inline int 180hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable) 181{ 182 return 0; 183} 184#endif /* CONFIG_SND_SOC_SOF_HDA_MLINK */ 185