diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-04-18 07:57:32 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-04-18 07:57:32 +0200 |
commit | 56599bb0208fa0ae6e58d3c304a851149973e48d (patch) | |
tree | b3d500ae4415ef2f8e931af9f995f522c6623c4a /sound/usb/stream.c | |
parent | 7536c301f8817214629e80fa06b5b5c93df3ad52 (diff) | |
parent | 22026c1a7be900cc6dabd6be37a77bb217d2d837 (diff) |
Merge branch 'topic/usb-endpoint' into topic/misc
Diffstat (limited to 'sound/usb/stream.c')
-rw-r--r-- | sound/usb/stream.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 5ff8010b2d6..6b7d7a2b7ba 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -73,6 +73,31 @@ static void snd_usb_audio_pcm_free(struct snd_pcm *pcm) } } +/* + * initialize the substream instance. + */ + +static void snd_usb_init_substream(struct snd_usb_stream *as, + int stream, + struct audioformat *fp) +{ + struct snd_usb_substream *subs = &as->substream[stream]; + + INIT_LIST_HEAD(&subs->fmt_list); + spin_lock_init(&subs->lock); + + subs->stream = as; + subs->direction = stream; + subs->dev = as->chip->dev; + subs->txfr_quirk = as->chip->txfr_quirk; + + snd_usb_set_pcm_ops(as->pcm, stream); + + list_add_tail(&fp->list, &subs->fmt_list); + subs->formats |= fp->formats; + subs->num_formats++; + subs->fmt_type = fp->fmt_type; +} /* * add this endpoint to the chip instance. @@ -94,9 +119,9 @@ int snd_usb_add_audio_stream(struct snd_usb_audio *chip, if (as->fmt_type != fp->fmt_type) continue; subs = &as->substream[stream]; - if (!subs->endpoint) + if (!subs->data_endpoint) continue; - if (subs->endpoint == fp->endpoint) { + if (subs->data_endpoint->ep_num == fp->endpoint) { list_add_tail(&fp->list, &subs->fmt_list); subs->num_formats++; subs->formats |= fp->formats; @@ -109,7 +134,7 @@ int snd_usb_add_audio_stream(struct snd_usb_audio *chip, if (as->fmt_type != fp->fmt_type) continue; subs = &as->substream[stream]; - if (subs->endpoint) + if (subs->data_endpoint) continue; err = snd_pcm_new_stream(as->pcm, stream, 1); if (err < 0) |