hda_intel.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it
  3. * under the terms of the GNU General Public License as published by the Free
  4. * Software Foundation; either version 2 of the License, or (at your option)
  5. * any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  10. * more details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program; if not, write to the Free Software Foundation, Inc., 59
  14. * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. #ifndef __SOUND_HDA_INTEL_H
  17. #define __SOUND_HDA_INTEL_H
  18. #include <drm/i915_component.h>
  19. #include "hda_controller.h"
  20. struct hda_intel {
  21. struct azx chip;
  22. /* for pending irqs */
  23. struct work_struct irq_pending_work;
  24. /* sync probing */
  25. struct completion probe_wait;
  26. struct work_struct probe_work;
  27. /* card list (for power_save trigger) */
  28. struct list_head list;
  29. /* extra flags */
  30. unsigned int irq_pending_warned:1;
  31. unsigned int probe_continued:1;
  32. /* VGA-switcheroo setup */
  33. unsigned int use_vga_switcheroo:1;
  34. unsigned int vga_switcheroo_registered:1;
  35. unsigned int init_failed:1; /* delayed init failed */
  36. /* secondary power domain for hdmi audio under vga device */
  37. struct dev_pm_domain hdmi_pm_domain;
  38. /* i915 component interface */
  39. bool need_i915_power:1; /* the hda controller needs i915 power */
  40. struct i915_audio_component audio_component;
  41. int i915_power_refcount;
  42. };
  43. #ifdef CONFIG_SND_HDA_I915
  44. int hda_set_codec_wakeup(struct hda_intel *hda, bool enable);
  45. int hda_display_power(struct hda_intel *hda, bool enable);
  46. void haswell_set_bclk(struct hda_intel *hda);
  47. int hda_i915_init(struct hda_intel *hda);
  48. int hda_i915_exit(struct hda_intel *hda);
  49. #else
  50. static inline int hda_set_codec_wakeup(struct hda_intel *hda, bool enable)
  51. {
  52. return 0;
  53. }
  54. static inline int hda_display_power(struct hda_intel *hda, bool enable)
  55. {
  56. return 0;
  57. }
  58. static inline void haswell_set_bclk(struct hda_intel *hda) { return; }
  59. static inline int hda_i915_init(struct hda_intel *hda)
  60. {
  61. return 0;
  62. }
  63. static inline int hda_i915_exit(struct hda_intel *hda)
  64. {
  65. return 0;
  66. }
  67. #endif
  68. #endif