forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/usb/card.h
....@@ -16,6 +16,7 @@
1616 u64 formats; /* ALSA format bits */
1717 unsigned int channels; /* # channels */
1818 unsigned int fmt_type; /* USB audio format type (1-3) */
19
+ unsigned int fmt_bits; /* number of significant bits */
1920 unsigned int frame_size; /* samples per frame for non-audio */
2021 int iface; /* interface number */
2122 unsigned char altsetting; /* corresponding alternate setting */
....@@ -85,6 +86,10 @@
8586 dma_addr_t sync_dma; /* DMA address of syncbuf */
8687
8788 unsigned int pipe; /* the data i/o pipe */
89
+ unsigned int packsize[2]; /* small/large packet sizes in samples */
90
+ unsigned int sample_rem; /* remainder from division fs/pps */
91
+ unsigned int sample_accum; /* sample accumulator */
92
+ unsigned int pps; /* packets per second */
8893 unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */
8994 unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */
9095 int freqshift; /* how much to shift the feedback value to get Q16.16 */
....@@ -105,6 +110,7 @@
105110 int iface, altsetting;
106111 int skip_packets; /* quirks for devices to ignore the first n packets
107112 in a stream */
113
+ bool is_implicit_feedback; /* This endpoint is used as implicit feedback */
108114
109115 spinlock_t lock;
110116 struct list_head list;
....@@ -114,6 +120,8 @@
114120 ANDROID_KABI_RESERVE(3);
115121 ANDROID_KABI_RESERVE(4);
116122 };
123
+
124
+struct media_ctl;
117125
118126 struct snd_usb_substream {
119127 struct snd_usb_stream *stream;
....@@ -136,6 +144,7 @@
136144 unsigned int tx_length_quirk:1; /* add length specifier to transfers */
137145 unsigned int fmt_type; /* USB audio format type (1-3) */
138146 unsigned int pkt_offset_adj; /* Bytes to drop from beginning of packets (for non-compliant devices) */
147
+ unsigned int stream_offset_adj; /* Bytes to drop from beginning of stream (for non-compliant devices) */
139148
140149 unsigned int running: 1; /* running status */
141150
....@@ -168,6 +177,9 @@
168177 } dsd_dop;
169178
170179 bool trigger_tstamp_pending_update; /* trigger timestamp being updated from initial estimate */
180
+ struct media_ctl *media_ctl;
181
+
182
+ ANDROID_KABI_RESERVE(1);
171183 };
172184
173185 struct snd_usb_stream {
....@@ -183,4 +195,21 @@
183195 unsigned int pcm_idx, unsigned int direction, struct snd_usb_audio
184196 **uchip, void (*disconnect_cb)(struct snd_usb_audio *chip));
185197
198
+int snd_vendor_set_ops(struct snd_usb_audio_vendor_ops *vendor_ops);
199
+struct snd_usb_audio_vendor_ops *snd_vendor_get_ops(void);
200
+int snd_vendor_set_interface(struct usb_device *udev,
201
+ struct usb_host_interface *alts,
202
+ int iface, int alt);
203
+int snd_vendor_set_rate(struct usb_interface *intf, int iface, int rate,
204
+ int alt);
205
+int snd_vendor_set_pcm_buf(struct usb_device *udev, int iface);
206
+int snd_vendor_set_pcm_intf(struct usb_interface *intf, int iface, int alt,
207
+ int direction);
208
+int snd_vendor_set_pcm_connection(struct usb_device *udev,
209
+ enum snd_vendor_pcm_open_close onoff,
210
+ int direction);
211
+int snd_vendor_set_pcm_binterval(struct audioformat *fp,
212
+ struct audioformat *found,
213
+ int *cur_attr, int *attr);
214
+
186215 #endif /* __USBAUDIO_CARD_H */