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

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

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php