diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-03 09:10:23 -0700 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-03 09:10:23 -0700 | 
| commit | 9992ba72327fa0d8bdc9fb624e80f5cce338a711 (patch) | |
| tree | e0bf31ae53cb19c44674df7e0d0343a26037ad34 /sound/usb/format.c | |
| parent | 00fdffb5131125dce0702bf61e24a806ec3aed80 (diff) | |
| parent | 4ca231b2e6ed171107c5b21f9e92d1965fd6fd9e (diff) | |
| download | olio-linux-3.10-9992ba72327fa0d8bdc9fb624e80f5cce338a711.tar.xz olio-linux-3.10-9992ba72327fa0d8bdc9fb624e80f5cce338a711.zip  | |
Merge tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai:
 "Mostly many small changes spread as seen in diffstat in sound/*
  directory by this update.  A significant change in the subsystem level
  is the introduction of snd_soc_component, which will help more generic
  handling of SoC and off-SoC components.
  Also, snd_BUG_ON() macro is enabled unconditionally now due to its
  misuses, so people might hit kernel warnings (it's a good thing for
  us).
   - compress-offload: support for capture by Charles Keepax
   - HD-audio: codec delay support by Dylan Reid
   - HD-audio: improvements/fixes in generic parser: better headphone
     mic and headset mic support, jack_modes hint consolidation, proper
     beep attach/detachment, generalized power filter controls by David
     Henningsson, et al
   - HD-audio: Improved management of HDMI codec pins/converters
   - HD-audio: Better pin/DAC assignment for VIA codecs
   - HD-audio: Haswell HDMI workarounds
   - HD-audio: ALC268 codec support, a few new quirks for Chromebooks
   - USB: regression fixes: USB-MIDI autopm fix, the recent ISO latency
     fix by Clemens Ladisch
   - USB: support for DSD formats by Daniel Mack
   - USB: A few UAC2 device endian/cock fixes by Eldad Zack
   - USB: quirks for Emu 192kHz support, Novation Twitch DJ controller,
     Yamaha THRxx devices
   - HDSPM: updates for TCO controls by Adrian Knoth
   - ASoC: Add a snd_soc_component object type for generic handling of
     SoC and off-SoC components by Kuninori Morimoto,
   - dmaengine: a large set of cleanups and conversions by Lars-Peter
     Clausen
   - ASoC DAPM: performance optimizations from Ryo Tsutsui
   - ASoC DAPM: support for mixer control sharing by Stephen Warren
   - ASoC: multiplatform ARM cleanups from Arnd Bergmann
   - ASoC: new codec drivers for AK5385 and TAS5086 from Daniel Mack"
* tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (315 commits)
  ALSA: usb-audio: caiaq: fix endianness bug in snd_usb_caiaq_maschine_dispatch
  ALSA: asihpi: add format support check in snd_card_asihpi_capture_formats
  ALSA: pcm_format_to_bits strong-typed conversion
  ALSA: compress: fix the states to check for allowing read
  ALSA: hda - Move Thinkpad X220 to use auto parser
  ALSA: USB: adjust for changed 3.8 USB API
  ALSA: usb - Avoid unnecessary sample rate changes on USB 2.0 clock sources
  sound: oss/dmabuf: use dma_map_single
  ALSA: ali5451: use mdelay instead of large udelay constants
  ALSA: hda - Add the support for ALC286 codec
  ALSA: usb-audio: USB quirk for Yamaha THR10C
  ALSA: usb-audio: USB quirk for Yamaha THR5A
  ALSA: usb-audio: USB quirk for Yamaha THR10
  ALSA: usb-audio: Fix autopm error during probing
  ALSA: snd-usb: try harder to find USB_DT_CS_ENDPOINT
  ALSA: sound kconfig typo
  ALSA: emu10k1: Fix dock firmware loading
  ASoC: ux500: forward declare msp_i2s_platform_data
  ASoC: davinci-mcasp: Add Support BCLK-to-LRCLK ratio for TDM modes
  ASoC: davinci-pcm, davinci-mcasp: Clean up active_serializers
  ...
