blob: a94f5b6f92ac6bba9476b594d38da22a5a86a8a5 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Mengdong Lin98d8fc62015-05-19 22:29:30 +08002/*
3 * HD-Audio helpers to sync with i915 driver
4 */
5#ifndef __SOUND_HDA_I915_H
6#define __SOUND_HDA_I915_H
7
David Henningsson45c053d2015-08-19 10:48:57 +02008#include <drm/i915_component.h>
9
Mengdong Lin98d8fc62015-05-19 22:29:30 +080010#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);
Takashi Iwaibb03ed22016-04-21 16:39:17 +020013void snd_hdac_i915_set_bclk(struct hdac_bus *bus);
Pandiyan, Dhinakaranf9318942016-09-21 13:02:48 -070014int 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,
Takashi Iwaie2dc7d72015-12-01 12:39:38 +010017 bool *audio_enabled, char *buffer, int max_bytes);
Mengdong Lin98d8fc62015-05-19 22:29:30 +080018int snd_hdac_i915_init(struct hdac_bus *bus);
19int snd_hdac_i915_exit(struct hdac_bus *bus);
David Henningsson45c053d2015-08-19 10:48:57 +020020int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
Mengdong Lin98d8fc62015-05-19 22:29:30 +080021#else
Takashi Iwai6869de32015-09-02 12:24:55 +020022static inline int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable)
Mengdong Lin98d8fc62015-05-19 22:29:30 +080023{
24 return 0;
25}
26static inline int snd_hdac_display_power(struct hdac_bus *bus, bool enable)
27{
28 return 0;
29}
Takashi Iwaibb03ed22016-04-21 16:39:17 +020030static inline void snd_hdac_i915_set_bclk(struct hdac_bus *bus)
Mengdong Lin98d8fc62015-05-19 22:29:30 +080031{
Mengdong Lin98d8fc62015-05-19 22:29:30 +080032}
Takashi Iwaid745f5e2016-03-21 14:41:58 +010033static inline int snd_hdac_sync_audio_rate(struct hdac_device *codec,
Pandiyan, Dhinakaranf9318942016-09-21 13:02:48 -070034 hda_nid_t nid, int dev_id, int rate)
Takashi Iwaie2dc7d72015-12-01 12:39:38 +010035{
36 return 0;
37}
Takashi Iwaid745f5e2016-03-21 14:41:58 +010038static inline int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid,
Pandiyan, Dhinakaranf9318942016-09-21 13:02:48 -070039 int dev_id, bool *audio_enabled,
40 char *buffer, int max_bytes)
Takashi Iwaie2dc7d72015-12-01 12:39:38 +010041{
42 return -ENODEV;
43}
Mengdong Lin98d8fc62015-05-19 22:29:30 +080044static 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}
David Henningsson45c053d2015-08-19 10:48:57 +020052static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *ops)
53{
54 return -ENODEV;
55}
Mengdong Lin98d8fc62015-05-19 22:29:30 +080056#endif
57
58#endif /* __SOUND_HDA_I915_H */