Skip to content

Commit 22026c1

Browse files
committed
ALSA: usb: Remove obsoleted fields from struct snd_usb_substream
Many fields have been moved to struct snd_usb_endpoint. Also fix the proc output to correspond to the new structure. Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 85f7193 commit 22026c1

2 files changed

Lines changed: 21 additions & 26 deletions

File tree

‎sound/usb/card.h‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,6 @@ struct snd_usb_substream {
115115
unsigned int cur_rate; /* current rate (for hw_params callback) */
116116
unsigned int period_bytes; /* current period bytes (for hw_params callback) */
117117
unsigned int altset_idx; /* USB data format: index of alternate setting */
118-
unsigned int datapipe; /* the data i/o pipe */
119-
unsigned int syncpipe; /* 1 - async out or adaptive in */
120-
unsigned int datainterval; /* log_2 of data packet interval */
121-
unsigned int syncinterval; /* P for adaptive mode, 0 otherwise */
122-
unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */
123-
unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */
124-
int freqshift; /* how much to shift the feedback value to get Q16.16 */
125-
unsigned int freqmax; /* maximum sampling rate, used for buffer management */
126-
unsigned int phase; /* phase accumulator */
127-
unsigned int maxpacksize; /* max packet size in bytes */
128-
unsigned int maxframesize; /* max packet size in frames */
129-
unsigned int curpacksize; /* current packet size in bytes (for capture) */
130-
unsigned int curframesize; /* current packet size in frames (for capture) */
131-
unsigned int syncmaxsize; /* sync endpoint packet size */
132-
unsigned int fill_max: 1; /* fill max packet size always */
133118
unsigned int txfr_quirk:1; /* allow sub-frame alignment */
134119
unsigned int fmt_type; /* USB audio format type (1-3) */
135120

‎sound/usb/proc.c‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,25 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s
115115
}
116116
}
117117

118+
static void proc_dump_ep_status(struct snd_usb_substream *subs,
119+
struct snd_usb_endpoint *ep,
120+
struct snd_info_buffer *buffer)
121+
{
122+
if (!ep)
123+
return;
124+
snd_iprintf(buffer, " Packet Size = %d\n", ep->curpacksize);
125+
snd_iprintf(buffer, " Momentary freq = %u Hz (%#x.%04x)\n",
126+
snd_usb_get_speed(subs->dev) == USB_SPEED_FULL
127+
? get_full_speed_hz(ep->freqm)
128+
: get_high_speed_hz(ep->freqm),
129+
ep->freqm >> 16, ep->freqm & 0xffff);
130+
if (ep->freqshift != INT_MIN) {
131+
int res = 16 - ep->freqshift;
132+
snd_iprintf(buffer, " Feedback Format = %d.%d\n",
133+
(ep->syncmaxsize > 3 ? 32 : 24) - res, res);
134+
}
135+
}
136+
118137
static void proc_dump_substream_status(struct snd_usb_substream *subs, struct snd_info_buffer *buffer)
119138
{
120139
if (subs->running) {
@@ -126,17 +145,8 @@ static void proc_dump_substream_status(struct snd_usb_substream *subs, struct sn
126145
for (i = 0; i < subs->nurbs; i++)
127146
snd_iprintf(buffer, "%d ", subs->dataurb[i].packets);
128147
snd_iprintf(buffer, "]\n");
129-
snd_iprintf(buffer, " Packet Size = %d\n", subs->curpacksize);
130-
snd_iprintf(buffer, " Momentary freq = %u Hz (%#x.%04x)\n",
131-
snd_usb_get_speed(subs->dev) == USB_SPEED_FULL
132-
? get_full_speed_hz(subs->freqm)
133-
: get_high_speed_hz(subs->freqm),
134-
subs->freqm >> 16, subs->freqm & 0xffff);
135-
if (subs->freqshift != INT_MIN)
136-
snd_iprintf(buffer, " Feedback Format = %d.%d\n",
137-
(subs->syncmaxsize > 3 ? 32 : 24)
138-
- (16 - subs->freqshift),
139-
16 - subs->freqshift);
148+
proc_dump_ep_status(subs, subs->data_endpoint, buffer);
149+
proc_dump_ep_status(subs, subs->sync_endpoint, buffer);
140150
} else {
141151
snd_iprintf(buffer, " Status: Stop\n");
142152
}

0 commit comments

Comments
 (0)