blob: 505f987eb4a2285dd0050231386ff6bb44735cec [file] [log] [blame]
Wang Xingchao99a20082013-05-30 22:07:10 +08001/*
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 */
Imre Deak347de1f2015-01-08 17:54:15 +020016#ifndef __SOUND_HDA_INTEL_H
17#define __SOUND_HDA_INTEL_H
18
Imre Deakd7055bd2015-01-08 17:54:17 +020019#include <drm/i915_component.h>
Takashi Iwai89a93fe2015-02-19 18:04:17 +010020#include "hda_controller.h"
Imre Deak347de1f2015-01-08 17:54:15 +020021
22struct hda_intel {
23 struct azx chip;
24
25 /* for pending irqs */
26 struct work_struct irq_pending_work;
27
28 /* sync probing */
29 struct completion probe_wait;
30 struct work_struct probe_work;
31
32 /* card list (for power_save trigger) */
33 struct list_head list;
34
35 /* extra flags */
36 unsigned int irq_pending_warned:1;
Takashi Iwaia41d1222015-04-14 22:13:18 +020037 unsigned int probe_continued:1;
Imre Deak347de1f2015-01-08 17:54:15 +020038
39 /* VGA-switcheroo setup */
40 unsigned int use_vga_switcheroo:1;
41 unsigned int vga_switcheroo_registered:1;
42 unsigned int init_failed:1; /* delayed init failed */
43
44 /* secondary power domain for hdmi audio under vga device */
45 struct dev_pm_domain hdmi_pm_domain;
Imre Deakd7055bd2015-01-08 17:54:17 +020046
47 /* i915 component interface */
Mengdong Lin795614d2015-04-29 17:43:36 +080048 bool need_i915_power:1; /* the hda controller needs i915 power */
Imre Deakd7055bd2015-01-08 17:54:17 +020049 struct i915_audio_component audio_component;
Mengdong Lind4b7b132015-04-29 17:43:12 +080050 int i915_power_refcount;
Imre Deak347de1f2015-01-08 17:54:15 +020051};
Wang Xingchao99a20082013-05-30 22:07:10 +080052
53#ifdef CONFIG_SND_HDA_I915
Imre Deak926981a2015-01-08 17:54:16 +020054int hda_display_power(struct hda_intel *hda, bool enable);
55void haswell_set_bclk(struct hda_intel *hda);
56int hda_i915_init(struct hda_intel *hda);
57int hda_i915_exit(struct hda_intel *hda);
Wang Xingchao99a20082013-05-30 22:07:10 +080058#else
Imre Deak926981a2015-01-08 17:54:16 +020059static inline int hda_display_power(struct hda_intel *hda, bool enable)
60{
61 return 0;
62}
63static inline void haswell_set_bclk(struct hda_intel *hda) { return; }
64static inline int hda_i915_init(struct hda_intel *hda)
Wang Xingchao99a20082013-05-30 22:07:10 +080065{
66 return -ENODEV;
67}
Imre Deak926981a2015-01-08 17:54:16 +020068static inline int hda_i915_exit(struct hda_intel *hda)
Wang Xingchao99a20082013-05-30 22:07:10 +080069{
70 return 0;
71}
72#endif
73
74#endif