hda_beep.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Digital Beep Input Interface for HD-audio codec
  4. *
  5. * Author: Matt Ranostay <[email protected]>
  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. struct mutex mutex;
  27. void (*power_hook)(struct hda_beep *beep, bool on);
  28. };
  29. #ifdef CONFIG_SND_HDA_INPUT_BEEP
  30. int snd_hda_enable_beep_device(struct hda_codec *codec, int enable);
  31. int snd_hda_attach_beep_device(struct hda_codec *codec, int nid);
  32. void snd_hda_detach_beep_device(struct hda_codec *codec);
  33. #else
  34. static inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
  35. {
  36. return 0;
  37. }
  38. static inline void snd_hda_detach_beep_device(struct hda_codec *codec)
  39. {
  40. }
  41. #endif
  42. #endif