Commit b9fd2007 authored by Alexander Tsoy's avatar Alexander Tsoy Committed by Takashi Iwai

ALSA: usb-audio: Replace s/frame/packet/ where appropriate

Replace several occurences of "frame" with a "packet" where appropriate.
Signed-off-by: default avatarAlexander Tsoy <alexander@tsoy.me>
Link: https://lore.kernel.org/r/20200629025934.154288-2-alexander@tsoy.meSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 695cf5ab
...@@ -84,10 +84,10 @@ struct snd_usb_endpoint { ...@@ -84,10 +84,10 @@ struct snd_usb_endpoint {
dma_addr_t sync_dma; /* DMA address of syncbuf */ dma_addr_t sync_dma; /* DMA address of syncbuf */
unsigned int pipe; /* the data i/o pipe */ unsigned int pipe; /* the data i/o pipe */
unsigned int framesize[2]; /* small/large frame sizes in samples */ unsigned int packsize[2]; /* small/large packet sizes in samples */
unsigned int sample_rem; /* remainder from division fs/fps */ unsigned int sample_rem; /* remainder from division fs/pps */
unsigned int sample_accum; /* sample accumulator */ unsigned int sample_accum; /* sample accumulator */
unsigned int fps; /* frames per second */ unsigned int pps; /* packets per second */
unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */ unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */
unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */ unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */
int freqshift; /* how much to shift the feedback value to get Q16.16 */ int freqshift; /* how much to shift the feedback value to get Q16.16 */
......
...@@ -159,11 +159,11 @@ int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep) ...@@ -159,11 +159,11 @@ int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep)
return ep->maxframesize; return ep->maxframesize;
ep->sample_accum += ep->sample_rem; ep->sample_accum += ep->sample_rem;
if (ep->sample_accum >= ep->fps) { if (ep->sample_accum >= ep->pps) {
ep->sample_accum -= ep->fps; ep->sample_accum -= ep->pps;
ret = ep->framesize[1]; ret = ep->packsize[1];
} else { } else {
ret = ep->framesize[0]; ret = ep->packsize[0];
} }
return ret; return ret;
...@@ -1088,16 +1088,15 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, ...@@ -1088,16 +1088,15 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_FULL) { if (snd_usb_get_speed(ep->chip->dev) == USB_SPEED_FULL) {
ep->freqn = get_usb_full_speed_rate(rate); ep->freqn = get_usb_full_speed_rate(rate);
ep->fps = 1000; ep->pps = 1000 >> ep->datainterval;
} else { } else {
ep->freqn = get_usb_high_speed_rate(rate); ep->freqn = get_usb_high_speed_rate(rate);
ep->fps = 8000; ep->pps = 8000 >> ep->datainterval;
} }
ep->fps >>= ep->datainterval;
ep->sample_rem = rate % ep->fps; ep->sample_rem = rate % ep->pps;
ep->framesize[0] = rate / ep->fps; ep->packsize[0] = rate / ep->pps;
ep->framesize[1] = (rate + (ep->fps - 1)) / ep->fps; ep->packsize[1] = (rate + (ep->pps - 1)) / ep->pps;
/* calculate the frequency in 16.16 format */ /* calculate the frequency in 16.16 format */
ep->freqm = ep->freqn; ep->freqm = ep->freqn;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment