Commit Graph

108 Commits

Author SHA1 Message Date
Mark Brown 2f43a23ab9 Merge remote-tracking branch 'asoc/topic/pcm' into for-tiwai 2014-01-16 12:42:57 +00:00
Lars-Peter Clausen e3a9269f87 ALSA: Add helper function for intersecting two rate masks
A bit of special care is necessary when creating the intersection of two rate
masks. This comes from the special meaning of the SNDRV_PCM_RATE_CONTINUOUS and
SNDRV_PCM_RATE_KNOT bits, which needs special handling when intersecting two
rate masks. SNDRV_PCM_RATE_CONTINUOUS means the hardware supports all rates in a
specific interval. SNDRV_PCM_RATE_KNOT means the hardware supports a set of
discrete rates specified by a list constraint. For all other cases the supported
rates are specified directly in the rate mask.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-14 20:42:34 +00:00
Takashi Iwai 47d98c026e ALSA: Remove memory reservation code from memalloc helper
Nowadays we have CMA for obtaining the contiguous memory pages
efficiently.  Let's kill the old kludge for reserving the memory pages
for large buffers.  It was rarely useful (only for preserving pages
among module reloading or a little help by an early boot scripting),
used only by a couple of drivers, and yet it gives too much ugliness
than its benefit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-09 07:32:10 +01:00
Lars-Peter Clausen e6c2e7eb27 ALSA: Constify the snd_pcm_substream struct ops field
The ops field of the snd_pcm_substream struct is never modified inside the ALSA
core. Making it const allows drivers to declare their snd_pcm_ops struct as
const.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-24 15:41:44 +02:00
Linus Torvalds 9992ba7232 sound updates for v3.10-rc1
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
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRg2bUAAoJEGwxgFQ9KSmksasQAIq1ypbylrLA3vf7PUXmL7Jb
 hMtC5tzasZqJsIZ2fyhiZL8J5yQ78Z5dhjehFWlCbJEaKhsjZVyb67RpuK597b6K
 Ypa30OghbWuCoKjmaXK9AFTuijTxdefmewIJfgwVMYtgA5rBU70qt96NC/b/UQXk
 gEPI740i7EFJL2wfcqRpGoKGO1o80yMuKzIj3gHUZMFHYYhPgvVuGt9cCe3cXwLV
 IBT77PjMoGt1Q7iJQkX4DGlB5n526l1G8a6VptdCou0qyEWfhgSik5I3msNuAXte
 1KYE4zj0Rq4xqN28/D/eAF1o3q+X9aiLttGpG0sJLiwGagdWVFaXLyJDMhZxCbwz
 1F4k+B8UCucojw3HtNzoIQJezoRX2aHMjlAZ50b416hITkg5VQe5+sJBxpjIJo4I
 GSmizUiNahDk9jtI/PEGo7yr8CdRTY3v38mdZRGYxyWgJ1a8sNwQwqUdH6A0D/w6
 3wMp4Y9Zt8AK/kiWLLWvsDVvwRptqplrXistTvv4v2xVJgvU+klDsDpa5Lz7kG7Z
 q43RA4o+yWdG6d1hTgMXp7FGwUkcer7WKWEmAZsQmX03Q0zjZqMhfUwVUtaHIx9c
 6YipHdVMAJ0sz/dYrKnZ92hbZcXNj/A9zfqYWeFlA/18FCO6u4BXODBup8BLwyUm
 hfOv+M/q6haNA98GDHS9
 =sYiI
 -----END PGP SIGNATURE-----

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
  ...
2013-05-03 09:10:23 -07:00
Eldad Zack 74c34ca1cc ALSA: pcm_format_to_bits strong-typed conversion
Add a function to handle conversion from snd_pcm_format_t
to bitwise with proper typing.

Change such conversions to use this function and silence sparse
warnings.

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-29 13:36:15 +02:00
Masanari Iida b23f7a09f9 treewide: Fix typo in printk and comments
Fix typo in printk and comments within various drivers.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-04-24 16:43:00 +02:00
Daniel Mack ef7a4f979b ALSA: add DSD formats
This patch adds two formats for Direct Stream Digital (DSD), a
pulse-density encoding format which is described here:
https://en.wikipedia.org/wiki/Direct_Stream_Digital

