hda_component.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // SPDX-License-Identifier: GPL-2.0
  2. // HD-Audio helpers to sync with DRM driver
  3. #ifndef __SOUND_HDA_COMPONENT_H
  4. #define __SOUND_HDA_COMPONENT_H
  5. #include <drm/drm_audio_component.h>
  6. #ifdef CONFIG_SND_HDA_COMPONENT
  7. int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable);
  8. int snd_hdac_display_power(struct hdac_bus *bus, bool enable);
  9. int snd_hdac_sync_audio_rate(struct hdac_device *codec, hda_nid_t nid,
  10. int dev_id, int rate);
  11. int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id,
  12. bool *audio_enabled, char *buffer, int max_bytes);
  13. int snd_hdac_acomp_init(struct hdac_bus *bus,
  14. const struct drm_audio_component_audio_ops *aops,
  15. int (*match_master)(struct device *, void *),
  16. size_t extra_size);
  17. int snd_hdac_acomp_exit(struct hdac_bus *bus);
  18. int snd_hdac_acomp_register_notifier(struct hdac_bus *bus,
  19. const struct drm_audio_component_audio_ops *ops);
  20. #else
  21. static inline int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable)
  22. {
  23. return 0;
  24. }
  25. static inline int snd_hdac_display_power(struct hdac_bus *bus, bool enable)
  26. {
  27. return 0;
  28. }
  29. static inline int snd_hdac_sync_audio_rate(struct hdac_device *codec,
  30. hda_nid_t nid, int dev_id, int rate)
  31. {
  32. return 0;
  33. }
  34. static inline int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid,
  35. int dev_id, bool *audio_enabled,
  36. char *buffer, int max_bytes)
  37. {
  38. return -ENODEV;
  39. }
  40. static inline int snd_hdac_acomp_init(struct hdac_bus *bus,
  41. const struct drm_audio_component_audio_ops *aops,
  42. int (*match_master)(struct device *, void *),
  43. size_t extra_size)
  44. {
  45. return -ENODEV;
  46. }
  47. static inline int snd_hdac_acomp_exit(struct hdac_bus *bus)
  48. {
  49. return 0;
  50. }
  51. static inline int snd_hdac_acomp_register_notifier(struct hdac_bus *bus,
  52. const struct drm_audio_component_audio_ops *ops)
  53. {
  54. return -ENODEV;
  55. }
  56. #endif
  57. #endif /* __SOUND_HDA_COMPONENT_H */