1 // SPDX-License-Identifier: (GPL-2.0 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) 2018 Intel Corporation. All rights reserved.
8 // Authors: Keyon Jie <yang.jie@linux.intel.com>
11 #include <sound/hdaudio.h>
12 #include "../sof-priv.h"
15 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
16 #include "../../codecs/hdac_hda.h"
17 #define sof_hda_ext_ops snd_soc_hdac_hda_get_ops()
19 #define sof_hda_ext_ops NULL
23 * This can be used for both with/without hda link support.
25 void sof_hda_bus_init(struct hdac_bus
*bus
, struct device
*dev
)
27 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
28 snd_hdac_ext_bus_init(bus
, dev
, NULL
, sof_hda_ext_ops
);
29 #else /* CONFIG_SND_SOC_SOF_HDA */
30 memset(bus
, 0, sizeof(*bus
));
33 INIT_LIST_HEAD(&bus
->stream_list
);
38 * There is only one HDA bus atm. keep the index as 0.
39 * Need to fix when there are more than one HDA bus.
43 spin_lock_init(&bus
->reg_lock
);
44 #endif /* CONFIG_SND_SOC_SOF_HDA */