.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Common functionality for the alsa driver code base for HD Audio. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify it |
---|
5 | | - * under the terms of the GNU General Public License as published by the Free |
---|
6 | | - * Software Foundation; either version 2 of the License, or (at your option) |
---|
7 | | - * any later version. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
---|
10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
12 | | - * more details. |
---|
13 | 4 | */ |
---|
14 | 5 | |
---|
15 | 6 | #ifndef __SOUND_HDA_CONTROLLER_H |
---|
.. | .. |
---|
20 | 11 | #include <sound/core.h> |
---|
21 | 12 | #include <sound/pcm.h> |
---|
22 | 13 | #include <sound/initval.h> |
---|
23 | | -#include "hda_codec.h" |
---|
| 14 | +#include <sound/hda_codec.h> |
---|
24 | 15 | #include <sound/hda_register.h> |
---|
25 | 16 | |
---|
26 | 17 | #define AZX_MAX_CODECS HDA_MAX_CODECS |
---|
.. | .. |
---|
42 | 33 | #define AZX_DCAPS_POSFIX_LPIB (1 << 16) /* Use LPIB as default */ |
---|
43 | 34 | #define AZX_DCAPS_AMD_WORKAROUND (1 << 17) /* AMD-specific workaround */ |
---|
44 | 35 | #define AZX_DCAPS_NO_64BIT (1 << 18) /* No 64bit address */ |
---|
45 | | -#define AZX_DCAPS_SYNC_WRITE (1 << 19) /* sync each cmd write */ |
---|
| 36 | +/* 19 unused */ |
---|
46 | 37 | #define AZX_DCAPS_OLD_SSYNC (1 << 20) /* Old SSYNC reg for ICH */ |
---|
47 | 38 | #define AZX_DCAPS_NO_ALIGN_BUFSIZE (1 << 21) /* no buffer size alignment */ |
---|
48 | 39 | /* 22 unused */ |
---|
.. | .. |
---|
50 | 41 | /* 24 unused */ |
---|
51 | 42 | #define AZX_DCAPS_COUNT_LPIB_DELAY (1 << 25) /* Take LPIB as delay */ |
---|
52 | 43 | #define AZX_DCAPS_PM_RUNTIME (1 << 26) /* runtime PM support */ |
---|
53 | | -#ifdef CONFIG_SND_HDA_I915 |
---|
54 | | -#define AZX_DCAPS_I915_POWERWELL (1 << 27) /* HSW i915 powerwell support */ |
---|
55 | | -#else |
---|
56 | | -#define AZX_DCAPS_I915_POWERWELL 0 /* NOP */ |
---|
57 | | -#endif |
---|
| 44 | +#define AZX_DCAPS_RETRY_PROBE (1 << 27) /* retry probe if no codec is configured */ |
---|
58 | 45 | #define AZX_DCAPS_CORBRP_SELF_CLEAR (1 << 28) /* CORBRP clears itself after reset */ |
---|
59 | 46 | #define AZX_DCAPS_NO_MSI64 (1 << 29) /* Stick to 32-bit MSIs */ |
---|
60 | 47 | #define AZX_DCAPS_SEPARATE_STREAM_TAG (1 << 30) /* capture and playback use separate stream tag */ |
---|
.. | .. |
---|
76 | 63 | * when link position is not greater than FIFO size |
---|
77 | 64 | */ |
---|
78 | 65 | unsigned int insufficient:1; |
---|
79 | | - unsigned int wc_marked:1; |
---|
80 | 66 | }; |
---|
81 | 67 | |
---|
82 | 68 | #define azx_stream(dev) (&(dev)->core) |
---|
.. | .. |
---|
88 | 74 | struct hda_controller_ops { |
---|
89 | 75 | /* Disable msi if supported, PCI only */ |
---|
90 | 76 | int (*disable_msi_reset_irq)(struct azx *); |
---|
91 | | - int (*substream_alloc_pages)(struct azx *chip, |
---|
92 | | - struct snd_pcm_substream *substream, |
---|
93 | | - size_t size); |
---|
94 | | - int (*substream_free_pages)(struct azx *chip, |
---|
95 | | - struct snd_pcm_substream *substream); |
---|
96 | 77 | void (*pcm_mmap_prepare)(struct snd_pcm_substream *substream, |
---|
97 | 78 | struct vm_area_struct *area); |
---|
98 | 79 | /* Check if current position is acceptable */ |
---|
.. | .. |
---|
127 | 108 | int capture_streams; |
---|
128 | 109 | int capture_index_offset; |
---|
129 | 110 | int num_streams; |
---|
130 | | - const int *jackpoll_ms; /* per-card jack poll interval */ |
---|
| 111 | + int jackpoll_interval; /* jack poll interval in jiffies */ |
---|
131 | 112 | |
---|
132 | 113 | /* Register interaction. */ |
---|
133 | 114 | const struct hda_controller_ops *ops; |
---|
.. | .. |
---|
152 | 133 | |
---|
153 | 134 | /* flags */ |
---|
154 | 135 | int bdl_pos_adj; |
---|
155 | | - int poll_count; |
---|
156 | 136 | unsigned int running:1; |
---|
157 | 137 | unsigned int fallback_to_single_cmd:1; |
---|
158 | 138 | unsigned int single_cmd:1; |
---|
159 | | - unsigned int polling_mode:1; |
---|
160 | 139 | unsigned int msi:1; |
---|
161 | 140 | unsigned int probing:1; /* codec probing phase */ |
---|
162 | 141 | unsigned int snoop:1; |
---|
.. | .. |
---|
164 | 143 | unsigned int align_buffer_size:1; |
---|
165 | 144 | unsigned int region_requested:1; |
---|
166 | 145 | unsigned int disabled:1; /* disabled by vga_switcheroo */ |
---|
| 146 | + unsigned int pm_prepared:1; |
---|
167 | 147 | |
---|
168 | 148 | /* GTS present */ |
---|
169 | 149 | unsigned int gts_present:1; |
---|
.. | .. |
---|
227 | 207 | irqreturn_t azx_interrupt(int irq, void *dev_id); |
---|
228 | 208 | |
---|
229 | 209 | /* Codec interface */ |
---|
230 | | -int azx_bus_init(struct azx *chip, const char *model, |
---|
231 | | - const struct hdac_io_ops *io_ops); |
---|
| 210 | +int azx_bus_init(struct azx *chip, const char *model); |
---|
232 | 211 | int azx_probe_codecs(struct azx *chip, unsigned int max_slots); |
---|
233 | 212 | int azx_codec_configure(struct azx *chip); |
---|
234 | 213 | int azx_init_streams(struct azx *chip); |
---|