#ifndef __USBAUDIO_H1#define __USBAUDIO_H2/*3* (Tentative) USB Audio Driver for ALSA4*5* Copyright (c) 2002 by Takashi Iwai <[email protected]>6*7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*/2223/* handling of USB vendor/product ID pairs as 32-bit numbers */24#define USB_ID(vendor, product) (((vendor) << 16) | (product))25#define USB_ID_VENDOR(id) ((id) >> 16)26#define USB_ID_PRODUCT(id) ((u16)(id))2728/*29*30*/3132struct snd_usb_audio {33int index;34struct usb_device *dev;35struct snd_card *card;36struct usb_interface *pm_intf;37u32 usb_id;38struct mutex shutdown_mutex;39unsigned int shutdown:1;40unsigned int probing:1;41unsigned int autosuspended:1;42unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */4344int num_interfaces;45int num_suspended_intf;4647struct list_head pcm_list; /* list of pcm streams */48int pcm_devs;4950struct list_head midi_list; /* list of midi interfaces */5152struct list_head mixer_list; /* list of mixer interfaces */5354int setup; /* from the 'device_setup' module param */55int nrpacks; /* from the 'nrpacks' module param */56int async_unlink; /* from the 'async_unlink' module param */5758struct usb_host_interface *ctrl_intf; /* the audio control interface */59};6061/*62* Information about devices with broken descriptors63*/6465/* special values for .ifnum */66#define QUIRK_NO_INTERFACE -267#define QUIRK_ANY_INTERFACE -16869enum quirk_type {70QUIRK_IGNORE_INTERFACE,71QUIRK_COMPOSITE,72QUIRK_MIDI_STANDARD_INTERFACE,73QUIRK_MIDI_FIXED_ENDPOINT,74QUIRK_MIDI_YAMAHA,75QUIRK_MIDI_MIDIMAN,76QUIRK_MIDI_NOVATION,77QUIRK_MIDI_RAW_BYTES,78QUIRK_MIDI_EMAGIC,79QUIRK_MIDI_CME,80QUIRK_MIDI_AKAI,81QUIRK_MIDI_US122L,82QUIRK_AUDIO_STANDARD_INTERFACE,83QUIRK_AUDIO_FIXED_ENDPOINT,84QUIRK_AUDIO_EDIROL_UAXX,85QUIRK_AUDIO_ALIGN_TRANSFER,86QUIRK_AUDIO_STANDARD_MIXER,8788QUIRK_TYPE_COUNT89};9091struct snd_usb_audio_quirk {92const char *vendor_name;93const char *product_name;94int16_t ifnum;95uint16_t type;96const void *data;97};9899#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8))100#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))101#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))102103#endif /* __USBAUDIO_H */104105106