hda_i915.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* 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. #include <drm/i915_component.h>
  8. #ifdef CONFIG_SND_HDA_I915
  9. int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable);
  10. int snd_hdac_display_power(struct hdac_bus *bus, bool enable);
  11. void snd_hdac_i915_set_bclk(struct hdac_bus *bus);
  12. int snd_hdac_sync_audio_rate(struct hdac_device *codec, hda_nid_t nid,
  13. int dev_id, int rate);
  14. int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id,
  15. bool *audio_enabled, char *buffer, int max_bytes);
  16. int snd_hdac_i915_init(struct hdac_bus *bus);
  17. int snd_hdac_i915_exit(struct hdac_bus *bus);
  18. int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
  19. #else
  20. static inline int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable)
  21. {
  22. return 0;
  23. }
  24. static inline int snd_hdac_display_power(struct hdac_bus *bus, bool enable)
  25. {
  26. return 0;
  27. }
  28. static inline void snd_hdac_i915_set_bclk(struct hdac_bus *bus)
  29. {
  30. }
  31. static inline int snd_hdac_sync_audio_rate(struct hdac_device *codec,
  32. hda_nid_t nid, int dev_id, int rate)
  33. {
  34. return 0;
  35. }
  36. static inline int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid,
  37. int dev_id, bool *audio_enabled,
  38. char *buffer, int max_bytes)
  39. {
  40. return -ENODEV;
  41. }
  42. static inline int snd_hdac_i915_init(struct hdac_bus *bus)
  43. {
  44. return -ENODEV;
  45. }
  46. static inline int snd_hdac_i915_exit(struct hdac_bus *bus)
  47. {
  48. return 0;
  49. }
  50. static inline int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *ops)
  51. {
  52. return -ENODEV;
  53. }
  54. #endif
  55. #endif /* __SOUND_HDA_I915_H */