Mengdong Lin | 98d8fc6 | 2015-05-19 22:29:30 +0800 | [diff] [blame] | 1 | /* |
| 2 | * HD-Audio helpers to sync with i915 driver |
| 3 | */ |
| 4 | #ifndef __SOUND_HDA_I915_H |
| 5 | #define __SOUND_HDA_I915_H |
| 6 | |
David Henningsson | 45c053d | 2015-08-19 10:48:57 +0200 | [diff] [blame] | 7 | #include <drm/i915_component.h> |
| 8 | |
Mengdong Lin | 98d8fc6 | 2015-05-19 22:29:30 +0800 | [diff] [blame] | 9 | #ifdef CONFIG_SND_HDA_I915 |
| 10 | int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable); |
| 11 | int snd_hdac_display_power(struct hdac_bus *bus, bool enable); |
Takashi Iwai | bb03ed2 | 2016-04-21 16:39:17 +0200 | [diff] [blame] | 12 | void snd_hdac_i915_set_bclk(struct hdac_bus *bus); |
Pandiyan, Dhinakaran | f931894 | 2016-09-21 13:02:48 -0700 | [diff] [blame] | 13 | int snd_hdac_sync_audio_rate(struct hdac_device *codec, hda_nid_t nid, |
| 14 | int dev_id, int rate); |
| 15 | int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id, |
Takashi Iwai | e2dc7d7 | 2015-12-01 12:39:38 +0100 | [diff] [blame] | 16 | bool *audio_enabled, char *buffer, int max_bytes); |
Mengdong Lin | 98d8fc6 | 2015-05-19 22:29:30 +0800 | [diff] [blame] | 17 | int snd_hdac_i915_init(struct hdac_bus *bus); |
| 18 | int snd_hdac_i915_exit(struct hdac_bus *bus); |
David Henningsson | 45c053d | 2015-08-19 10:48:57 +0200 | [diff] [blame] | 19 | int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *); |
Mengdong Lin | 98d8fc6 | 2015-05-19 22:29:30 +0800 | [diff] [blame] | 20 | #else |
Takashi Iwai | 6869de3 | 2015-09-02 12:24:55 +0200 | [diff] [blame] | 21 | static inline int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable) |
Mengdong Lin | 98d8fc6 | 2015-05-19 22:29:30 +0800 | [diff] [blame] | 22 | { |
| 23 | return 0; |
| 24 | } |
| 25 | static inline int snd_hdac_display_power(struct hdac_bus *bus, bool enable) |
| 26 | { |
| 27 | return 0; |
| 28 | } |
Takashi Iwai | bb03ed2 | 2016-04-21 16:39:17 +0200 | [diff] [blame] | 29 | static inline void snd_hdac_i915_set_bclk(struct hdac_bus *bus) |
Mengdong Lin | 98d8fc6 | 2015-05-19 22:29:30 +0800 | [diff] [blame] | 30 | { |
Mengdong Lin | 98d8fc6 | 2015-05-19 22:29:30 +0800 | [diff] [blame] | 31 | } |
Takashi Iwai | d745f5e | 2016-03-21 14:41:58 +0100 | [diff] [blame] | 32 | static inline int snd_hdac_sync_audio_rate(struct hdac_device *codec, |
Pandiyan, Dhinakaran | f931894 | 2016-09-21 13:02:48 -0700 | [diff] [blame] | 33 | hda_nid_t nid, int dev_id, int rate) |
Takashi Iwai | e2dc7d7 | 2015-12-01 12:39:38 +0100 | [diff] [blame] | 34 | { |
| 35 | return 0; |
| 36 | } |
Takashi Iwai | d745f5e | 2016-03-21 14:41:58 +0100 | [diff] [blame] | 37 | static inline int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, |
Pandiyan, Dhinakaran | f931894 | 2016-09-21 13:02:48 -0700 | [diff] [blame] | 38 | int dev_id, bool *audio_enabled, |
| 39 | char *buffer, int max_bytes) |
Takashi Iwai | e2dc7d7 | 2015-12-01 12:39:38 +0100 | [diff] [blame] | 40 | { |
| 41 | return -ENODEV; |
| 42 | } |
Mengdong Lin | 98d8fc6 | 2015-05-19 22:29:30 +0800 | [diff] [blame] | 43 | static inline int snd_hdac_i915_init(struct hdac_bus *bus) |
| 44 | { |
| 45 | return -ENODEV; |
| 46 | } |
| 47 | static inline int snd_hdac_i915_exit(struct hdac_bus *bus) |
| 48 | { |
| 49 | return 0; |
| 50 | } |
David Henningsson | 45c053d | 2015-08-19 10:48:57 +0200 | [diff] [blame] | 51 | static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *ops) |
| 52 | { |
| 53 | return -ENODEV; |
| 54 | } |
Mengdong Lin | 98d8fc6 | 2015-05-19 22:29:30 +0800 | [diff] [blame] | 55 | #endif |
| 56 | |
| 57 | #endif /* __SOUND_HDA_I915_H */ |