Skip to content

Commit b9fd200

Browse files
puleglottiwai
authored andcommitted
ALSA: usb-audio: Replace s/frame/packet/ where appropriate
Replace several occurences of "frame" with a "packet" where appropriate. Signed-off-by: Alexander Tsoy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 695cf5a commit b9fd200

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

sound/usb/card.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ struct snd_usb_endpoint {
8484
dma_addr_t sync_dma; /* DMA address of syncbuf */
8585

8686
unsigned int pipe; /* the data i/o pipe */
87-
unsigned int framesize[2]; /* small/large frame sizes in samples */
88-
unsigned int sample_rem; /* remainder from division fs/fps */
87+
unsigned int packsize[2]; /* small/large packet sizes in samples */
88+
unsigned int sample_rem; /* remainder from division fs/pps */
8989
unsigned int sample_accum; /* sample accumulator */
90-
unsigned int fps; /* frames per second */
90+
unsigned int pps; /* packets per second */
9191
unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */
9292
unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */
9393
int freqshift; /* how much to shift the feedback value to get Q16.16 */

sound/usb/endpoint.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep)
159159
return ep->maxframesize;
160160

161161
ep->sample_accum += ep->sample_rem;
162-
if (ep->sample_accum >= ep->fps) {
163-
ep->sample_accum -= ep->fps;
164-
ret = ep->framesize[1];
162+
if (ep->sample_accum >= ep->pps) {
163+
ep->sample_accum -= ep->pps;
164+
ret = ep->packsize[1];
165165
} else {
166-
ret = ep->framesize[0];
166+
ret = ep->packsize[0];
167167
}
168168

169169
return ret;
@@ -1088,16 +1088,15 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
10881088

10891089
if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_FULL) {
10901090
ep->freqn = get_usb_full_speed_rate(rate);
1091-
ep->fps = 1000;
1091+
ep->pps = 1000 >> ep->datainterval;
10921092
} else {
10931093
ep->freqn = get_usb_high_speed_rate(rate);
1094-
ep->fps = 8000;
1094+
ep->pps = 8000 >> ep->datainterval;
10951095
}
1096-
ep->fps >>= ep->datainterval;
10971096

1098-
ep->sample_rem = rate % ep->fps;
1099-
ep->framesize[0] = rate / ep->fps;
1100-
ep->framesize[1] = (rate + (ep->fps - 1)) / ep->fps;
1097+
ep->sample_rem = rate % ep->pps;
1098+
ep->packsize[0] = rate / ep->pps;
1099+
ep->packsize[1] = (rate + (ep->pps - 1)) / ep->pps;
11011100

11021101
/* calculate the frequency in 16.16 format */
11031102
ep->freqm = ep->freqn;

0 commit comments

Comments
 (0)