blob: a94f5b6f92ac6bba9476b594d38da22a5a86a8a5 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * HD-Audio helpers to sync with i915 driver
4 */
5#ifndef __SOUND_HDA_I915_H
6#define __SOUND_HDA_I915_H
7
8#include <drm/i915_component.h>
9
10#ifdef CONFIG_SND_HDA_I915
11int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable);
12int snd_hdac_display_power(struct hdac_bus *bus, bool enable);
13void snd_hdac_i915_set_bclk(struct hdac_bus *bus);
14int snd_hdac_sync_audio_rate(struct hdac_device *codec, hda_nid_t nid,
15 int dev_id, int rate);
16int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id,
17 bool *audio_enabled, char *buffer, int max_bytes);
18int snd_hdac_i915_init(struct hdac_bus *bus);
19int snd_hdac_i915_exit(struct hdac_bus *bus);
20int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
21#else
22static inline int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable)
23{
24 return 0;
25}
26static inline int snd_hdac_display_power(struct hdac_bus *bus, bool enable)
27{
28 return 0;
29}
30static inline void snd_hdac_i915_set_bclk(struct hdac_bus *bus)
31{
32}
33static inline int snd_hdac_sync_audio_rate(struct hdac_device *codec,
34 hda_nid_t nid, int dev_id, int rate)
35{
36 return 0;
37}
38static inline int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid,
39 int dev_id, bool *audio_enabled,
40 char *buffer, int max_bytes)
41{
42 return -ENODEV;
43}
44static inline int snd_hdac_i915_init(struct hdac_bus *bus)
45{
46 return -ENODEV;
47}
48static inline int snd_hdac_i915_exit(struct hdac_bus *bus)
49{
50 return 0;
51}
52static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *ops)
53{
54 return -ENODEV;
55}
56#endif
57
58#endif /* __SOUND_HDA_I915_H */