blob: 5ab972e116ecf6690b766bf4cecf437adaa8dd3f [file] [log] [blame]
Mengdong Lin98d8fc62015-05-19 22:29:30 +08001/*
2 * HD-Audio helpers to sync with i915 driver
3 */
4#ifndef __SOUND_HDA_I915_H
5#define __SOUND_HDA_I915_H
6
David Henningsson45c053d2015-08-19 10:48:57 +02007#include <drm/i915_component.h>
8
Mengdong Lin98d8fc62015-05-19 22:29:30 +08009#ifdef CONFIG_SND_HDA_I915
10int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable);
11int snd_hdac_display_power(struct hdac_bus *bus, bool enable);
Takashi Iwaibb03ed22016-04-21 16:39:17 +020012void snd_hdac_i915_set_bclk(struct hdac_bus *bus);
Pandiyan, Dhinakaranf9318942016-09-21 13:02:48 -070013int snd_hdac_sync_audio_rate(struct hdac_device *codec, hda_nid_t nid,
14 int dev_id, int rate);
15int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id,
Takashi Iwaie2dc7d72015-12-01 12:39:38 +010016 bool *audio_enabled, char *buffer, int max_bytes);
Mengdong Lin98d8fc62015-05-19 22:29:30 +080017int snd_hdac_i915_init(struct hdac_bus *bus);
18int snd_hdac_i915_exit(struct hdac_bus *bus);
David Henningsson45c053d2015-08-19 10:48:57 +020019int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
Mengdong Lin98d8fc62015-05-19 22:29:30 +080020#else
Takashi Iwai6869de32015-09-02 12:24:55 +020021static inline int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable)
Mengdong Lin98d8fc62015-05-19 22:29:30 +080022{
23 return 0;
24}
25static inline int snd_hdac_display_power(struct hdac_bus *bus, bool enable)
26{
27 return 0;
28}
Takashi Iwaibb03ed22016-04-21 16:39:17 +020029static inline void snd_hdac_i915_set_bclk(struct hdac_bus *bus)
Mengdong Lin98d8fc62015-05-19 22:29:30 +080030{
Mengdong Lin98d8fc62015-05-19 22:29:30 +080031}
Takashi Iwaid745f5e2016-03-21 14:41:58 +010032static inline int snd_hdac_sync_audio_rate(struct hdac_device *codec,
Pandiyan, Dhinakaranf9318942016-09-21 13:02:48 -070033 hda_nid_t nid, int dev_id, int rate)
Takashi Iwaie2dc7d72015-12-01 12:39:38 +010034{
35 return 0;
36}
Takashi Iwaid745f5e2016-03-21 14:41:58 +010037static inline int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid,
Pandiyan, Dhinakaranf9318942016-09-21 13:02:48 -070038 int dev_id, bool *audio_enabled,
39 char *buffer, int max_bytes)
Takashi Iwaie2dc7d72015-12-01 12:39:38 +010040{
41 return -ENODEV;
42}
Mengdong Lin98d8fc62015-05-19 22:29:30 +080043static inline int snd_hdac_i915_init(struct hdac_bus *bus)
44{
45 return -ENODEV;
46}
47static inline int snd_hdac_i915_exit(struct hdac_bus *bus)
48{
49 return 0;
50}
David Henningsson45c053d2015-08-19 10:48:57 +020051static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *ops)
52{
53 return -ENODEV;
54}
Mengdong Lin98d8fc62015-05-19 22:29:30 +080055#endif
56
57#endif /* __SOUND_HDA_I915_H */