162306a36Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * This file is provided under a dual BSD/GPLv2 license.  When using or
462306a36Sopenharmony_ci * redistributing this file, you may do so under either license.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright(c) 2022-2023 Intel Corporation. All rights reserved.
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_cistruct hdac_bus;
1062306a36Sopenharmony_cistruct hdac_ext_link;
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_MLINK)
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ciint hda_bus_ml_init(struct hdac_bus *bus);
1562306a36Sopenharmony_civoid hda_bus_ml_free(struct hdac_bus *bus);
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ciint hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid);
1862306a36Sopenharmony_civoid hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable);
1962306a36Sopenharmony_cibool hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid);
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ciint hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd);
2262306a36Sopenharmony_ciint hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd);
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciint hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid);
2562306a36Sopenharmony_ciint hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus);
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_civoid hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
2862306a36Sopenharmony_civoid hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink);
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ciint hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid);
3162306a36Sopenharmony_ciint hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus);
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_cibool hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid);
3462306a36Sopenharmony_cibool hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus);
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ciint hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink);
3762306a36Sopenharmony_ciint hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ciint hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink);
4062306a36Sopenharmony_ciint hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciint hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink);
4362306a36Sopenharmony_ciint hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink);
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ciint hdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid);
4662306a36Sopenharmony_ciint hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num);
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ciint hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,
4962306a36Sopenharmony_ci				   int channel_mask, int stream_id, int dir);
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_civoid hda_bus_ml_put_all(struct hdac_bus *bus);
5262306a36Sopenharmony_civoid hda_bus_ml_reset_losidv(struct hdac_bus *bus);
5362306a36Sopenharmony_ciint hda_bus_ml_resume(struct hdac_bus *bus);
5462306a36Sopenharmony_ciint hda_bus_ml_suspend(struct hdac_bus *bus);
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_cistruct hdac_ext_link *hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus);
5762306a36Sopenharmony_cistruct hdac_ext_link *hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus);
5862306a36Sopenharmony_cistruct hdac_ext_link *hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus);
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_cistruct mutex *hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid);
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ciint hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable);
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci#else
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_cistatic inline int
6762306a36Sopenharmony_cihda_bus_ml_init(struct hdac_bus *bus) { return 0; }
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_cistatic inline void hda_bus_ml_free(struct hdac_bus *bus) { }
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_cistatic inline int
7262306a36Sopenharmony_cihdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; }
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_cistatic inline void
7562306a36Sopenharmony_cihdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_cistatic inline bool
7862306a36Sopenharmony_cihdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid) { return false; }
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_cistatic inline int
8162306a36Sopenharmony_cihdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd)
8262306a36Sopenharmony_ci{
8362306a36Sopenharmony_ci	return 0;
8462306a36Sopenharmony_ci}
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_cistatic inline int
8762306a36Sopenharmony_cihdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd)
8862306a36Sopenharmony_ci{
8962306a36Sopenharmony_ci	return 0;
9062306a36Sopenharmony_ci}
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_cistatic inline int
9362306a36Sopenharmony_cihdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid)
9462306a36Sopenharmony_ci{
9562306a36Sopenharmony_ci	return 0;
9662306a36Sopenharmony_ci}
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_cistatic inline int
9962306a36Sopenharmony_cihdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus) { return 0; }
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_cistatic inline void
10262306a36Sopenharmony_cihdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink) { }
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_cistatic inline void
10562306a36Sopenharmony_cihdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink) { }
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_cistatic inline int
10862306a36Sopenharmony_cihdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid) { return 0; }
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_cistatic inline int
11162306a36Sopenharmony_cihdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus) { return 0; }
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_cistatic inline bool
11462306a36Sopenharmony_cihdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid) { return false; }
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_cistatic inline bool
11762306a36Sopenharmony_cihdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus) { return false; }
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_cistatic inline int
12062306a36Sopenharmony_cihdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink)
12162306a36Sopenharmony_ci{
12262306a36Sopenharmony_ci	return 0;
12362306a36Sopenharmony_ci}
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_cistatic inline int
12662306a36Sopenharmony_cihdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
12762306a36Sopenharmony_ci{
12862306a36Sopenharmony_ci	return 0;
12962306a36Sopenharmony_ci}
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_cistatic inline int
13262306a36Sopenharmony_cihdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink)
13362306a36Sopenharmony_ci{
13462306a36Sopenharmony_ci	return 0;
13562306a36Sopenharmony_ci}
13662306a36Sopenharmony_ci
13762306a36Sopenharmony_cistatic inline int
13862306a36Sopenharmony_cihdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
13962306a36Sopenharmony_ci{
14062306a36Sopenharmony_ci	return 0;
14162306a36Sopenharmony_ci}
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_cistatic inline int
14462306a36Sopenharmony_cihdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_cistatic inline int
14762306a36Sopenharmony_cihdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
14862306a36Sopenharmony_ci
14962306a36Sopenharmony_cistatic inline int
15062306a36Sopenharmony_cihdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid) { return 0; }
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_cistatic inline int
15362306a36Sopenharmony_cihdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num) { return 0; }
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_cistatic inline int
15662306a36Sopenharmony_cihdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,
15762306a36Sopenharmony_ci			       int channel_mask, int stream_id, int dir)
15862306a36Sopenharmony_ci{
15962306a36Sopenharmony_ci	return 0;
16062306a36Sopenharmony_ci}
16162306a36Sopenharmony_ci
16262306a36Sopenharmony_cistatic inline void hda_bus_ml_put_all(struct hdac_bus *bus) { }
16362306a36Sopenharmony_cistatic inline void hda_bus_ml_reset_losidv(struct hdac_bus *bus) { }
16462306a36Sopenharmony_cistatic inline int hda_bus_ml_resume(struct hdac_bus *bus) { return 0; }
16562306a36Sopenharmony_cistatic inline int hda_bus_ml_suspend(struct hdac_bus *bus) { return 0; }
16662306a36Sopenharmony_ci
16762306a36Sopenharmony_cistatic inline struct hdac_ext_link *
16862306a36Sopenharmony_cihdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus) { return NULL; }
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_cistatic inline struct hdac_ext_link *
17162306a36Sopenharmony_cihdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus) { return NULL; }
17262306a36Sopenharmony_ci
17362306a36Sopenharmony_cistatic inline struct hdac_ext_link *
17462306a36Sopenharmony_cihdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus) { return NULL; }
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_cistatic inline struct mutex *
17762306a36Sopenharmony_cihdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid) { return NULL; }
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_cistatic inline int
18062306a36Sopenharmony_cihdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable)
18162306a36Sopenharmony_ci{
18262306a36Sopenharmony_ci	return 0;
18362306a36Sopenharmony_ci}
18462306a36Sopenharmony_ci#endif /* CONFIG_SND_SOC_SOF_HDA */
185