forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/sound/pci/hda/hda_controller.h
....@@ -1,15 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * 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.
134 */
145
156 #ifndef __SOUND_HDA_CONTROLLER_H
....@@ -20,7 +11,7 @@
2011 #include <sound/core.h>
2112 #include <sound/pcm.h>
2213 #include <sound/initval.h>
23
-#include "hda_codec.h"
14
+#include <sound/hda_codec.h>
2415 #include <sound/hda_register.h>
2516
2617 #define AZX_MAX_CODECS HDA_MAX_CODECS
....@@ -42,7 +33,7 @@
4233 #define AZX_DCAPS_POSFIX_LPIB (1 << 16) /* Use LPIB as default */
4334 #define AZX_DCAPS_AMD_WORKAROUND (1 << 17) /* AMD-specific workaround */
4435 #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 */
4637 #define AZX_DCAPS_OLD_SSYNC (1 << 20) /* Old SSYNC reg for ICH */
4738 #define AZX_DCAPS_NO_ALIGN_BUFSIZE (1 << 21) /* no buffer size alignment */
4839 /* 22 unused */
....@@ -50,11 +41,7 @@
5041 /* 24 unused */
5142 #define AZX_DCAPS_COUNT_LPIB_DELAY (1 << 25) /* Take LPIB as delay */
5243 #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 */
5845 #define AZX_DCAPS_CORBRP_SELF_CLEAR (1 << 28) /* CORBRP clears itself after reset */
5946 #define AZX_DCAPS_NO_MSI64 (1 << 29) /* Stick to 32-bit MSIs */
6047 #define AZX_DCAPS_SEPARATE_STREAM_TAG (1 << 30) /* capture and playback use separate stream tag */
....@@ -76,7 +63,6 @@
7663 * when link position is not greater than FIFO size
7764 */
7865 unsigned int insufficient:1;
79
- unsigned int wc_marked:1;
8066 };
8167
8268 #define azx_stream(dev) (&(dev)->core)
....@@ -88,11 +74,6 @@
8874 struct hda_controller_ops {
8975 /* Disable msi if supported, PCI only */
9076 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);
9677 void (*pcm_mmap_prepare)(struct snd_pcm_substream *substream,
9778 struct vm_area_struct *area);
9879 /* Check if current position is acceptable */
....@@ -127,7 +108,7 @@
127108 int capture_streams;
128109 int capture_index_offset;
129110 int num_streams;
130
- const int *jackpoll_ms; /* per-card jack poll interval */
111
+ int jackpoll_interval; /* jack poll interval in jiffies */
131112
132113 /* Register interaction. */
133114 const struct hda_controller_ops *ops;
....@@ -152,11 +133,9 @@
152133
153134 /* flags */
154135 int bdl_pos_adj;
155
- int poll_count;
156136 unsigned int running:1;
157137 unsigned int fallback_to_single_cmd:1;
158138 unsigned int single_cmd:1;
159
- unsigned int polling_mode:1;
160139 unsigned int msi:1;
161140 unsigned int probing:1; /* codec probing phase */
162141 unsigned int snoop:1;
....@@ -164,6 +143,7 @@
164143 unsigned int align_buffer_size:1;
165144 unsigned int region_requested:1;
166145 unsigned int disabled:1; /* disabled by vga_switcheroo */
146
+ unsigned int pm_prepared:1;
167147
168148 /* GTS present */
169149 unsigned int gts_present:1;
....@@ -227,8 +207,7 @@
227207 irqreturn_t azx_interrupt(int irq, void *dev_id);
228208
229209 /* 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);
232211 int azx_probe_codecs(struct azx *chip, unsigned int max_slots);
233212 int azx_codec_configure(struct azx *chip);
234213 int azx_init_streams(struct azx *chip);