diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-03 12:10:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-03 12:10:23 -0400 |
commit | 9992ba72327fa0d8bdc9fb624e80f5cce338a711 (patch) | |
tree | e0bf31ae53cb19c44674df7e0d0343a26037ad34 /sound/soc/soc-compress.c | |
parent | 00fdffb5131125dce0702bf61e24a806ec3aed80 (diff) | |
parent | 4ca231b2e6ed171107c5b21f9e92d1965fd6fd9e (diff) |
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/soc/soc-compress.c')
-rw-r--r-- | sound/soc/soc-compress.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index ed0bfb0ddb96..3853f7eb3f28 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c | |||
@@ -315,7 +315,7 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream, | |||
315 | } | 315 | } |
316 | 316 | ||
317 | static int soc_compr_copy(struct snd_compr_stream *cstream, | 317 | static int soc_compr_copy(struct snd_compr_stream *cstream, |
318 | const char __user *buf, size_t count) | 318 | char __user *buf, size_t count) |
319 | { | 319 | { |
320 | struct snd_soc_pcm_runtime *rtd = cstream->private_data; | 320 | struct snd_soc_pcm_runtime *rtd = cstream->private_data; |
321 | struct snd_soc_platform *platform = rtd->platform; | 321 | struct snd_soc_platform *platform = rtd->platform; |
@@ -330,11 +330,38 @@ static int soc_compr_copy(struct snd_compr_stream *cstream, | |||
330 | return ret; | 330 | return ret; |
331 | } | 331 | } |
332 | 332 | ||
333 | static int sst_compr_set_metadata(struct snd_compr_stream *cstream, | ||
334 | struct snd_compr_metadata *metadata) | ||
335 | { | ||
336 | struct snd_soc_pcm_runtime *rtd = cstream->private_data; | ||
337 | struct snd_soc_platform *platform = rtd->platform; | ||
338 | int ret = 0; | ||
339 | |||
340 | if (platform->driver->compr_ops && platform->driver->compr_ops->set_metadata) | ||
341 | ret = platform->driver->compr_ops->set_metadata(cstream, metadata); | ||
342 | |||
343 | return ret; | ||
344 | } | ||
345 | |||
346 | static int sst_compr_get_metadata(struct snd_compr_stream *cstream, | ||
347 | struct snd_compr_metadata *metadata) | ||
348 | { | ||
349 | struct snd_soc_pcm_runtime *rtd = cstream->private_data; | ||
350 | struct snd_soc_platform *platform = rtd->platform; | ||
351 | int ret = 0; | ||
352 | |||
353 | if (platform->driver->compr_ops && platform->driver->compr_ops->get_metadata) | ||
354 | ret = platform->driver->compr_ops->get_metadata(cstream, metadata); | ||
355 | |||
356 | return ret; | ||
357 | } | ||
333 | /* ASoC Compress operations */ | 358 | /* ASoC Compress operations */ |
334 | static struct snd_compr_ops soc_compr_ops = { | 359 | static struct snd_compr_ops soc_compr_ops = { |
335 | .open = soc_compr_open, | 360 | .open = soc_compr_open, |
336 | .free = soc_compr_free, | 361 | .free = soc_compr_free, |
337 | .set_params = soc_compr_set_params, | 362 | .set_params = soc_compr_set_params, |
363 | .set_metadata = sst_compr_set_metadata, | ||
364 | .get_metadata = sst_compr_get_metadata, | ||
338 | .get_params = soc_compr_get_params, | 365 | .get_params = soc_compr_get_params, |
339 | .trigger = soc_compr_trigger, | 366 | .trigger = soc_compr_trigger, |
340 | .pointer = soc_compr_pointer, | 367 | .pointer = soc_compr_pointer, |
@@ -357,7 +384,14 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) | |||
357 | /* check client and interface hw capabilities */ | 384 | /* check client and interface hw capabilities */ |
358 | snprintf(new_name, sizeof(new_name), "%s %s-%d", | 385 | snprintf(new_name, sizeof(new_name), "%s %s-%d", |
359 | rtd->dai_link->stream_name, codec_dai->name, num); | 386 | rtd->dai_link->stream_name, codec_dai->name, num); |
360 | direction = SND_COMPRESS_PLAYBACK; | 387 | |
388 | if (codec_dai->driver->playback.channels_min) | ||
389 | direction = SND_COMPRESS_PLAYBACK; | ||
390 | else if (codec_dai->driver->capture.channels_min) | ||
391 | direction = SND_COMPRESS_CAPTURE; | ||
392 | else | ||
393 | return -EINVAL; | ||
394 | |||
361 | compr = kzalloc(sizeof(*compr), GFP_KERNEL); | 395 | compr = kzalloc(sizeof(*compr), GFP_KERNEL); |
362 | if (compr == NULL) { | 396 | if (compr == NULL) { |
363 | snd_printk(KERN_ERR "Cannot allocate compr\n"); | 397 | snd_printk(KERN_ERR "Cannot allocate compr\n"); |