DSD operates on 2.8, 5.6 or 11.2MHz sample rates and as a 1-bit
stream.

The two new types added by this patch describe streams that are capable
of handling DSD samples in DOP format as 8-bit or in 16-bit (or at a x8
or x16 data rate, respectively).

DSD itself specifies samples in *bit*, while DOP and ALSA handle them
as *bytes*. Hence, a factor of 8 or 16 has to be applied for the sample
rare configuration, according to the following table:

                                                  configured hardware
        176.4KHz   352.8kHz   705.6KHz     <----       sample rate

8-bit                2.8MHz     5.6MHz
16-bit    2.8Mhz     5.6MHz    11.2MHz

         `-----------------------------'
             actual DSD sample rates

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 10:02:33 +02:00
Yacine Belkadi eb7c06e8e9 ALSA: add/change some comments describing function return values
script/kernel-doc reports the following type of warnings (when run in verbose
mode):

Warning(sound/core/init.c:152): No description found for return value of
'snd_card_create'

To fix that:
- add missing descriptions of function return values
- use "Return:" sections to describe those return values

Along the way:
- complete some descriptions
- fix some typos

Signed-off-by: Yacine Belkadi <yacine.belkadi.1@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-12 08:32:53 +01:00
Pierre-Louis Bossart 4eeaaeaea1 ALSA: core: add hooks for audio timestamps
ALSA did not provide any direct means to infer the audio time for A/V
sync and system/audio time correlations (eg. PulseAudio).
Applications had to track the number of samples read/written and
add/subtract the number of samples queued in the ring buffer.  This
accounting led to small errors, typically several samples, due to the
two-step process.  Computing the audio time in the kernel is more
direct, as all the information is available in the same routines.

Also add new .audio_wallclock routine to enable fine-grain synchronization
between monotonic system time and audio hardware time.
Using the wallclock, if supported in hardware, allows for a
much better sub-microsecond precision and a common drift tracking for
all devices sharing the same wall clock (master clock).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-23 16:13:48 +02:00
Pierre-Louis Bossart 0e8014d772 ALSA: core: keep track of boundary wrap-around
Keep track of boundary crossing when hw_ptr
exceeds boundary limit and wraps-around. This
will help keep track of total number
of frames played/received at the kernel level

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-23 16:13:41 +02:00
Linus Torvalds f5a246eab9 Sound updates for 3.7-rc1
This contains pretty many small commits covering fairly large range of
 files in sound/ directory.  Partly because of additional API support
 and partly because of constantly developed ASoC and ARM stuff.
 
 Some highlights:
 
 - Introduced the helper function and documentation for exposing the
   channel map via control API, as discussed in Plumbers; most of PCI
   drivers are covered, will follow more drivers later
 
 - Most of drivers have been replaced with the new PM callbacks (if
   the bus is supported)
 
 - HD-audio controller got the support of runtime PM and the support of
   D3 clock-stop.  Also changing the power_save option in sysfs kicks
   off immediately to enable / disable the power-save mode.
 
 - Another significant code change in HD-audio is the rewrite of
   firmware loading code.  Other than that, most of changes in HD-audio
   are continued cleanups and standardization for the generic auto
   parser and bug fixes (HBR, device-specific fixups), in addition to
   the support of channel-map API.
 
 - Addition of ASoC bindings for the compressed API, used by the
   mid-x86 drivers.
 
 - Lots of cleanups and API refreshes for ASoC codec drivers and
   DaVinci.
 
 - Conversion of OMAP to dmaengine.
 
 - New machine driver for Wolfson Microelectronics Bells.
 
 - New CODEC driver for Wolfson Microelectronics WM0010.
 
 - Enhancements to the ux500 and wm2000 drivers
 
 - A new driver for DA9055 and the support for regulator bypass mode.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJQcpeWAAoJEGwxgFQ9KSmkpi4P/2etDDz5aEkEHNa1l4xEmFcm
 ymiGTgjaalqpUAVbM/gYx9G59EFMEbzUl1BHAqE5La4wO/v9lNPb+VrdUo+B+NZ7
 WSxIPWcNqdinSuoSqyYPjoPMVnhs3EMtNOqmf4jm1JOvdqA+4rO29xQVAqK/5Gfu
 LpMOyPiRi5ODnbQ1BOIWwpKICioY/mLwGJudK3z0i/fYVA7gLub20f+w+sOjKIA4
 wmwQAMTjAR798Cg/tVy4fQmf4SLw+c2nIgGe/PD+2gVlGXLNKBrJfMonHPTbmwKu
 lmJO/EtnijNOnpbn6up7ryUQ9cSoZAUZOfdIOgmAeQgQ/LWR0f+zf2IQehSPwrul
 g6hqOnQI2DNN7ugT3cYVbYnsh56TjyhnxhhxZgkapqh706QkqHGyKJNMRetzuXmP
 1O//MnZJrFQWd6sOKLlTL2ZzRvnxEJcNVGaE6bbwZTfQMtPeo9l1842uIq1dLUtG
 VxZb/svKUkMXv4is1dwUYUkpDsKxsgMEmabmuovceGf2N7jj/irkXgqxf6LWkaY1
 JQ7ZFWUJyDzEMXRaFfzdGO15T532CfB84wvFX5xoPMwMste2AA7QuybFBVstXhKu
 AtKNDgRJFUTlnLIxydpPBWdWH3UJdEaFwwsSfuNKI8OmmGKhWC/aP83k4hzueu9H
 KYLvY/0ObMSMqiwh/ndQ
 =uNqD
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "This contains pretty many small commits covering fairly large range of
  files in sound/ directory.  Partly because of additional API support
  and partly because of constantly developed ASoC and ARM stuff.

  Some highlights:

   - Introduced the helper function and documentation for exposing the
     channel map via control API, as discussed in Plumbers; most of PCI
     drivers are covered, will follow more drivers later

   - Most of drivers have been replaced with the new PM callbacks (if
     the bus is supported)

   - HD-audio controller got the support of runtime PM and the support
     of D3 clock-stop.  Also changing the power_save option in sysfs
     kicks off immediately to enable / disable the power-save mode.

   - Another significant code change in HD-audio is the rewrite of
     firmware loading code.  Other than that, most of changes in
     HD-audio are continued cleanups and standardization for the generic
     auto parser and bug fixes (HBR, device-specific fixups), in
     addition to the support of channel-map API.

   - Addition of ASoC bindings for the compressed API, used by the
     mid-x86 drivers.

   - Lots of cleanups and API refreshes for ASoC codec drivers and
     DaVinci.

   - Conversion of OMAP to dmaengine.

   - New machine driver for Wolfson Microelectronics Bells.

   - New CODEC driver for Wolfson Microelectronics WM0010.

   - Enhancements to the ux500 and wm2000 drivers

   - A new driver for DA9055 and the support for regulator bypass mode."

Fix up various arm soc header file reorg conflicts.

* tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (339 commits)
  ALSA: hda - Add new codec ALC283 ALC290 support
  ALSA: hda - avoid unneccesary indices on "Headphone Jack" controls
  ALSA: hda - fix indices on boost volume on Conexant
  ALSA: aloop - add locking to timer access
  ALSA: hda - Fix hang caused by race during suspend.
  sound: Remove unnecessary semicolon
  ALSA: hda/realtek - Fix detection of ALC271X codec
  ALSA: hda - Add inverted internal mic quirk for Lenovo IdeaPad U310
  ALSA: hda - make Realtek/Sigmatel/Conexant use the generic unsol event
  ALSA: hda - make a generic unsol event handler
  ASoC: codecs: Add DA9055 codec driver
  ASoC: eukrea-tlv320: Convert it to platform driver
  ALSA: ASoC: add DT bindings for CS4271
  ASoC: wm_hubs: Ensure volume updates are handled during class W startup
  ASoC: wm5110: Adding missing volume update bits
  ASoC: wm5110: Add OUT3R support
  ASoC: wm5110: Add AEC loopback support
  ASoC: wm5110: Rename EPOUT to HPOUT3
  ASoC: arizona: Add more clock rates
  ASoC: arizona: Add more DSP options for mixer input muxes
  ...
2012-10-09 07:07:14 +09:00
David Howells a1ce39288e UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers
Convert #include "..." to #include <path/...> in kernel system headers.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Dave Jones <davej@redhat.com>
2012-10-02 18:01:25 +01:00
Takashi Iwai 9d069dc00b ALSA: Make snd_sgbuf_get_{ptr|addr}() available for non-SG cases
Passing struct snd_dma_buffer pointer instead, so that they work no
matter whether real SG buffer is used or not.

This is a preliminary work for the HD-audio DSP loader code.

Signed-off-by: Ian Minett <ian_minett@creativelabs.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-23 11:24:42 +02:00
Takashi Iwai 2d3391ec0e ALSA: PCM: channel mapping API implementation
This patch implements the basic data types for the standard channel
mapping API handling.

- The definitions of the channel positions and the new TLV types are
  added in sound/asound.h and sound/tlv.h, so that they can be
  referred from user-space.

- Introduced a new helper function snd_pcm_add_chmap_ctls() to create
  control elements representing the channel maps for each PCM
  (sub)stream.

- Some standard pre-defined channel maps are provided for
  convenience.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:01:16 +02:00
Randy Dunlap 8513915acc ALSA: fix pcm.h kernel-doc warning and notation
Fix kernel-doc warning in <sound/pcm.h> and add function name to make
the kernel-doc notation complete.

Warning(include/sound/pcm.h:1081): No description found for parameter 'substream'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 10:26:47 +02:00
Takashi Iwai 4609ed6b1f ASoC: Updates for 3.6
This has been a pretty quiet release - very little activity in framework
 terms, mostly just a few new drivers and updates:
 
 - Added the ability to add and remove DAPM paths dynamically, mostly for
   reparenting on clock changes.
 - New machine drivers for Marvell Brownstone, ST-Ericsson Ux500
   reference platform and ttc-dkp.
 - New CPU drivers for Blackfin BF6xx SPORTs in I2S mode, Marvell MMP,
   Synopsis Designware I2S controllers, and SPEAr DMA and S/PDIF
 - New CODEC drivers for Dialog DA732x, ST STA529, ST-Ericsson AB8500, TI
   Isabelle and Wolfson Microelectronics WM5102 and WM5110
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQByjoAAoJEBus8iNuMP3dRJEP/jCQWuIu1ELlcK31zyJOY9n+
 Lp5tB7fG8KkUyYkSOyH0ZHszUr3mH1+/U67JooVmQNm3ml9aWISIQ+W62KKyK2x5
 k0Oe+EOypRWQs7QOXjupgzmGgd/OJa2jIliJJ4/rB4k8/QJW9f0lf23K4lxd0dU1
 guZhjvpj/1NjeSoSKWf52+sA4rKZ/4i+h5kQJZ6bgDgVtbtS6MqxYc1za/mZU2/h
 TpTh1F2vCH9JS9KFiITx8JJBCkZ9QjtrFUwPjkHkjx+r5FMmoHMoQHCTlDiR5JBN
 O6SMk4Dw7c8olM/vGXLY3XHqmj+FG0WkAXTLkWVt8XaUGA2uaZ6KYmYlVYOuCujv
 7YeWyia0heXbU71NtTaYuGMYPt9Jv8hDez4CQceWz69Ep5VhpRMlpQuWtPPKEnbp
 SE91gFtxC0Fqhak8OIvXLzuB650aNInaffihOPZNV7aDdrN84OZL6tP2X/jlVHuU
 X34e0msuFyyMNMPPL/ttQD3m8LiEKAqa86s5Mo2gOyXWNA37hzv1qqbbHYtw01H8
 TeAj1nt8bPJTUOxbAddYcF7UpIt3D5KW5Q89A5E7Nk69PacddPfA5f06XewOG9Uf
 X8MjdSr2l55s1JokZRIjHdFAo7xn9iUd8NOY9iviZqiZYnlRJ1IEedjvjwzf1eOQ
 3t+N1HF7KNR3J3cG+uoi
 =JHE2
 -----END PGP SIGNATURE-----

Merge tag 'asoc-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Updates for 3.6

This has been a pretty quiet release - very little activity in framework
terms, mostly just a few new drivers and updates:

- Added the ability to add and remove DAPM paths dynamically, mostly for
  reparenting on clock changes.
- New machine drivers for Marvell Brownstone, ST-Ericsson Ux500
  reference platform and ttc-dkp.
- New CPU drivers for Blackfin BF6xx SPORTs in I2S mode, Marvell MMP,
  Synopsis Designware I2S controllers, and SPEAr DMA and S/PDIF
- New CODEC drivers for Dialog DA732x, ST STA529, ST-Ericsson AB8500, TI
  Isabelle and Wolfson Microelectronics WM5102 and WM5110
2012-07-19 08:03:20 +02:00
Mark Brown 1464189f8c ALSA: pcm: Make constraints lists const
They aren't modified by the core so the drivers can declare them const.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-05 14:19:39 +02:00
Dimitris Papastamos 4be77a530b ALSA: pcm: Add snd_pcm_rate_bit_to_rate()
This is essentially the reverse of snd_pcm_rate_to_rate_bit().

This is generally useful as the Compress API uses the rate bit
directly and it helps to be able to map back to the actual sample
rate.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-18 09:38:58 +02:00
Ola Lilja 1aad779fcc ALSA: pcm: Add debug-print helper function
Adds a function getting the stream-name as a string for
a specific stream.

Signed-off-by: Ola Lilja <ola.o.lilja@stericsson.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:06:38 +01:00
Takashi Iwai cb3f2adc03 Merge branch 'topic/asoc' into for-linus 2012-03-18 18:22:37 +01:00
Mark Brown 4af87a939e ALSA: pcm: Constify the list in snd_pcm_hw_constraint_list
Allows the constraint lists to be declared const by drivers which seems
reasonable; there's plenty of other constification we could do if we were
being complete but this was easy and quick.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-15 07:35:17 +01:00
Liam Girdwood 945e503845 ALSA: PCM - Add PCM creation API for internal PCMs.
The new ASoC dynamic PCM core needs to create PCMs and substreams that are
for use by internal ASoC drivers only and not visible to userspace for
direct IO. These new PCMs are similar to regular PCMs expect they have no
device nodes or procfs entries. The ASoC component drivers use them in exactly
the same way as regular PCMs for PCM and DAI operations.

The intention is that a dynamic PCM based driver will register both regular
PCMs and internal PCMs. The regular PCMs will be used for all IO with userspace
however the internal PCMs will be used by the driver to route digital audio
through numerous back end DAI links (with potentially a DSP providing different
hw_params, DAI formats based on the regular front end PCM params) to devices
like CODECs, MODEMs, Bluetooth, FM, DMICs, etc

This patch adds a new snd_pcm_new_internal() API call to create the internal PCM
without device nodes or procfs. It also adds adds a new internal flag to snd_pcm.

[fixed minor coding-style issues by tiwai]

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-02-09 09:20:22 +01:00
Linus Torvalds 68d99b2c8e Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (549 commits)
  ALSA: hda - Fix ADC input-amp handling for Cx20549 codec
  ALSA: hda - Keep EAPD turned on for old Conexant chips
  ALSA: hda/realtek - Fix missing volume controls with ALC260
  ASoC: wm8940: Properly set codec->dapm.bias_level
  ALSA: hda - Fix pin-config for ASUS W90V
  ALSA: hda - Fix surround/CLFE headphone and speaker pins order
  ALSA: hda - Fix typo
  ALSA: Update the sound git tree URL
  ALSA: HDA: Add new revision for ALC662
  ASoC: max98095: Convert codec->hw_write to snd_soc_write
  ASoC: keep pointer to resource so it can be freed
  ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
  ASoC: wm8996: Fix wrong mask for setting WM8996_AIF_CLOCKING_2
  ASoC: da7210: Add support for line out and DAC
  ASoC: da7210: Add support for DAPM
  ALSA: hda/realtek - Fix DAC assignments of multiple speakers
  ASoC: Use SGTL5000_LINREG_VDDD_MASK instead of hardcoded mask value
  ASoC: Set sgtl5000->ldo in ldo_regulator_register
  ASoC: wm8996: Use SND_SOC_DAPM_AIF_OUT for AIF2 Capture
  ASoC: wm8994: Use SND_SOC_DAPM_AIF_OUT for AIF3 Capture
  ...
2011-10-28 14:25:01 -07:00
Takashi Iwai d226657022 Merge branch 'topic/misc' into for-linus 2011-10-26 23:51:43 +02:00
Takashi Iwai 18a2b96233 ALSA: pcm - Export snd_pcm_lib_default_mmap() helper
Export the default mmap function, snd_pcm_lib_default_mmap().
The upcoming non-snooping support in HD-audio driver will use this
to override the mmap method.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-28 17:15:14 +02:00
Clemens Ladisch d5b702a64b ALSA: pcm: add snd_pcm_hw_rule_noresample()
Add a helper function to allow drivers to disable hardware resampling
when the application has specified the SNDRV_PCM_HW_PARAMS_NORESAMPLE
flag.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-20 08:56:45 +02:00
Jean Pihet cc74998618 PM QoS: Minor clean-ups
- Misc fixes to improve code readability:
  * rename struct pm_qos_request_list to struct pm_qos_request,
  * rename pm_qos_req parameter to req in internal code,
    consistenly use req in the API parameters,
  * update the in-kernel API callers to the new parameters names,
  * rename of fields names (requests, list, node, constraints)

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Acked-by: markgross <markgross@thegnar.org>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25 15:35:12 +02:00
Jean Pihet e8db0be124 PM QoS: Move and rename the implementation files
The PM QoS implementation files are better named
kernel/power/qos.c and include/linux/pm_qos.h.

The PM QoS support is compiled under the CONFIG_PM option.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Acked-by: markgross <markgross@thegnar.org>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25 15:35:03 +02:00
Takashi Iwai b51beb756a ALSA: Make pcm.h self-contained
Move the macros depending on snd_mask_min() and co out of pcm.h into
pcm_params.h.  Otherwise using some params_*() macros will give comiple
errors without inclusion of pcm_params.h.

Also use hw_param_interval_c() and hw_param_mask_c() for const pointer.

Reported-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-26 17:21:24 +02:00
Eliot Blennerhassett acb03d440b ALSA: Make snd_pcm_debug_name usable outside pcm_lib
Formatting a PCM name is useful for module debug too.
Add snd_prefix when making function public.

[minor coding-style fixes by tiwai]

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-24 13:34:32 +02:00
Benjamin Herrenschmidt 3674f19dab ALSA: vmalloc buffers should use normal mmap
It's a big no-no to use pgprot_noncached() when mmap'ing such buffers
into userspace since they are mapped cachable in kernel space.

This can cause all sort of interesting things ranging from to garbled
sound to lockups on various architectures. I've observed that usb-audio
is broken on powerpc 4xx for example because of that.

Also remove the now unused snd_pcm_lib_mmap_noncached(). It's
an arch business to know when to use uncached mappings, there's
already hacks for MIPS inside snd_pcm_default_mmap() and other
archs are supposed to use dma_mmap_coherent().

(See my separate patch that adds dma_mmap_coherent() to powerpc)

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-25 11:13:12 +01:00
Clemens Ladisch fea952e5cc ALSA: core: sparse cleanups
Change the core code where sparse complains.  In most cases, this means
just adding annotations to confirm that we indeed want to do the dirty
things we're doing.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-14 17:10:11 +01:00
Clemens Ladisch ab69a4904b ALSA: pcm: support for period wakeup disabling
This patch allows to disable period interrupts which are
not needed when the application relies on a system timer
to wake-up and refill the ring buffer. The behavior of
the driver is left unchanged, and interrupts are only
disabled if the application requests this configuration.
The behavior in case of underruns is slightly different,
instead of being detected during the period interrupts the
underruns are detected when the application calls
snd_pcm_update_avail, which in turns forces a refresh of the
hw pointer and shows the buffer is empty.

More specifically this patch makes a lot of sense when
PulseAudio relies on timer-based scheduling to access audio
devices such as HDAudio or Intel SST. Disabling interrupts
removes two unwanted wake-ups due to period elapsed events
in low-power playback modes. It also simplifies PulseAudio
voice modules used for speech calls.

To quote Lennart "This patch looks very interesting and
desirable. This is something have long been waiting for."

Support for this in hardware drivers is optional.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-22 08:13:16 +01:00
Jaroslav Kysela bd76af0f87 ALSA: pcm midlevel code - add time check for double interrupt acknowledge
The current code in pcm_lib.c do all checks using only the position
in the ring buffer. Unfortunately, where the interrupts gets delayed or
merged into one, we need another timing source to check when the
buffer size boundary overlaps to avoid the wrong updating of the
ring buffer pointers.

This code uses jiffies to check the right time window without any
performance impact.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-18 15:18:02 +02:00
Linus Torvalds faa38b5e0e Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (214 commits)
  ALSA: hda - Add pin-fix for HP dc5750
  ALSA: als4000: Fix potentially invalid DMA mode setup
  ALSA: als4000: enable burst mode
  ALSA: hda - Fix initial capsrc selection in patch_alc269()
  ASoC: TWL4030: Capture route runtime DAPM ordering fix
  ALSA: hda - Add PC-beep whitelist for an Intel board
  ALSA: hda - More relax for pending period handling
  ALSA: hda - Define AC_FMT_* constants
  ALSA: hda - Fix beep frequency on IDT 92HD73xx and 92HD71Bxx codecs
  ALSA: hda - Add support for HDMI HBR passthrough
  ALSA: hda - Set Stream Type in Stream Format according to AES0
  ALSA: hda - Fix Thinkpad X300 so SPDIF is not exposed
  ALSA: hda - FIX to not expose SPDIF on Thinkpad X301, since it does not have the ability to use SPDIF
  ASoC: wm9081: fix resource reclaim in wm9081_register error path
  ASoC: wm8978: fix a memory leak if a wm8978_register fail
  ASoC: wm8974: fix a memory leak if another WM8974 is registered
  ASoC: wm8961: fix resource reclaim in wm8961_register error path
  ASoC: wm8955: fix resource reclaim in wm8955_register error path
  ASoC: wm8940: fix a memory leak if wm8940_register return error
  ASoC: wm8904: fix resource reclaim in wm8904_register error path
  ...
2010-08-07 17:07:31 -07:00
James Bottomley 82f682514a pm_qos: Get rid of the allocation in pm_qos_add_request()
All current users of pm_qos_add_request() have the ability to supply
the memory required by the pm_qos routines, so make them do this and
eliminate the kmalloc() with pm_qos_add_request().  This has the
double benefit of making the call never fail and allowing it to be
called from atomic context.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: mark gross <markgross@thegnar.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-07-19 02:00:34 +02:00
Takashi Iwai 65ee2ba310 Merge branch 'devel' of git://git.alsa-project.org/alsa-kernel into topic/misc 2010-07-05 15:37:27 +02:00
David Dillow 5daeba34d2 ALSA: pcm_lib: avoid timing jitter in snd_pcm_read/write()
When using poll() to wait for the next period -- or avail_min samples --
one gets a consistent delay for each system call that is usually just a
little short of the selected period time. However, When using
snd_pcm_read/write(), one gets a jittery delay that alternates between
less than a millisecond and approximately two period times. This is
caused by snd_pcm_lib_{read,write}1() transferring any available samples
to the user's buffer and adjusting the application pointer prior to
sleeping to the end of the current period. When the next period
interrupt occurs, there is then less than avail_min samples remaining to
be transferred in the period, so we end up sleeping until a second
period occurs.

This is solved by using runtime->twake as the number of samples needed
for a wakeup in addition to selecting the proper wait queue to wake in
snd_pcm_update_state(). This requires twake to be non-zero when used
by snd_pcm_lib_{read,write}1() even if avail_min is zero.

Signed-off-by: Dave Dillow <dave@thedillows.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-06-28 09:42:09 +02:00
Ben Collins 15c0cee6c8 ALSA: pcm: Define G723 3-bit and 5-bit formats
This defines the 24bps and 40bps (8khz sample rate) G.723 codec
formats. They are going to be used once I submit the driver for
an mpeg4/g723 compression card.

I've updated the signed value to -1 as per Takashi's comments
since these are non-linear formats.

Signed-off-by: Ben Collins <bcollins@bluecherry.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-31 09:10:03 +02:00
Mark Gross ed77134bfc PM QOS update
This patch changes the string based list management to a handle base
implementation to help with the hot path use of pm-qos, it also renames
much of the API to use "request" as opposed to "requirement" that was
used in the initial implementation.  I did this because request more
accurately represents what it actually does.

Also, I added a string based ABI for users wanting to use a string
interface.  So if the user writes 0xDDDDDDDD formatted hex it will be
accepted by the interface.  (someone asked me for it and I don't think
it hurts anything.)

This patch updates some documentation input I got from Randy.

Signed-off-by: markgross <mgross@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-05-10 23:08:19 +02:00
Takashi Iwai d0d2c38e39 Merge remote branch 'alsa/devel' into topic/misc 2010-01-26 18:13:04 +01:00
Jaroslav Kysela e763692578 ALSA: pcm_lib - return back hw_ptr_interrupt
Clemens Ladisch noted for hw_ptr_removal in "cleanup & merge hw_ptr
update functions" commit:

"It is possible for the status/delay ioctls to be called when the sound
card's pointer register alreay shows a position at the beginning of the
new period, but immediately before the interrupt is actually executed.
(This happens regularly on a SMP machine with mplayer.)  When that
happens, the code thinks that the position must be at least one period
ahead of the current position and drops an entire buffer of data."

Return back the hw_ptr_interrupt variable. The last interrupt pointer
is always computed from the latest hw_ptr instead of tracking it
separately (in this case all hw_ptr checks and modifications might
influence also hw_ptr_interrupt and it is difficult to keep it
consistent).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-26 17:50:50 +01:00
Takashi Iwai 6250b9ced2 Merge branch 'topic/noncached-mmap' into topic/misc 2010-01-21 15:27:28 +01:00
Takashi Iwai 8b296c8f9f Merge remote branch 'alsa/devel' into topic/misc 2010-01-21 14:27:14 +01:00
Jaroslav Kysela c91a988dc6 ALSA: pcm_core: Fix wake_up() optimization
This change fixes the "ALSA: pcm_lib - optimize wake_up() calls for PCM I/O"
commit. New sleeping queue is introduced to separate user space and kernel
space wake_ups. runtime->nowake is renamed to twake (transfer wake).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-21 10:32:15 +01:00
Takashi Iwai c32d977b81 ALSA: pcm - Call pgprot_noncached() for vmalloc'ed buffers
pgprot_noncached() can be set for vmalloc'ed buffers safely, and we'd
need non-cached behavior more or less, even for the intermediate ring-
buffers.

Now snd_pcm_lib_mmap_vmalloc() is added as the common PCM mmap callback
that is coupled with snd_pcm_lib_alloc_vmalloc_buffer() & co.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-18 15:00:34 +01:00
Takashi Iwai a29fb94ff4 Merge commit alsa/devel into topic/misc
Conflicts:
	include/sound/version.h
2010-01-12 09:40:08 +01:00
Jaroslav Kysela 1250932e48 ALSA: pcm_lib - optimize wake_up() calls for PCM I/O
As noted by pl bossart <bossart.nospam@gmail.com>, the PCM I/O routines
(snd_pcm_lib_write1, snd_pcm_lib_read1) should block wake_up() calls
until all samples are not processed.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-07 15:48:13 +01:00
Jaroslav Kysela f240406bab ALSA: pcm_lib - cleanup & merge hw_ptr update functions
Do general cleanup in snd_pcm_update_hw_ptr*() routines and merge them.
The main change is hw_ptr_interrupt variable removal to simplify code
logic. This variable can be computed directly from hw_ptr.

Ensure that updated hw_ptr is not lower than previous one (it was possible
with old code in some obscure situations when interrupt was delayed or
the lowlevel driver returns wrong ring buffer position value).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-07 15:47:38 +01:00