Diffstat (limited to 'sound/usb/format.c')
| -rw-r--r-- | sound/usb/format.c | 30 | 
1 files changed, 19 insertions, 11 deletions
diff --git a/sound/usb/format.c b/sound/usb/format.c index e831ee4238b..99299ffb33a 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c @@ -43,11 +43,11 @@   */  static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,  				     struct audioformat *fp, -				     int format, void *_fmt, +				     unsigned int format, void *_fmt,  				     int protocol)  {  	int sample_width, sample_bytes; -	u64 pcm_formats; +	u64 pcm_formats = 0;  	switch (protocol) {  	case UAC_VERSION_1: @@ -63,14 +63,17 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,  		struct uac_format_type_i_ext_descriptor *fmt = _fmt;  		sample_width = fmt->bBitResolution;  		sample_bytes = fmt->bSubslotSize; + +		if (format & UAC2_FORMAT_TYPE_I_RAW_DATA) +			pcm_formats |= SNDRV_PCM_FMTBIT_SPECIAL; +  		format <<= 1;  		break;  	}  	} -	pcm_formats = 0; - -	if (format == 0 || format == (1 << UAC_FORMAT_TYPE_I_UNDEFINED)) { +	if ((pcm_formats == 0) && +	    (format == 0 || format == (1 << UAC_FORMAT_TYPE_I_UNDEFINED))) {  		/* some devices don't define this correctly... */  		snd_printdd(KERN_INFO "%d:%u:%d : format type 0 is detected, processed as PCM\n",  			    chip->dev->devnum, fp->iface, fp->altsetting); @@ -133,6 +136,9 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,  		snd_printk(KERN_INFO "%d:%u:%d : unsupported format bits %#x\n",  			   chip->dev->devnum, fp->iface, fp->altsetting, format);  	} + +	pcm_formats |= snd_usb_interface_dsd_format_quirks(chip, fp, sample_bytes); +  	return pcm_formats;  } @@ -277,7 +283,7 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,  	struct usb_device *dev = chip->dev;  	unsigned char tmp[2], *data;  	int nr_triplets, data_size, ret = 0; -	int clock = snd_usb_clock_find_source(chip, fp->clock); +	int clock = snd_usb_clock_find_source(chip, fp->clock, false);  	if (clock < 0) {  		snd_printk(KERN_ERR "%s(): unable to find clock source (clock %d)\n", @@ -353,13 +359,14 @@ err:   * parse the format type I and III descriptors   */  static int parse_audio_format_i(struct snd_usb_audio *chip, -				struct audioformat *fp, int format, +				struct audioformat *fp, unsigned int format,  				struct uac_format_type_i_continuous_descriptor *fmt,  				struct usb_host_interface *iface)  {  	struct usb_interface_descriptor *altsd = get_iface_desc(iface);  	int protocol = altsd->bInterfaceProtocol; -	int pcm_format, ret; +	snd_pcm_format_t pcm_format; +	int ret;  	if (fmt->bFormatType == UAC_FORMAT_TYPE_III) {  		/* FIXME: the format type is really IECxxx @@ -378,7 +385,7 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,  		default:  			pcm_format = SNDRV_PCM_FORMAT_S16_LE;  		} -		fp->formats = 1uLL << pcm_format; +		fp->formats = pcm_format_to_bits(pcm_format);  	} else {  		fp->formats = parse_audio_format_i_type(chip, fp, format,  							fmt, protocol); @@ -473,8 +480,9 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,  	return ret;  } -int snd_usb_parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp, -			       int format, struct uac_format_type_i_continuous_descriptor *fmt, +int snd_usb_parse_audio_format(struct snd_usb_audio *chip, +			       struct audioformat *fp, unsigned int format, +			       struct uac_format_type_i_continuous_descriptor *fmt,  			       int stream, struct usb_host_interface *iface)  {  	int err;  |