diff options
| author | Takashi Iwai <tiwai@suse.de> | 2015-01-28 11:32:22 -0500 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2015-01-28 11:33:49 -0500 |
| commit | 5da7f924a41949797875c98a776dca1737a0f372 (patch) | |
| tree | 79aa90f25c9c4e0ded24787f5ece6be019e8b03e | |
| parent | ba6211a2e8f80eecdf12f7972045ea28f904a4a0 (diff) | |
ALSA: usx2y: Move UAPI definition into include/uapi/sound/usb_stream.h
The user-space API definition for usb_stream stuff should be moved
to include/uapi/sound to be exposed publicly.
While we're at it, add the missing ifdef guard for double inclusion,
too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
| -rw-r--r-- | include/uapi/sound/usb_stream.h | 76 | ||||
| -rw-r--r-- | sound/usb/usx2y/usb_stream.h | 78 |
2 files changed, 80 insertions, 74 deletions
diff --git a/include/uapi/sound/usb_stream.h b/include/uapi/sound/usb_stream.h new file mode 100644 index 000000000000..cfe8fba00714 --- /dev/null +++ b/include/uapi/sound/usb_stream.h | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de> | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms of the GNU General Public License as published by the | ||
| 6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 7 | * option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but | ||
| 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
| 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 12 | * for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software Foundation, | ||
| 16 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef _UAPI__SOUND_USB_STREAM_H | ||
| 20 | #define _UAPI__SOUND_USB_STREAM_H | ||
| 21 | |||
| 22 | #define USB_STREAM_INTERFACE_VERSION 2 | ||
| 23 | |||
| 24 | #define SNDRV_USB_STREAM_IOCTL_SET_PARAMS \ | ||
| 25 | _IOW('H', 0x90, struct usb_stream_config) | ||
| 26 | |||
| 27 | struct usb_stream_packet { | ||
| 28 | unsigned offset; | ||
| 29 | unsigned length; | ||
| 30 | }; | ||
| 31 | |||
| 32 | |||
| 33 | struct usb_stream_config { | ||
| 34 | unsigned version; | ||
| 35 | unsigned sample_rate; | ||
| 36 | unsigned period_frames; | ||
| 37 | unsigned frame_size; | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct usb_stream { | ||
| 41 | struct usb_stream_config cfg; | ||
| 42 | unsigned read_size; | ||
| 43 | unsigned write_size; | ||
| 44 | |||
| 45 | int period_size; | ||
| 46 | |||
| 47 | unsigned state; | ||
| 48 | |||
| 49 | int idle_insize; | ||
| 50 | int idle_outsize; | ||
| 51 | int sync_packet; | ||
| 52 | unsigned insize_done; | ||
| 53 | unsigned periods_done; | ||
| 54 | unsigned periods_polled; | ||
| 55 | |||
| 56 | struct usb_stream_packet outpacket[2]; | ||
| 57 | unsigned inpackets; | ||
| 58 | unsigned inpacket_head; | ||
| 59 | unsigned inpacket_split; | ||
| 60 | unsigned inpacket_split_at; | ||
| 61 | unsigned next_inpacket_split; | ||
| 62 | unsigned next_inpacket_split_at; | ||
| 63 | struct usb_stream_packet inpacket[0]; | ||
| 64 | }; | ||
| 65 | |||
| 66 | enum usb_stream_state { | ||
| 67 | usb_stream_invalid, | ||
| 68 | usb_stream_stopped, | ||
| 69 | usb_stream_sync0, | ||
| 70 | usb_stream_sync1, | ||
| 71 | usb_stream_ready, | ||
| 72 | usb_stream_running, | ||
| 73 | usb_stream_xrun, | ||
| 74 | }; | ||
| 75 | |||
| 76 | #endif /* _UAPI__SOUND_USB_STREAM_H */ | ||
diff --git a/sound/usb/usx2y/usb_stream.h b/sound/usb/usx2y/usb_stream.h index 4dd74ab1e9cc..90369001eab6 100644 --- a/sound/usb/usx2y/usb_stream.h +++ b/sound/usb/usx2y/usb_stream.h | |||
| @@ -1,76 +1,7 @@ | |||
| 1 | /* | 1 | #ifndef __USB_STREAM_H |
| 2 | * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de> | 2 | #define __USB_STREAM_H |
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms of the GNU General Public License as published by the | ||
| 6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 7 | * option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but | ||
| 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
| 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 12 | * for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software Foundation, | ||
| 16 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 17 | */ | ||
| 18 | 3 | ||
| 19 | #define USB_STREAM_INTERFACE_VERSION 2 | 4 | #include <uapi/sound/usb_stream.h> |
| 20 | |||
| 21 | #define SNDRV_USB_STREAM_IOCTL_SET_PARAMS \ | ||
| 22 | _IOW('H', 0x90, struct usb_stream_config) | ||
| 23 | |||
| 24 | struct usb_stream_packet { | ||
| 25 | unsigned offset; | ||
| 26 | unsigned length; | ||
| 27 | }; | ||
| 28 | |||
| 29 | |||
| 30 | struct usb_stream_config { | ||
| 31 | unsigned version; | ||
| 32 | unsigned sample_rate; | ||
| 33 | unsigned period_frames; | ||
| 34 | unsigned frame_size; | ||
| 35 | }; | ||
| 36 | |||
| 37 | struct usb_stream { | ||
| 38 | struct usb_stream_config cfg; | ||
| 39 | unsigned read_size; | ||
| 40 | unsigned write_size; | ||
| 41 | |||
| 42 | int period_size; | ||
| 43 | |||
| 44 | unsigned state; | ||
| 45 | |||
| 46 | int idle_insize; | ||
| 47 | int idle_outsize; | ||
| 48 | int sync_packet; | ||
| 49 | unsigned insize_done; | ||
| 50 | unsigned periods_done; | ||
| 51 | unsigned periods_polled; | ||
| 52 | |||
| 53 | struct usb_stream_packet outpacket[2]; | ||
| 54 | unsigned inpackets; | ||
| 55 | unsigned inpacket_head; | ||
| 56 | unsigned inpacket_split; | ||
| 57 | unsigned inpacket_split_at; | ||
| 58 | unsigned next_inpacket_split; | ||
| 59 | unsigned next_inpacket_split_at; | ||
| 60 | struct usb_stream_packet inpacket[0]; | ||
| 61 | }; | ||
| 62 | |||
| 63 | enum usb_stream_state { | ||
| 64 | usb_stream_invalid, | ||
| 65 | usb_stream_stopped, | ||
| 66 | usb_stream_sync0, | ||
| 67 | usb_stream_sync1, | ||
| 68 | usb_stream_ready, | ||
| 69 | usb_stream_running, | ||
| 70 | usb_stream_xrun, | ||
| 71 | }; | ||
| 72 | |||
| 73 | #if __KERNEL__ | ||
| 74 | 5 | ||
| 75 | #define USB_STREAM_NURBS 4 | 6 | #define USB_STREAM_NURBS 4 |
| 76 | #define USB_STREAM_URBDEPTH 4 | 7 | #define USB_STREAM_URBDEPTH 4 |
| @@ -108,5 +39,4 @@ void usb_stream_free(struct usb_stream_kernel *); | |||
| 108 | int usb_stream_start(struct usb_stream_kernel *); | 39 | int usb_stream_start(struct usb_stream_kernel *); |
| 109 | void usb_stream_stop(struct usb_stream_kernel *); | 40 | void usb_stream_stop(struct usb_stream_kernel *); |
| 110 | 41 | ||
| 111 | 42 | #endif /* __USB_STREAM_H */ | |
| 112 | #endif | ||
