hda_beep.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Digital Beep Input Interface for HD-audio codec
  4. *
  5. * Author: Matt Ranostay <matt.ranostay@konsulko.com>
  6. * Copyright (c) 2008 Embedded Alley Solutions Inc
  7. */
  8. #ifndef __SOUND_HDA_BEEP_H
  9. #define __SOUND_HDA_BEEP_H
  10. #include <sound/hda_codec.h>
  11. #define HDA_BEEP_MODE_OFF 0
  12. #define HDA_BEEP_MODE_ON 1
  13. /* beep information */
  14. struct hda_beep {
  15. struct input_dev *dev;
  16. struct hda_codec *codec;
  17. char phys[32];
  18. int tone;
  19. hda_nid_t nid;
  20. unsigned int registered:1;
  21. unsigned int enabled:1;
  22. unsigned int linear_tone:1; /* linear tone for IDT/STAC codec */
  23. unsigned int playing:1;
  24. unsigned int keep_power_at_enable:1; /* set by driver */
  25. struct work_struct beep_work; /* scheduled task for beep event */
  26. void (*power_hook)(struct hda_beep *beep, bool on);
  27. };
  28. #ifdef CONFIG_SND_HDA_INPUT_BEEP
  29. int snd_hda_enable_beep_device(struct hda_codec *codec, int enable);
  30. int snd_hda_attach_beep_device(struct hda_codec *codec, int nid);
  31. void snd_hda_detach_beep_device(struct hda_codec *codec);
  32. #else
  33. static inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
  34. {
  35. return 0;
  36. }
  37. static inline void snd_hda_detach_beep_device(struct hda_codec *codec)
  38. {
  39. }
  40. #endif
  41. #endif