~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/usb/6fire/pcm.h

Version: ~ [ linux-5.5-rc7 ] ~ [ linux-5.4.13 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.97 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.166 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.210 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.210 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.81 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Linux driver for TerraTec DMX 6Fire USB
  3  *
  4  * Author:      Torsten Schenk <torsten.schenk@zoho.com>
  5  * Created:     Jan 01, 2011
  6  * Copyright:   (C) Torsten Schenk
  7  *
  8  * This program is free software; you can redistribute it and/or modify
  9  * it under the terms of the GNU General Public License as published by
 10  * the Free Software Foundation; either version 2 of the License, or
 11  * (at your option) any later version.
 12  */
 13 
 14 #ifndef USB6FIRE_PCM_H
 15 #define USB6FIRE_PCM_H
 16 
 17 #include <sound/pcm.h>
 18 #include <linux/mutex.h>
 19 
 20 #include "common.h"
 21 
 22 enum /* settings for pcm */
 23 {
 24         /* maximum of EP_W_MAX_PACKET_SIZE[] (see firmware.c) */
 25         PCM_N_URBS = 16, PCM_N_PACKETS_PER_URB = 8, PCM_MAX_PACKET_SIZE = 604
 26 };
 27 
 28 struct pcm_urb {
 29         struct sfire_chip *chip;
 30 
 31         /* BEGIN DO NOT SEPARATE */
 32         struct urb instance;
 33         struct usb_iso_packet_descriptor packets[PCM_N_PACKETS_PER_URB];
 34         /* END DO NOT SEPARATE */
 35         u8 buffer[PCM_N_PACKETS_PER_URB * PCM_MAX_PACKET_SIZE];
 36 
 37         struct pcm_urb *peer;
 38 };
 39 
 40 struct pcm_substream {
 41         spinlock_t lock;
 42         struct snd_pcm_substream *instance;
 43 
 44         bool active;
 45 
 46         snd_pcm_uframes_t dma_off; /* current position in alsa dma_area */
 47         snd_pcm_uframes_t period_off; /* current position in current period */
 48 };
 49 
 50 struct pcm_runtime {
 51         struct sfire_chip *chip;
 52         struct snd_pcm *instance;
 53 
 54         struct pcm_substream playback;
 55         struct pcm_substream capture;
 56         bool panic; /* if set driver won't do anymore pcm on device */
 57 
 58         struct pcm_urb in_urbs[PCM_N_URBS];
 59         struct pcm_urb out_urbs[PCM_N_URBS];
 60         int in_packet_size;
 61         int out_packet_size;
 62         int in_n_analog; /* number of analog channels soundcard sends */
 63         int out_n_analog; /* number of analog channels soundcard receives */
 64 
 65         struct mutex stream_mutex;
 66         u8 stream_state; /* one of STREAM_XXX (pcm.c) */
 67         u8 rate; /* one of PCM_RATE_XXX */
 68         wait_queue_head_t stream_wait_queue;
 69         bool stream_wait_cond;
 70 };
 71 
 72 int __devinit usb6fire_pcm_init(struct sfire_chip *chip);
 73 void usb6fire_pcm_abort(struct sfire_chip *chip);
 74 void usb6fire_pcm_destroy(struct sfire_chip *chip);
 75 #endif /* USB6FIRE_PCM_H */
 76 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp