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