Commit graph

1025 commits

Author SHA1 Message Date
Mark Brown 7887ab3a27 ASoC: Allow GPIO jack detection to be configured as a wake source
Some systems wish to use jacks as wake sources. Provide a wake flag in the
GPIO configuration which causes the driver to enable the IRQ as a wake
source.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-02-18 09:14:14 -08:00
Andreas Mohr 03c2d87a21 ALSA: ac97: replace open-coded, error-prone stuff with AC97 bit defines
Use AC97 macros (sometimes already existing, or newly added)
instead of error-prone repetition of open-coded values.

Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-17 18:39:25 +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
Mark Brown f98dedcefd Merge branch 'for-2.6.38' into for-2.6.39 2011-02-13 19:51:04 +00:00
Stephen Warren 28d639f7bd ASoC: WM8903: Fix mic detection register definitions
* There is no hysteresis enable field in the current datasheet.
* Mic detection threshold field is only 2 bits wide.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-13 19:38:06 +00:00
Vinod Koul fa9879edeb ASoC: add support for multiple jack types
This patch adds soc-jack support for adding voltage zones and for
detecting jack type

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-09 23:02:43 +00:00
Alexander Sverdlin a98a0bc6c9 ASoC: CS4271: Move Chip Select control out of the CODEC code.
Move Chip Select control out of the CODEC code for CS4271.

Signed-off-by: Alexander Sverdlin <subaparts@yandex.ru>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-02-08 11:26:14 +00:00
Mark Brown dddf3e4c25 ASoC: Add card driver data
Provide driver data for cards within the card structure. To simplify the
implementation of the PM operations we don't use the struct device driver
data as this is used by the core to retrieve the card in callbacks from
the device model and PM core.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-28 13:20:47 +00:00
Jaroslav Kysela ea18e137ba ALSA: Release v1.0.24
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-27 13:10:36 +01:00
Mark Brown f85a9e0d26 ASoC: Add subsequence information to seq_notify callbacks
Allows drivers to distinguish which subsequence is being notified when
they get called back.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-27 11:59:14 +00:00
Mark Brown aaee8ef146 ASoC: Make cache status available via debugfs
Could just as well live in sysfs but sysfs doesn't have the simple
value export helpers debugfs does.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-27 11:57:01 +00:00
Mark Brown 6f8ab4ac29 ASoC: Export card PM callbacks for use in direct registered cards
Allow hookup of cards registered directly with the core to the PM
operations by exporting the device power management operations to
modules, also exporting the default PM operations since it is
expected that most cards will end up using exactly the same setup.

Note that the callbacks require that the driver data for the card be
the snd_soc_card.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-27 11:56:34 +00:00
Mark Brown e7361ec499 ASoC: Replace pdev with card in machine driver probe and remove
In order to support cards instantiated without using soc-audio remove
the use of the platform device in the card probe() and remove() ops.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-27 11:56:13 +00:00
Mark Brown 70b2ac126a ASoC: Use card rather than soc-audio device to card PM functions
The platform device for the card is tied closely to the soc-audio
implementation which we're currently trying to remove in favour of
allowing cards to have their own devices. Begin removing it by
replacing it with the card in the suspend and resume callbacks we
give to cards, also taking the opportunity to remove the legacy
suspend types which are currently hard coded anyway.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-27 11:55:53 +00:00
Adrian Knoth 55a57606b2 ALSA: [hdspm] Move static mapping arrays to .c
As requested by Takashi and Jaroslav, these arrays should not be in the
header file.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-27 12:09:23 +01:00
Adrian Knoth 0dca179306 ALSA: hdspm - Add support for RME RayDAT and AIO
Incorporate changes by Florian Faber into hdspm.c. Code taken from

   http://wiki.linuxproaudio.org/index.php/Driver:hdspe

Heavily reworked to mostly comply with the coding standard (whitespace
fixes, line width, C++ style comments)

The code was tested and confirmed to be working on RME RayDAT.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-27 12:09:18 +01:00
Kuninori Morimoto f17c13ca52 ASoC: sh: fsi: modify selection method of I2S/PCM/SPDIF format
Current format selection of FSI-codecs depended on platform information for FSI,
and chip default settings for codecs. It is not understandable/formal method.
This patch modify FSI and FSI-codecs to use snd_soc_dai_set_fmt.

But FSI can use I2S/PCM and SPDIF format today.
It can be selected to I2S/PCM by snd_soc_dai_set_fmt, but can not select SPDIF.
So, this patch change FSI platform information to have DAI/SPDIF mode.

If platform selects DAI mode (default),
FSI-codecs can select I2S/PCM by snd_soc_dai_set_fmt,
and if it is SPDIF mode, FSI become SPDIF format.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-26 11:25:47 +00:00
Mark Brown 3d23c73fa0 ASoC: Remove controls from sequenced PGA arguments
We have zero users for PGA controls and the core support for them was
removed a while ago so no point in cut'n'pasting them into new macros,
even if it's too much hassle to update the existing ones.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-25 15:13:35 +00:00
Mark Brown 181e055e6b ASoC: Fix type for snd_soc_volatile_register()
We generally refer to registers as unsigned ints (including in the
underlying CODEC driver operation).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-25 14:14:31 +00:00
Kuninori Morimoto 4d805f7b66 ASoC: sh: fsi: Add snd_soc_dai_set_fmt support
This patch add snd_soc_dai_ops :: set_fmt to FSI driver and
select master/slave clock mode by snd_soc_dai_set_fmt on
fsi-xxx.c instead of platform infomation code.
This patch remove fsi_is_master function which is no longer needed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-21 19:01:47 +00:00
Alexander Sverdlin 67b22517d8 ASoC: CS4271 codec support
Added support for CS4271 codec to ASoC.

Signed-off-by: Alexander Sverdlin <subaparts@yandex.ru>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-21 18:30:50 +00:00
Stephen Warren 7cfe56172a ASoC: wm8903: Expose GPIOs through gpiolib
Also, update platform_data GPIO handling to have an explicit "don't
touch this pin" option.

Add #defines for the GPIO pin functions.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-21 18:15:13 +00:00
Dimitris Papastamos dad8e7aeeb ASoC: soc-cache: Introduce the cache_bypass option
This is primarily needed to avoid writing back to the cache
whenever we are syncing the cache with the hardware.  This gives a
performance benefit especially for large register maps.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-20 13:40:30 +00:00
Mark Brown 474b62d6ee ASoC: Provide per widget type callback when executing DAPM sequences
Many modern devices have features such as DC servos which take time to start.
Currently these are handled by per-widget events but this makes it difficult
to paralleise operations on multiple widgets, meaning delays can end up
being needlessly serialised. By providing a callback to drivers when all
widgets of a given type have been handled during a DAPM sequence the core
allows drivers to start operations separately and wait for them to complete
much more simply.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-19 13:02:32 +00:00
Mark Brown 20e4859ded ASoC: Add support for sequencing within
With larger devices there may be many widgets of the same type in series
in an audio path. Allow drivers to specify an additional level of ordering
within each widget type by adding a subsequence number to widgets and then
splitting operations on widgets so that widgets of the same type but
different sequence numbers are processed separately.  A typical example
would be a supply widget which requires that another widget be enabled
to provide power or clocking.

SND_SOC_DAPM_PGA_S() and SND_SOC_DAPM_SUPPLY_S() macros are provided
allowing this to be used with PGAs and supplies as these are the most
commonly affected widgets.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-19 13:02:32 +00:00
Mark Brown a1926d1745 Merge branch 'for-2.6.38' into for-2.6.39 2011-01-19 11:22:54 +00:00
Vinod Koul 70a7ca34db ASoC: soc core allow machine driver to register the card
The machine driver can't register the card directly and need to do this thru
soc-audio device creation

This patch allows the register and unregister card to be directly called by
machine drivers

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-17 13:50:08 +00:00
Hanno Boeck 3e8b3b90fe ALSA: constify functions in ac97
Signed-off-by: Hanno Boeck <hanno@hboeck.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-14 19:14:47 +01:00
Vinod Koul 4e10bda05d ASoC: soc core add inline to handle card list initialzation
Currently the soc_probe initializes the card hence it does the card list
initialzation. But if machines directly register the card they would need to
do these steps, so putting them as inline would save lot of code

This patch adds an inline to do list initialzation

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <harsha.priya@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-13 23:28:01 +00:00
Dimitris Papastamos 1500b7b5ff ASoC: Automatically assign the default readable()/volatile() functions
Ensure that all calls to readable_register()/volatile_register() go via
the snd_soc_codec function pointers.

If the default register access table has been given but no functions
for handling readable()/volatile() registers, use the default ones provided
by soc-cache.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-13 14:17:53 +00:00
Dimitris Papastamos d4754ec91c ASoC: Update users of readable_register()/volatile_register()
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-13 14:17:43 +00:00
Dimitris Papastamos 066d16c3e8 ASoC: soc-cache: Add support for default readable()/volatile() functions
For common scenarios, device drivers can provide a table of all the
registers that are at least either readable/writable/volatile.  The idea
is that if a register lookup fails, all of its read/write/vol members
will be zero and will be treated as default.  This also reduces the
size of the register access array.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-13 14:17:32 +00:00
Takashi Iwai 6db9a0f326 Merge branch 'topic/asoc' into for-linus 2011-01-13 08:37:24 +01:00
Dimitris Papastamos aea170a099 ASoC: soc-cache: Add reg_size as a member to snd_soc_codec
Simplify the use of reg_size, by calculating it once and storing it in
the codec structure for later reference.  The value of reg_size is
reg_cache_size * reg_word_size.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-12 14:55:23 +00:00
Mark Brown 8a9dab1a55 ASoC: Update name of debugfs root symbol to snd_soc_
Everything else is using snd_soc_ so we should use it here too.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-10 22:25:21 +00:00
Stephen Warren faff4bb067 ASoC: Export debugfs root dentry
A couple Tegra ASoC drivers will create debugfs entries. Mark requested
these by under debugfs/asoc/ not just debugfs/. To enable this, export
the dentry representing debugfs/asoc/.

Also, rename debugfs_root -> asoc_debugfs_root now it's exported to
prevent potential symbol name clashes.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-01-10 22:20:04 +00:00
Clemens Ladisch 9600732b6c ALSA: core, oxygen, virtuoso: add an enum control info helper
Introduce the helper function snd_ctl_enum_info() to fill out the
elem_info fields for an enumerated control.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-10 16:46:53 +01:00
Dimitris Papastamos 24ff33ac69 ASoC: soc-dapm: Introduce the new snd_soc_dapm_virt_mux type
This new type is a virtual version of snd_soc_dapm_mux.  It is used
when a backing register value is not necessary for deciding which
input path to connect.  A simple virtual enumeration control e.g.
SOC_DAPM_ENUM_VIRT() can be exposed to userspace which will be used
to choose which path to connect.

The snd_soc_dapm_virt_mux type ensures that during the initial
path setup, the first (which is also the default) input path will
be connected.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-17 17:36:28 +00:00
Mark Brown 97404f2e03 ASoC: Do DAPM control updates in the middle of DAPM sequences
Attempt to minimise audible effects from mixer and mux updates by
implementing the actual register changes between powering down widgets
that have become unused and powering up widgets that are newly used.

This means that we're making the change with the minimum set of widgets
powered, that the input path is connected when we're powering up widgets
(so things like DC offset correction can run with their signal active)
and that we bring things down to cold before switching away.  Since
hardware tends to be designed for the power on/off case more than for
dynamic reconfiguration this should minimise pops and clicks during
reconfiguration while active.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-17 11:18:04 +00:00
Jarkko Nikula 7be31be880 ASoC: Extend DAPM to handle power changes on cross-device paths
Power change event like stream start/stop or kcontrol change in a
cross-device path originates from one device but codec bias and widget power
changes must be populated to another devices on that path as well.

This patch modifies the dapm_power_widgets so that all the widgets on a
sound card are checked for a power change, not just those that are specific
to originating device. Also bias management is extended to check all the
devices. Only exception in bias management are widgetless codecs whose bias
state is changed only if power change is originating from that context.

DAPM context test is added to dapm_seq_run to take care of if power sequence
extends to an another device which requires separate register writes.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-15 18:01:34 +00:00
Jarkko Nikula 97c866defc ASoC: Move widgets from DAPM context to snd_soc_card
Decoupling widgets from DAPM context is required when extending the ASoC
core to cross-device paths. Even the list of widgets are now kept in
struct snd_soc_card, the widget listing in sysfs and debugs remain sorted
per device.

This patch makes possible to build cross-device paths but does not extend
yet the DAPM to handle codec bias and widget power changes of an another
device.

Cross-device paths are registered by listing the widgets from device A in
a map for device B. In case of conflicting widget names between the devices,
a uniform name prefix is needed to separate them. See commit ead9b91
"ASoC: Add optional name_prefix for kcontrol, widget and route names" for
help.

An example below shows a path that connects MONO out of A into Line In of B:

static const struct snd_soc_dapm_route mapA[] = {
	{"MONO", NULL, "DAC"},
};

static const struct snd_soc_dapm_route mapB[] = {
	{"Line In", NULL, "MONO"},
};

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-15 18:01:01 +00:00
Jarkko Nikula 8ddab3f510 ASoC: Move DAPM paths from DAPM context to snd_soc_card
Decoupling DAPM paths from DAPM context is a first prerequisite when
extending ASoC core to cross-device paths. This patch is almost a nullop and
does not allow to construct cross-device setup but the path clean-up part in
dapm_free_widgets is prepared to remove cross-device paths between a device
being removed and others.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-15 18:00:41 +00:00
Mark Brown 656d4b1ede ASoC: Remove unused DAPM_DOUBLE control types
There are no users of these and it's not clear what they would do given
the mono flow modelling which DAPM does. If need arises we can add them
again.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-15 14:18:07 +00:00
Olaya, Margarita d88429a695 ASoC: dapm: Add output driver widget
In some cases it was not possible to follow the appropiate power
ON/OFF sequence like in cases where the PGA needs to be enabled
before the driver and disabled before the PGA for pop reduction.

Add a widget to support output driver (speaker, haptic, vibra, etc)
drivers where power ON/OFF ordering is important.

Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-14 11:12:11 +00:00
Takashi Iwai 354d14b3f5 Merge branch 'topic/workq-update' into topic/misc 2010-12-13 09:29:52 +01:00
Takashi Iwai 20aeeb356b Merge branch 'topic/workq-update' into topic/asoc
Conflicts:
	sound/soc/codecs/wm8350.c
	sound/soc/codecs/wm8753.c
	sound/soc/sh/fsi.c
	sound/soc/soc-core.c
2010-12-13 09:28:43 +01:00
Seungwhan Youn 05d209ad3b ASoC: Remove unnecessary structure definitions
This patch removes some legacy structure definitions which are not using
in current ASoC drivers.

Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-09 11:27:57 +00:00
Dimitris Papastamos 0d735eaa2c ASoC: soc-cache: Add optional cache name member to snd_soc_cache_ops
Added an optional name member to snd_soc_cache_ops to enable more
sensible diagnostic messages during cache init, exit and sync.

Remove redundant newline in source code.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-06 14:13:46 +00:00
Mark Brown 1badabd980 ASoC: Add post-CODEC bias level callback for machine driver
Currently the machine driver can only do bias level configuration before
the CODEC bias level is brought up. This means that the machine cannot do
any configuration which depends on the CODEC bias level being maintained.
Provide a post-CODEC callback which allows the machine driver to do things
like enable the FLL on a CODEC which is brought down to BIAS_OFF when idle.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-06 12:41:30 +00:00
Mark Brown 001ae4c035 ASoC: Constify struct snd_soc_codec_driver
Allow the CODEC driver structure to be marked const by making all
the APIs that use it do so.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-03 16:37:55 +00:00
Dimitris Papastamos fdf0f54dab ASoC: soc-core: Allow machine drivers to override compress_type
This patch allows machine drivers to override the compression type
provided by the codec driver.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-03 16:37:32 +00:00
Dimitris Papastamos 3335ddca93 ASoC: soc-cache: Use reg_def_copy instead of reg_cache_default
Make sure to use codec->reg_def_copy instead of codec_drv->reg_cache_default
wherever necessary.  This change is necessary because in the next patch we
move the cache initialization code outside snd_soc_register_codec() and by that
time any data marked as __devinitconst such as the original reg_cache_default
array might have already been freed by the kernel.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-03 16:37:06 +00:00
Dimitris Papastamos ff819b8357 ASoC: soc-core: Generalize snd_soc_prefix_map and rename to snd_soc_codec_conf
The snd_soc_codec_conf struct now holds codec specific configuration
information.

A new configuration option has been added to allow machine drivers to
override the compression type set by the codec driver.

In the absence of providing an snd_soc_codec_conf struct or when providing
one but not setting the compress_type member to anything, the one supplied
by the codec driver will be used instead.  In all other cases the one
set in the snd_soc_codec_conf struct takes effect.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-03 16:36:45 +00:00
Dimitris Papastamos 119bd789f6 ASoC: Change the base value of compress_type
Ensure that the base value of compress_type starts at 1 so that
we know whether the machine driver has provided a compress_type
for overriding the codec supplied one.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-03 16:36:23 +00:00
Dimitris Papastamos 23bbce34f4 ASoC: Add compress_type as a member to snd_soc_codec
We need to keep a copy of the compress_type supplied by the codec driver
so that we can override it if necessary with whatever the machine driver
has provided us with.  The reason for not modifying the codec->driver
struct directly is that ideally we'd like to keep it const.

Adjust the code in soc-cache and soc-core to make use of the compress_type
member in the snd_soc_codec struct.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-03 16:36:03 +00:00
Mark Brown c3acec2671 ASoC: Move active copy of CODEC read and write into runtime structure
We shouldn't be assigning to the driver structure (which really ought
to be const, further patch to follow) though there's unlikely to be any
actual problem except in the unlikely case that two devices with the
same driver but different bus types appear in the same system.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-03 12:18:17 +00:00
Mark Brown 1ee46ebd04 ASoC: Make the DAI ops constant in the DAI structure
Neither drivers nor the core should be fiddling with the actual ops
structure at runtime.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-03 12:17:43 +00:00
Florian Faber 28b26e1553 ALSA: hdsp - Add support for RPM io box
Add support for the RME HDSP RPM IO box. Changes have been made in the identification of the IO box and the neccessary controls have been added.

Signed-off-by: Florian Faber <faberman@linuxproaudio.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-12-01 12:14:47 +01:00
Jarkko Nikula 2eea392d0a ASoC: Add support for optional auxiliary dailess codecs
This makes possible to register auxiliary dailess codecs in a machine
driver. Term dailess is used here for amplifiers and codecs without DAI or
DAI being unused.

Dailess auxiliary codecs are kept in struct snd_soc_aux_dev and those codecs
are probed after initializing the DAI links. There are no major differences
between DAI link codecs and dailess codecs in ASoC core point of view. DAPM
handles them equally and sysfs and debugfs directories for dailess codecs
are similar except the pmdown_time node is not created.

Only suspend and resume functions are modified to traverse all probed codecs
instead of DAI link codecs.

Example below shows a dailess codec registration.

struct snd_soc_aux_dev foo_aux_dev[] = {
	{
		.name = "Amp",
		.codec_name = "codec.2",
		.init = foo_init2,
	},
};

static struct snd_soc_card card = {
	...
	.aux_dev = foo_aux_dev,
	.num_aux_devs = ARRAY_SIZE(foo_aux_dev),
};

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-30 14:39:00 +00:00
Dimitris Papastamos df0701bb86 ASoC: soc-cache: Ensure consistent cache naming
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-29 12:43:52 +00:00
Kuninori Morimoto d4bc99b977 ARM: mach-shmobile: ap4evb: FSI clock use proper process for HDMI
Current AP4 FSI set_rate function used bogus clock process
which didn't care enable/disable and clk->usecound.
To solve this issue, this patch also modify FSI driver to call
set_rate with enough options.
This patch modify it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-24 15:29:56 +09:00
Kay Sievers 03cfe6f57d ALSA: support module on-demand loading for seq and timer
If CONFIG_SND_DYNAMIC_MINORS is used, assign /dev/snd/seq and
/dev/snd/timer the usual static minors, and export specific
module aliases to generate udev module on-demand loading
instructions:

  $ cat /lib/modules/2.6.33.4-smp/modules.devname
  # Device nodes to trigger on-demand module loading.
  microcode cpu/microcode c10:184
  fuse fuse c10:229
  ppp_generic ppp c108:0
  tun net/tun c10:200
  uinput uinput c10:223
  dm_mod mapper/control c10:236
  snd_timer snd/timer c116:33
  snd_seq snd/seq c116:1

The last two lines instruct udev to create device nodes, even
when the modules are not loaded at that time.

As soon as userspace accesses any of these nodes, the in-kernel
module-loader will load the module, and the device can be used.

The header file minor calculation needed to be simplified to
make __stringify() (supports only two indirections) in
the MODULE_ALIAS macro work.

This is part of systemd's effort to get rid of unconditional
module load instructions and needless init scripts.

Cc: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-24 05:53:25 +01:00
Jarkko Nikula 851cad5aa1 ASoC: Remove cyclic dependency between soc.h and soc-dapm.h/soc-dai.h
There is no need anymore to include soc.h in soc-dapm.h and soc-dai.h as
drivers are converted to include only soc.h.

Thanks to Lars-Peter Clausen <lars@metafoo.de> for pointing out the issue.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-22 14:05:05 +00: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
Jarkko Nikula ead9b9199c ASoC: Add optional name_prefix for codec kcontrol, widget and route names
There is a need to prefix codec kcontrol, widget and internal route names in
an ASoC machine that has multiple codecs with conflicting names. The name
collision would occur when codec drivers try to registering kcontrols with
the same name or when building audio paths.

This patch introduces optional prefix_map into struct snd_soc_card. With it
machine drivers can specify a unique name prefix to each codec that have
conflicting names with anothers. Prefix to codec is matched with codec
name.

Following example illustrates a machine that has two same codec instances.
Name collision from kcontrol registration is avoided by specifying a name
prefix "foo" for the second codec. As the codec widget names are prefixed
then second audio map for that codec shows a prefixed widget name.

static const struct snd_soc_dapm_route map0[] = {
	{"Spk", NULL, "MONO"},
};

static const struct snd_soc_dapm_route map1[] = {
	{"Vibra", NULL, "foo MONO"},
};

static struct snd_soc_prefix_map codec_prefix[] = {
	{
		.dev_name = "codec.2",
		.name_prefix = "foo",
	},
};

static struct snd_soc_card card = {
	...
	.prefix_map = codec_prefix,
	.num_prefixes = ARRAY_SIZE(codec_prefix),
};

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-15 15:24:58 +00:00
Dimitris Papastamos a7f387d5af ASoC: soc-cache: Add support for rbtree based register caching
This patch adds support for rbtree compression when storing the
register cache.  It does this by not adding any uninitialized registers
(those whose value is 0).  If any of those registers is written
with a nonzero value they get added into the rbtree.

Consider a sample device with a large sparse register map.  The
register indices are between [0, 0x31ff].  An array of 12800 registers
is thus created each of which is 2 bytes.  This results in a 25kB
region.  This array normally lives outside soc-core, normally in the
driver itself.  The original soc-core code would kmemdup this region
resulting in 50kB total memory.  When using the rbtree compression
technique and __devinitconst on the original array the figures are
as follows.  For this typical device, you might have 100 initialized
registers, that is registers that are nonzero by default.  We build
an rbtree with 100 nodes, each of which is 24 bytes.  This results
in ~2kB of memory.  Assuming that the target arch can freeup the
memory used by the initial __devinitconst array, we end up using
about ~2kB bytes of actual memory.  The memory footprint will increase
as uninitialized registers get written and thus new nodes created in
the rbtree.  In practice, most of those registers are never changed.
If the target arch can't freeup the __devinitconst array, we end up
using a total of ~27kB.  The difference between the rbtree and the LZO
caching techniques, is that if using the LZO technique the size of
the cache will increase slower as more uninitialized registers get
changed.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-11 15:59:22 +00:00
Dimitris Papastamos cc28fb8e7d ASoC: soc-cache: Add support for LZO register caching
This patch adds support for LZO compression when storing the register
cache.  The initial register defaults cache is marked as __devinitconst
and the only change required for a driver to use LZO compression is
to set the compress_type member in codec->driver to SND_SOC_LZO_COMPRESSION.

For a typical device whose register map would normally occupy 25kB or 50kB
by using the LZO compression technique, one can get down to ~5-7kB.  There
might be a performance penalty associated with each individual read/write
due to decompressing/compressing the underlying cache, however that should not
be noticeable.  These memory benefits depend on whether the target architecture
can get rid of the memory occupied by the original register defaults cache
which is marked as __devinitconst.  Nevertheless there will be some memory
gain even if the target architecture can't get rid of the original register
map, this should be around ~30-32kB instead of 50kB.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-11 15:59:01 +00:00
Dimitris Papastamos 7a30a3db34 ASoC: soc-cache: Add support for flat register caching
This patch introduces the new caching API and migrates the
old caching interface into the new one.  The flat register caching
technique does not use compression at all and it is equivalent to
the old caching technique.  One can still access codec->reg_cache
directly but this is not advised as that will not be portable
across different caching strategies.

None of the existing drivers need to be changed to adapt to this
caching technique.  There should be no noticeable overhead associated
with using the new caching API.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-11 15:58:41 +00:00
Jarkko Nikula 3a45b8672d ASoC: Move pop time from DAPM context to sound card
Based on discussion the dapm_pop_time in debugsfs should be per card rather
than per device. Single pop time value for entire card is cleaner when the
DAPM sequencing is extended to cross-device paths.

debugfs/asoc/{card->name}/{codec dir}/dapm_pop_time
->
debugfs/asoc/{card->name}/dapm_pop_time

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-06 11:28:35 -04:00
Jarkko Nikula a605215494 ASoC: Add sound card directory under debugfs/asoc/
There will be need to have sound card specific debugfs entries. This patch
introduces a new debugfs/asoc/{card->name}/ directory but does not add yet
any entries there.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-06 11:28:35 -04:00
Liam Girdwood ce6120cca2 ASoC: Decouple DAPM from CODECs
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is
required when developing ASoC further. Such as for other ASoC components to
have DAPM widgets or when extending DAPM to handle cross-device paths.

This patch decouples DAPM related variables from struct snd_soc_codec and
moves them to new struct snd_soc_dapm_context that is used to encapsulate
DAPM context of a device. ASoC core and API of DAPM functions are modified
to use DAPM context instead of codec.

This patch does not change current functionality and a large part of changes
come because of structure and internal API changes.

Core implementation is from Liam Girdwood <lrg@slimlogic.co.uk> with some
minor core changes, codecs and machine driver conversions from
Jarkko Nikula <jhnikula@gmail.com>.

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Manuel Lauss <manuel.lauss@googlemail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Cc: Cliff Cai <cliff.cai@analog.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Ryan Mallon <ryan@bluewatersys.com>
Cc: Timur Tabi <timur@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Jassi Brar <jassi.brar@samsung.com>
Cc: Daniel Gloeckner <dg@emlix.com>
Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-06 11:28:29 -04:00
Mark Brown c375370799 ASoC: Push snd_soc_write() and snd_soc_read() into the source file
Facilitating adding trace type stuff. For a first pass add some dev_dbg()
statements into them.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-03 13:41:53 -04:00
Mark Brown 9e3be1edbe Merge branch 'for-2.6.37' into HEAD
WARN() fix from Joe moved.

Conflicts:
	sound/soc/codecs/wm_hubs.c
2010-11-02 09:58:49 -04:00
Mark Brown 6e1bd1ab1d Merge branch 'for-2.6.37' into for-2.6.38 2010-11-01 13:58:18 -04:00
Linus Torvalds 33081adf8b 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: (365 commits)
  ALSA: hda - Disable sticky PCM stream assignment for AD codecs
  ALSA: usb - Creative USB X-Fi volume knob support
  ALSA: ca0106: Use card specific dac id for mute controls.
  ALSA: ca0106: Allow different sound cards to use different SPI channel mappings.
  ALSA: ca0106: Create a nice spot for mapping channels to dacs.
  ALSA: ca0106: Move enabling of front dac out of hardcoded setup sequence.
  ALSA: ca0106: Pull out dac powering routine into separate function.
  ALSA: ca0106 - add Sound Blaster 5.1vx info.
  ASoC: tlv320dac33: Use usleep_range for delays
  ALSA: usb-audio: add Novation Launchpad support
  ALSA: hda - Add workarounds for CT-IBG controllers
  ALSA: hda - Fix wrong TLV mute bit for STAC/IDT codecs
  ASoC: tpa6130a2: Error handling for broken chip
  ASoC: max98088: Staticise m98088_eq_band
  ASoC: soc-core: Fix codec->name memory leak
  ALSA: hda - Apply ideapad quirk to Acer laptops with Cxt5066
  ALSA: hda - Add some workarounds for Creative IBG
  ALSA: hda - Fix wrong SPDIF NID assignment for CA0110
  ALSA: hda - Fix codec rename rules for ALC662-compatible codecs
  ALSA: hda - Add alc_init_jacks() call to other codecs
  ...
2010-10-25 08:32:05 -07:00
Takashi Iwai 506ecbca71 Merge branch 'topic/hda' into for-linus 2010-10-25 10:40:05 +02:00
Takashi Iwai aa5c14d5c0 Merge branch 'topic/asoc' into for-linus
Conflicts:
	arch/powerpc/platforms/85xx/p1022_ds.c
2010-10-25 10:00:30 +02:00
Kay Sievers 39aba963d9 driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices
This patch removes the old CONFIG_SYSFS_DEPRECATED_V2 config option,
but it keeps the logic around to handle block devices in the old manner
as some people like to run new kernel versions on old (pre 2007/2008)
distros.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22 10:16:43 -07:00
Arnaud Patard (Rtp) 6f4bc952c6 ASoC: add support for alc562[123] codecs
This patch is adding support for alc562[123] codecs. It's based
on the source code available in HP source code and other places.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-21 13:51:13 -07:00
Mark Brown e86e1244a4 ASoC: Restore MAX98088 CODEC driver
This reverts commit f6765502f8 and adds
the missing include file.

Signed-off-by: Peter Hsiang <Peter.Hsiang@maxim-ic.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-18 16:46:27 -07:00
Nobuhiro Iwamatsu 83fc3bc095 ALSA: emu10k1: Fix warning: "CCR" redefined
CCR is defined in emu10k1, but SuperH is defined too.
If user use this driver with SuperH, it becomes a double definition.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-18 07:45:44 +02:00
Takashi Iwai c08d91695b ALSA: tlv - Define numbers in sound/tlv.h
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-17 10:46:14 +02:00
Mike Frysinger 363129ea90 ALSA: fix unused warnings with snd_power_get_state
If we compile the ASoC code with PM disabled, we hit stuff like:
sound/soc/soc-dapm.c: In function 'snd_soc_dapm_suspend_check':
sound/soc/soc-dapm.c:440: warning: unused variable 'codec'

So tweak the stub macro to avoid these issues.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-17 10:08:45 +02:00
Mika Westerberg 0562f7882d ASoC: don't register AC97 devices twice
With generic AC97 ASoC glue driver (codec/ac97.c), we get following warning when
the device is registered (slightly stripped the backtrace):

kobject (c5a863e8): tried to init an initialized object, something is seriously
                    wrong.
[<c00254fc>] (unwind_backtrace+0x0/0xec)
[<c014fad0>] (kobject_init+0x38/0x70)
[<c0171e94>] (device_initialize+0x20/0x70)
[<c017267c>] (device_register+0xc/0x18)
[<bf20db70>] (snd_soc_instantiate_cards+0x924/0xacc [snd_soc_core])
[<bf20e0d0>] (snd_soc_register_platform+0x16c/0x198 [snd_soc_core])
[<c0175304>] (platform_drv_probe+0x18/0x1c)
[<c0174454>] (driver_probe_device+0xb0/0x16c)
[<c017456c>] (__driver_attach+0x5c/0x7c)
[<c0173cec>] (bus_for_each_dev+0x48/0x78)
[<c0173600>] (bus_add_driver+0x98/0x214)
[<c0174834>] (driver_register+0xa4/0x130)
[<c001f410>] (do_one_initcall+0xd0/0x1a4)
[<c0062ddc>] (sys_init_module+0x12b0/0x1454)

This happens because the generic AC97 glue driver creates its codec->ac97 via
calling snd_ac97_mixer(). snd_ac97_mixer() provides own version of
snd_device.register which handles the device registration when
snd_card_register() is called.

To avoid registering the AC97 device twice, we add a new flag to the
snd_soc_codec: ac97_created which tells whether the AC97 device was created by
SoC subsystem.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-13 10:35:17 +01:00
Mark Brown 4c14d78e8a ASoC: Use delayed work for debounce of GPIO based jacks
Rather than block the workqueue by sleeping to do the debounce use delayed
work to implement the debounce time. This should also means that we extend
the debounce time on each new bounce, potentially allowing shorter debounce
times for clean insertions.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-07 12:58:56 -07:00
Mark Brown 3367b8d427 ASoC: Add support for WM8962 GPIO outputs
The WM8962 features five GPIOs, add support for controlling their output
state via gpiolib.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-02 14:23:04 -07:00
Mark Brown a4f28c001d ASoC: Provide microphone bias configuration for WM8962
Add the widget for MICBIAS power control and allow configuration of the
microphone bias setup via the platform data for the WM8962. When
microphone status signals are brought out to GPIO this should be
sufficient to enable microphone detection.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-30 09:36:13 -07:00
Mark Brown 45e655047f ASoC: Initial WM8962 IRQ support
Provide an initial hookup for interrupts on the WM8962. Currently we simply
report error status via log messages if an IRQ is provided for the device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-29 00:32:36 -07:00
Mark Brown 831853c87f ALSA: Add more jack button slots
Some devices have more flexible microphone detection and can detect
a wider range of buttons.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-07 08:04:38 +02:00
Mark Brown ea0d09de13 ASoC: Add event variants of the AIF widgets
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-06 11:34:29 +01:00
Kuninori Morimoto 7522948b1b ASoC: fsi: modify compile error
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-31 13:28:13 +01:00
Jarkko Nikula 4e48541676 ASoC: Swap bias level enumeration
Swapping the bias level enumeration is only meant to help debugging. It is
easier if number 0 means bias off and bigger number means bigger bias level.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-31 13:06:40 +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
Jaroslav Kysela 56385a12d9 ALSA: emu10k1 - delay the PCM interrupts (add pcm_irq_delay parameter)
With some hardware combinations, the PCM interrupts are acknowledged
before the period boundary from the emu10k1 chip. The midlevel PCM code
gets confused and the playback stream is interrupted.

It seems that the interrupt processing shift by 2 samples is enough
to fix this issue. This default value does not harm other,
non-affected hardware.

More information: Kernel bugzilla bug#16300

[A copmile warning fixed by tiwai]

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-18 15:10:59 +02:00
Mark Brown e4862f2f6f Merge branch 'for-2.6.36' into for-2.6.37
Fairly simple conflicts, the most serious ones are the i.MX ones which I
suspect now need another rename.

Conflicts:
	arch/arm/mach-mx2/clock_imx27.c
	arch/arm/mach-mx2/devices.c
	arch/arm/mach-omap2/board-rx51-peripherals.c
	arch/arm/mach-omap2/board-zoom2.c
	sound/soc/fsl/mpc5200_dma.c
	sound/soc/fsl/mpc5200_dma.h
	sound/soc/fsl/mpc8610_hpcd.c
	sound/soc/pxa/spitz.c
2010-08-16 18:42:58 +01:00
Sam Ravnborg 60641aa1f3 include: replace unifdef-y with header-y
unifdef-y and header-y has same semantic.
So there is no need to have both.

Drop the unifdef-y variant and sort all lines again

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2010-08-14 22:26:51 +02:00
Mark Brown cf7af01aa7 Merge branch 'topic/multi-component' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into for-2.6.37 2010-08-12 14:40:28 +01:00
Liam Girdwood f0fba2ad1b ASoC: multi-component - ASoC Multi-Component Support
This patch extends the ASoC API to allow sound cards to have more than one
CODEC and more than one platform DMA controller. This is achieved by dividing
some current ASoC structures that contain both driver data and device data into
structures that only either contain device data or driver data. i.e.

 struct snd_soc_codec    --->  struct snd_soc_codec (device data)
                          +->  struct snd_soc_codec_driver (driver data)

 struct snd_soc_platform --->  struct snd_soc_platform (device data)
                          +->  struct snd_soc_platform_driver (driver data)

 struct snd_soc_dai      --->  struct snd_soc_dai (device data)
                          +->  struct snd_soc_dai_driver (driver data)

 struct snd_soc_device   --->  deleted

This now allows ASoC to be more tightly aligned with the Linux driver model and
also means that every ASoC codec, platform and (platform) DAI is a kernel
device. ASoC component private data is now stored as device private data.

The ASoC sound card struct snd_soc_card has also been updated to store lists
of it's components rather than a pointer to a codec and platform. The PCM
runtime struct soc_pcm_runtime now has pointers to all its components.

This patch adds DAPM support for ASoC multi-component and removes struct
snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec
or runtime PCM level basis rather than using snd_soc_socdev.

Other notable multi-component changes:-

 * Stream operations now de-reference less structures.
 * close_delayed work() now runs on a DAI basis rather than looping all DAIs
   in a card.
 * PM suspend()/resume() operations can now handle N CODECs and Platforms
   per sound card.
 * Added soc_bind_dai_link() to bind the component devices to the sound card.
 * Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove
   DAI link components.
 * sysfs entries can now be registered per component per card.
 * snd_soc_new_pcms() functionailty rolled into dai_link_probe().
 * snd_soc_register_codec() now does all the codec list and mutex init.

This patch changes the probe() and remove() of the CODEC drivers as follows:-

 o Make CODEC driver a platform driver
 o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core.
 o Removed all static codec pointers (drivers now support > 1 codec dev)
 o snd_soc_register_pcms() now done by core.
 o snd_soc_register_dai() folded into snd_soc_register_codec().

CS4270 portions:
Acked-by: Timur Tabi <timur@freescale.com>

Some TLV320aic23 and Cirrus platform fixes.
Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>

TI CODEC and OMAP fixes
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>

Samsung platform and misc fixes :-
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>

MPC8610 and PPC fixes.
Signed-off-by: Timur Tabi <timur@freescale.com>

i.MX fixes and some core fixes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

J4740 platform fixes:-
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

CC: Tony Lindgren <tony@atomide.com>
CC: Nicolas Ferre <nicolas.ferre@atmel.com>
CC: Kevin Hilman <khilman@deeprootsystems.com>
CC: Sascha Hauer <s.hauer@pengutronix.de>
CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC: Kuninori Morimoto <morimoto.kuninori@renesas.com>
CC: Daniel Gloeckner <dg@emlix.com>
CC: Manuel Lauss <mano@roarinelk.homelinux.net>
CC: Mike Frysinger <vapier.adi@gmail.com>
CC: Arnaud Patard <apatard@mandriva.com>
CC: Wan ZongShun <mcuos.com@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-12 14:00:00 +01: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
Mark Brown 9a76f1ff6e ASoC: Add initial WM8962 CODEC driver
The WM8962 is a low power, high performance stereo CODEC designed for
portable digital audio applications.

This initial driver release supports the key audio paths of the WM8962.
Extended functionality, such as microphone detection, digital microphones
and the advanced DSP signal enhancements provided by the device are not
yet supported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-05 13:38:57 +01:00
Takashi Iwai 74bf40f079 Merge branch 'topic/misc' into for-linus 2010-08-05 11:17:04 +02:00
Takashi Iwai 988b0dc154 Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc 2010-08-02 12:10:52 +02:00
Kuninori Morimoto 3bc280708e ASoC: fsi: Add new funtion for SPDIF
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-07-29 10:28:49 -07:00
Peter Ujfalusi a577b318fc ASoC: tlv320dac33: Add support for automatic FIFO configuration
Platform parameter to enable automatic FIFO configuration when
the codec is in Mode1 or Mode7 FIFO mode.
When this mode is selected, the controls for changing
nSample (in Mode1), and UTHR (in Mode7) are not added.
The driver configures the FIFO configuration based on
the stream's period size in a way, that every burst will
read period size of data from the host.
In Mode7 we need to use a formula, which gives close enough
aproximation for the burst length from the host point
of view.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-29 10:21:11 +01:00
Peter Ujfalusi f430a27f05 ASoC: tlv320dac33: Revisit the FIFO Mode1 handling
Replace the hardwired latency definition with platform data
parameter, and simplify the nSample parameter calculation.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-29 10:21:04 +01: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
Kuninori Morimoto 3c2ef841c0 ASoC: fsi: Add specified ID for soc-audio
Specified ID is necessary, when some codecs are used with FSI.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-07-17 19:45:56 +01:00
Kuninori Morimoto ccad7b44cc ASoC: fsi: Fixup for master mode
This patch add hw_params to snd_soc_dai_ops,
because board specific set_rate is needed
when FSI was used as master mode.

This patch remove fsi_clk_ctrl from fsi_dai_startup,
because clock should be disabled before set_rate.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-07-13 12:35:39 +01:00
Kuninori Morimoto 095687c48b ASoC: fsi: modify format area definition on flags
There is no necessity that each bit in this area has the meaning.
This patch modify it to sequence number

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-07-13 12:35:35 +01: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
Vladimir Zapolskiy cc3202f5da ASoC: uda134x: replace a macro with a value in platform struct.
This change wipes out a hardcoded macro, which enables codec bias
level control. Now is_powered_on_standby value shall be used instead.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-06-25 12:29:01 +01:00
apatard@mandriva.com ea762b047e ASoC: Add SND_SOC_DAPM_PRE_POST_PMD event
Some systems codecs need to configure some registers before and after
powering down some of their part. As a convenience add a macro for that.

Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-31 12:20:01 +01:00
Mark Brown e37c83c06c Merge commit 'v2.6.35-rc1' into for-2.6.36 2010-05-31 11:07:15 +01: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
Linus Torvalds 7f06a8b26a 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: (250 commits)
  ALSA: hda: Storage class should be before const qualifier
  ASoC: tpa6130a2: Remove CPVSS and HPVdd supplies
  ASoC: tpa6130a2: Define output pins with SND_SOC_DAPM_OUTPUT
  ASoC: sdp4430 - add sdp4430 pcm ops to DAI.
  ASoC: TWL6040: Enable earphone path in codec
  ASoC: SDP4430: Add support for Earphone speaker
  ASoC: SDP4430: Add sdp4430 machine driver
  ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF
  ASoC: tlv320dac33: Use dev_dbg in dac33_hard_power function
  ALSA: sound/pci/asihpi: Use kzalloc
  ALSA: hdmi - dont fail on extra nodes
  ALSA: intelhdmi - add id for the CougarPoint chipset
  ALSA: intelhdmi - user friendly codec name
  ALSA: intelhdmi - add dependency on SND_DYNAMIC_MINORS
  ALSA: asihpi: incorrect range check
  ALSA: asihpi: testing the wrong variable
  ALSA: es1688: add pedantic range checks
  ARM: McBSP: Add support for omap4 in McBSP driver
  ARM: McBSP: Fix request for irq in OMAP4
  OMAP: McBSP: Add 32-bit mode support
  ...
2010-05-20 09:41:44 -07:00
Takashi Iwai d71f4cece4 Merge branch 'topic/asoc' into for-linus
Conflicts:
	sound/soc/codecs/ad1938.c
2010-05-20 12:00:43 +02:00
Takashi Iwai 20406f9b67 Merge branch 'topic/jack' into for-linus 2010-05-20 11:59:37 +02:00
Takashi Iwai 5e8aa85253 Merge branch 'topic/misc' into for-linus 2010-05-20 11:59:29 +02:00
apatard@mandriva.com b6f4bb383d ASoC: Add SOC_DOUBLE_R_SX_TLV control
This patch is adding a new control which has the following capabilities:
- tlv
- variable data size (for instance, 7 ou 8 bit)
- double mixer
- data range centered around 0

Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Acked-by: Liam Girdwood <lrg@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-16 18:04:46 +01:00
Daniel Mack 89485d4931 ALSA: include/sound/asound.h whitespace fixups
This fixes some whitespace/indentation flaws I stumbled over.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-11 22:41:50 +02:00
Peter Ujfalusi d11bb4a925 ASoC: core: Fix for the volume limiting when invert is in use
If the register for the volume needs invert, than the inversion
need to be done from the chip maximum, and not from the platform
dependent limit.
Introduce soc_mixer_control.platform_max value, which initially
equals to chip maximum.
The snd_soc_limit_volume function only modify the platform_max,
all volsw_info call returns this as well.
The .max value holds the chip default (maximum), and it is used
for the inversion, if it is needed.

Additional check in the volsw_info call has been added to check
the validity of the platform_max in case, when custom macros
used by codec drivers are not initializing it correctly.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-11 09:34:11 +01: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
Mark Brown 3efab7dcc0 ASoC: Allow DAI links to be kept active over suspend
As well as allowing DAPM pins to be marked as ignoring suspend allow DAI
links to be similarly marked.  This is primarily intended for digital
links between CODECs and non-CPU devices such as basebands in mobile
phones and will suppress all suspend calls for the DAI link.  It is
likely that this will need to be revisited if used with devices which
are part of the SoC CPU.

Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-10 10:37:13 +01:00
Mark Brown 1547aba993 ASoC: Support leaving paths enabled over system suspend
Some devices can usefully run audio while the Linux system is suspended.
One of the most common examples is smartphone systems, which are normally
designed to allow audio to be run between the baseband and the CODEC
without passing through the CPU and so can suspend the CPU when on a
voice call for additional power savings.

Support such systems by providing an API snd_soc_dapm_ignore_suspend().
This can be used to mark DAPM endpoints as not being sensitive to
system suspend. When the system is being suspended paths between
endpoints which are marked as ignoring suspend will be kept active.
Both source and sink must be marked, and there must already be an
active path between the two endpoints prior to suspend.

When paths are active over suspend the bias management will hold the
device bias in the ON state. This is used to avoid suspending the
CODEC while it is still in use.

Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-10 10:36:48 +01:00
Mark Brown 50ae8384cd ASoC: Remove unused DAPM suspend flag
We now manage suspend within the main power analysis rather than by
flipping the state of widgets.

Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-10 10:35:55 +01:00
Krzysztof Helt a20971b201 ALSA: Merge es1688 and es968 drivers
The ESS ES968 chip is nothing more then a PnP companion
for a non-PnP audio chip. It was paired with non-PnP ESS' chips:
ES688 and ES1688. The ESS' audio chips are handled by the es1688
driver in native mode. The PnP cards are handled by the ES968
driver in SB compatible mode.

Move the ES968 chip handling to the es1688 driver so the driver
can handle both PnP and non-PnP cards. The es968 is removed.

Also, a new PnP id is added for the card I acquired (the change
was tested on this card).

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-10 09:49:30 +02:00
Krzysztof Helt 396fa82726 ALSA: es1688: allocate snd_es1688 structure as a part of snd_card structure
Allocate the snd_es1688 during the snd_card allocation.
This allows to remove the card pointer from the snd_es1688 structure.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-10 09:48:59 +02:00
Peter Ujfalusi 826e962c46 Revert "ASoC: tpa6130a2: Support for limiting gain"
This reverts commit 6f3991152f.

Since core has now support for limiting the volume on controls this
patch is not needed.  Furthermore, this patch actually prevents the core
to set new volume on the TPA.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-07 16:42:23 +01:00
Peter Ujfalusi 637d3847ba ASoC: core: Support for limiting the volume
Add support for the core to limit the maximum volume on an
existing control.
The function will modify the soc_mixer_control.max value
of the given control.
The new value must be lower than the original one (chip maximum)

If there is a need for limiting a gain on a given control,
than machine drivers can do the following in their
snd_soc_dai_link.init function:

snd_soc_limit_volume(codec, "TPA6140A2 Headphone Playback Volume", 21);

This will modify the original 31 (chip maximum) to 21, so user
space will not be able to set the gain higher than this.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-07 16:41:33 +01:00
Takashi Iwai aeb29a82de Merge branch 'for-2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc 2010-05-06 17:06:27 +02:00
Peter Ujfalusi 6f3991152f ASoC: tpa6130a2: Support for limiting gain
Add support for platform dependent gain limiting on the
tpa6130a2 (and tpa6140a2) Headset amplifier.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-06 14:58:20 +01:00
Jarkko Nikula 5193d62f18 ASoC: tlv320aic3x: Add platform data and reset gpio handling
Handle the reset GPIO within the codec driver in order to follow
the startup protocol for the tlv320aic3x codecs.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-06 14:58:02 +01:00
Mark Brown 39b8eab7e7 ASoC: Add WM9090 amplifier driver
The WM9090 is a high performance low power audio subsystem, including
headphone and class D speaker drivers.

Note that this driver is a standalone CODEC driver and so is only
immediately suitable for use with the WM9090 as a standalone sound card
taking line inputs, or with a DAC with no software control.  The pending
ASoC multi-CODEC support will expand the range of systems that can use
the driver, or system-specific adaptations can be made.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-30 16:12:44 +01:00
Vladimir Zapolskiy b28528a124 ASoC: UDA134X: Add UDA1345 CODEC support
This patch adds support for Philips UDA1345 CODEC. The CODEC has only
volume control, de-emphasis, mute, DC filtering and power control features.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-26 15:28:18 +01:00
Mark Brown b2c812e22d ASoC: Add indirection for CODEC private data
One of the features of the multi CODEC work is that it embeds a struct
device in the CODEC to provide diagnostics via a sysfs class rather than
via the device tree, at which point it's much better to use the struct
device private data rather than having two places to store it. Provide
an accessor function to allow this change to be made more easily, and
update all the CODEC drivers are updated.

To ensure use of the accessor the private data structure member is
renamed, meaning that if code developed with older an older core that
still uses private_data is merged it will fail to build.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-17 10:46:22 +09:00
Jaroslav Kysela 0340c7dccd ALSA: Release v1.0.23
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-04-16 13:12:36 +02:00
Takashi Iwai 24e4a1211f ALSA: info - Use standard types for info callbacks
Use loff_t, size_t and ssize_t for arguments of info callbacks
to follow the standard procfs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-13 11:57:14 +02:00
Takashi Iwai 7445c995b0 Merge branch 'fix/asoc' into for-linus 2010-04-07 09:54:41 +02:00
Mark Brown 53a61d967a Merge branch 'for-2.6.34' into for-2.6.35
Conflicts due to context changes next to the backported DMA data change:
	include/sound/soc.h
2010-04-05 19:19:32 +01:00
Daniel Mack 5f712b2b73 ALSA: ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream
This fixes a memory corruption when ASoC devices are used in
full-duplex mode. Specifically for pxa-ssp code, where this pointer
is dynamically allocated for each direction and destroyed upon each
stream start.

All other platforms are fixed blindly, I couldn't even compile-test
them. Sorry for any breakage I may have caused.

[Note that this is a backported version for 2.6.34.
 Upstream commit is fd23b7dee]

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Reported-by: Sven Neumann <s.neumann@raumfeld.com>
Reported-by: Michael Hirsch <m.hirsch@raumfeld.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-05 19:14:11 +01:00
Dan Carpenter f11947c7c5 ALSA: i2c: cleanup: change parameter to pointer
We actually pass an array of 7 chars not 5.
This silences a smatch warning.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-04 12:21:39 +02:00
Mark Brown d5021ec9fc ASoC: Add a notifier for jack status changes
Some systems provide both mechanical and electrical detection of jack
status changes. On such systems power savings can be achieved by only
enabling the electrical detection methods when physical insertion has
been detected.

Begin supporting such systems by providing a notifier for jack status
changes which can be used to trigger any reconfiguration.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-22 17:20:57 +00:00
Daniel Mack fd23b7dee5 ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream
This fixes a memory corruption when ASoC devices are used in
full-duplex mode. Specifically for pxa-ssp code, where this pointer
is dynamically allocated for each direction and destroyed upon each
stream start.

All other platforms are fixed blindly, I couldn't even compile-test
them. Sorry for any breakage I may have caused.

Reported-by: Sven Neumann <s.neumann@raumfeld.com>
Reported-by: Michael Hirsch <m.hirsch@raumfeld.com>
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-03-19 19:37:29 +00:00
Mark Brown a655b96c24 Merge branch 'topic/jack' into for-2.6.35 2010-03-19 12:48:10 +00:00
Mark Brown ebb812cb8d ALSA: Add support for key reporting via the jack interface
Some devices provide support for detection of a small number of
buttons on their jacks. One common implementation provides a single
button, implemented by shorting the microphone to ground and detected
along with microphone presence detection by detecting varying current
draws on the microphone bias signal.

Provide support for up to three buttons via the jack interface. These
default to reporting BTN_n but an API is provided to allow these to
be remapped to other keys by the machine driver where it knows what
the keys are. More keys can be added with ease if required.

This is only intended to support simple accessory button designs. If
the interface is limiting then either creating a child device for the
accessory or accessing the input device in the jack directly is
recommended.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-03-17 18:10:46 +00:00
Mark Brown fbc2dae854 ASoC: Support GPIO based microphone detection for WM8904
The WM8904 allows microphone detection signals to be brought out as
alternate functions of the GPIO signals which can be detected using
interrupt inputs on the CPU. Allow this to be configured using
platform data.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-16 16:03:30 +00:00
Mark Brown cdce4e9ba7 ASoC: Allow configuration of WM8904 GPIO pin functions
Provide platform data allowing the configuration of the GPIO pins
on the WM8904 to be selected, allowing alternate functions to be
enabled.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-16 15:58:08 +00:00
Mark Brown 7245387e36 ASoC: Implement interrupt driven microphone detection for WM8903
Support use of the WM8903 IRQ for reporting of microphone presence
and short detection.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-16 15:57:43 +00:00
Mark Brown 8abd16a65d ASoC: Add WM8903 interrupt support
Currently used to detect completion of the write sequencer.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-16 15:57:15 +00:00
Mark Brown 37f88e8407 ASoC: Initial WM8903 microphone bias and short detection
Provide support for WM8903 microphone presence and short detection
using the GPIOs to route out a logic signal suitable for handling
using snd_soc_jack_add_gpios() on the processor GPIOs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-16 15:56:54 +00:00
Mark Brown 73b34ead74 ASoC: Add GPIO configuration support for WM8903
Allow users to pass in a default configuration for the GPIOs of
the WM8903 as platform data. This allows configuration of the pin
muxing of the device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-16 15:56:34 +00:00
Mark Brown da34183e64 ASoC: Allow pins to be force enabled
Allow pins to be forced on regardless of their power state. This is
intended for use with microphone bias supplies which need to be
enabled in order to support microphone detection - in systems without
appropriate hardware leaving the microphone unbiased when not in use
saves power.

The force done at power check time in order to avoid disrupting other
power detection logic.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-16 15:56:10 +00:00
Mark Brown e82f5cfa63 ASoC: Remove unused 'muted' flag from DAPM widgets
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-16 15:55:48 +00:00
Peter Ujfalusi eeb309a8a6 ASoC: tlv320dac33: Add option for keeping the BCLK running
Platform data option for the codec to keep the BCLK clock
continuously running in FIFO modes (codec master).

OMAP3 McBSP when in slave mode needs continuous BCLK running
on the serial bus in order to operate correctly.

Since in FIFO mode the DAC33 can also shut down the BCLK clock
and enable it only when it is needed, let the platforms decide
if the CPU side needs the BCLK running or not.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-03-12 11:12:25 +00:00
Mark Brown fad837c16c Merge commit 'v2.6.34-rc1' into for-2.6.35 2010-03-10 15:02:37 +00:00
Takashi Iwai a3087ae970 Merge branch 'topic/misc' into for-linus 2010-03-08 09:35:50 +01:00
Mark Brown 1d24452b55 ASoC: Remove unused pmdown_time flag
The flag is no longer used in the code so it just wastes a bit.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-05 16:42:46 +00:00
Jaroslav Kysela b30477d5e2 ALSA: timer - pass real event in snd_timer_notify1() to instance callback
Do not use hardcoded SNDRV_TIMER_EVENT_START value.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-03 22:39:45 +01:00
Mark Brown 913d7b4cc0 ASoC: Add support for WM8960 capless mode
The WM8960 headphone outputs can be run in capless mode with OUT3
used to drive a pseudo ground for the headphone drivers. In this
mode the mono mixer is not used, the mixer should be turned on
in concert with the headphone output drivers and the device bias
levels are managed differently.

Also tweak the existing bias management to remove the use of active
discharge while we're at it since that's often audible.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-03 17:08:43 +00:00
Mark Brown b6877a477d ASoC: Move WM8960 platform data into include/sound
Avoids machine files having to peer into sound/soc which is a bit
rude and icky.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-03 17:08:42 +00:00
Peter Ujfalusi 258020d088 ASoC: core: Add delay operation to snd_soc_dai_ops
The delay callback can be used by the core to query the delay
on the dai caused by FIFO or delay in the platform side.
In case if both CPU and CODEC dai has FIFO the delay reported
by each will be added to form the full delay on the chain.
If none of the dai has FIFO, than the delay will be kept as
zero.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-03-03 17:08:41 +00:00
Takashi Iwai 6679ee1870 Merge branch 'topic/asoc' into for-linus 2010-03-01 12:38:59 +01:00
Jassi Brar 14dc5734bd ASoC: Allow mulitple usage count of codec and cpu dai
If we are to have a snd_soc_dai i.e, cpu_dai and codec_dai, shared among two
or more dai_links we need to log the number of active users of the dai.
For that, we change semantics of the snd_soc_dai.active flag from indicator
to reference counter.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-02-26 11:17:48 +00:00
jassi brar 6423c1875c ASoC: Remove runtime field from DAI
In order for having snd_soc_dais shared among two or more dai_links,
remove the relatively global runtime field from the struct snd_soc_dai

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-02-22 14:15:30 +00:00
jassi brar d273ebe77a ASoC: Pass dai_link as argument to platform suspend and resume
Passing pointer to relevant dai_link provides easier reach to the
ASoC tree in suspend/resume of snd_soc_platform. It also provides
direct access to the dai at the other end of the dai_link.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-02-22 14:14:58 +00:00
Mark Brown 6c5f1fed49 ASoC: Make pmdown_time a long
Fixes a warning.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-02-17 14:37:20 +00:00
Mark Brown 96dd362284 ASoC: Make pmdown_time a per-card setting
Make the pmdown_time a per-card setting rather than a global one,
initialised before the card initialisation runs. This allows cards
to override the default setting if it makes sense to do so (for
example, due to an unavoidable pop).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-02-16 19:14:52 +00:00
Mark Brown 3a66d3877e ASoC: Add WM2000 driver
The WM2000 is a low power, high quality handset receiver speaker
driver with Wolfson myZoneâ„¢ Ambient Noise Cancellation (ANC). It
provides enhanced voice communication quality in a noisy environment
if the handset acoustics are designed appropriately.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-02-12 10:31:06 +00:00
Mark Brown a3032b47c4 ASoC: Add a cache_sync bit to the CODEC structure
Add a bit to the CODEC structure indicating if a cache sync is required.
By default this will be set if a cache only write is done to a soc-cache
register cache.  This allows us to avoid syncing the cache back after
using cache only writes if there were no changes.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-02-04 10:40:45 +00:00
Mark Brown 8c961bcca1 ASoC: Allow CODECs to ask soc-cache to suppress physical writes
Currently the soc-cache code will always write to the device, meaning
that we need the device to be powered and active at pretty much all
times the system is active.  Allowing cache only writes lays some
groundwork for future enhancements to allow devices to be put into a
full off state when the audio subsystem is idle.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-02-03 18:03:37 +00: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
Guennadi Liakhovetski 6c2fb6a8d8 ASoC: add helper macros to declare struct soc_enum instances
Several shortcuts for popular uses of some of SOC_ENUM_* and
SOC_VALUE_ENUM_* macros.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-01-25 14:51:02 +00:00
Guennadi Liakhovetski 8484c63f4b ASoC: add simplified versions of widget macros
Many macros from include/sound/soc-dapm.h take an array and a number of
elements in it as arguments, whereas most users use static arrays and use
"x, ARRAY_SIZE(x)" as arguments. This patch adds simplified versions of
those macros, calling ARRAY_SIZE() internally.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.oc.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-01-25 14:50:45 +00: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
Mark Brown a96ca33873 ASoC: Support turning off bias when the CODEC is idle
Currently ASoC always maintains the bias of the CODEC while the system
is active.  With older mobile CODECs this is required since the outputs
are referenced to a non-zero voltage and enabling or disabling this
voltage without audible pops or clicks in the output takes too long to
do when starting or stopping audio.

As a result of features such as ground referenced outputs and class D
speaker drivers current generation devices are able to power on and off
much more quickly without these system level issues so provide a new
flag idle_bias_off in snd_soc_codec which will cause the core to turn
off the CODEC bias.  The distinction between STANDBY and OFF is still
maintained.  This is partly for consistency but also allows for
potential future extensions such as per-machine overrides or deferring
the bias removal.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-01-21 12:04:08 +00: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
Peter Ujfalusi 6aceabb459 ASoC: tlv320dac33: Burst mode BCLK divider configuration
Add possibility to configure the burst mode BCLK divider through platform
data structure.
The BCLK divider changes the actual speed of the serial bus in burst mode,
which is faster than the sampling frequency of the running stream.
In this way platforms can experiment with the optimal burst speed without
the need to modify the codec driver itself.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-01-20 11:47:49 +00:00
Guennadi Liakhovetski 84740ac19a ASoC: fix compile breakage - add a missing header include
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-01-19 12:36:40 +00: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 d1458279bf ALSA: Add snd_pci_quirk_lookup_id()
Added a new function to look up a quirk entry with the given PCI SSID
instead of a pci device pointer.  This can be used when the searched ID
is overridden for debugging or such a purpose.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-14 09:18:48 +01:00
Mark Brown 163849ea9b Merge branch 'for-2.6.33' into for-2.6.34 2010-01-12 12:59:05 +00:00
Takashi Iwai a29fb94ff4 Merge commit alsa/devel into topic/misc
Conflicts:
	include/sound/version.h
2010-01-12 09:40:08 +01:00
Ilkka Koskinen 2138301e16 ASoC: tpa6130a2: Support for tpa6140's regulators
tpa6140a2 uses different names for the regulators.

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-01-11 17:13:11 +00: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
Jaroslav Kysela 4d96eb255c ALSA: pcm_lib - add possibility to log last 10 DMA ring buffer positions
In some debug cases, it might be usefull to see previous ring buffer
positions to determine position problems from the lowlevel drivers.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-07 15:47:24 +01:00
Jaroslav Kysela 4757968dbf ALSA: Release v1.0.22.1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-12-28 16:17:57 +01:00
Takashi Iwai 41116e926c ALSA: cs46xx - Fix suspend/resume with new DSP
Fix the basic suspend/resume of snd-cs46xx drivers with new DSP.

References:
	https://bugzilla.redhat.com/show_bug.cgi?id=498287
	https://bugzilla.redhat.com/show_bug.cgi?id=160751

Tested-by: Florian Zumbiehl <florz@florz.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-22 09:00:14 +01:00
Krzysztof Helt ad8decb7f5 ALSA: jazz16: Add support for Media Vision Jazz16 chipset
This is one of Sound Blaster Pro compatible chipsets which is supported
by Linux OSS driver and was missing native supoort for ALSA.

The Jazz16 audio codec is Crystal CS4216 which is capable
of playback and recording up to 48 kHz stereo.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-21 12:09:22 +01:00
Mark Brown b35a28af0a ASoC: Add initial WM8955 CODEC driver
The WM8955 is a low power, high quality stereo DAC with integrated
headphone and loudspeaker amplifiers, designed to reduce external
component requirements in portable digital audio applications. This is
an initial driver implementing support for the majority of the
functionality in the device, currently OUT3 is not supported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-12-18 13:06:47 +00:00
Clemens Ladisch 681b84e177 sound: pcm: add vmalloc buffer helper functions
There are now five copies of the code to allocate a PCM buffer using
vmalloc().  Add a sixth in the core so that the others can be removed.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-18 12:54:01 +01:00
Jaroslav Kysela 6c941c8556 ALSA: Release v1.0.22
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-17 12:13:26 +01:00
Jaroslav Kysela 926a01ce1e ALSA: Release v1.0.22
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-12-16 16:19:15 +01:00
Linus Torvalds 4ef58d4e2a Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits)
  tree-wide: fix misspelling of "definition" in comments
  reiserfs: fix misspelling of "journaled"
  doc: Fix a typo in slub.txt.
  inotify: remove superfluous return code check
  hdlc: spelling fix in find_pvc() comment
  doc: fix regulator docs cut-and-pasteism
  mtd: Fix comment in Kconfig
  doc: Fix IRQ chip docs
  tree-wide: fix assorted typos all over the place
  drivers/ata/libata-sff.c: comment spelling fixes
  fix typos/grammos in Documentation/edac.txt
  sysctl: add missing comments
  fs/debugfs/inode.c: fix comment typos
  sgivwfb: Make use of ARRAY_SIZE.
  sky2: fix sky2_link_down copy/paste comment error
  tree-wide: fix typos "couter" -> "counter"
  tree-wide: fix typos "offest" -> "offset"
  fix kerneldoc for set_irq_msi()
  spidev: fix double "of of" in comment
  comment typo fix: sybsystem -> subsystem
  ...
2009-12-09 19:43:33 -08:00
Mark Brown a91eb199e4 ASoC: Initial WM8904 CODEC driver
The WM8904 is a high performance ultra-low power stereo CODEC
optimised for portable audio applications, with features including
a class W amplifier, FLL with free running mode, Mobile ReTune and
ground referenced headphone and line outputs.

Support for some features, most particularly the digital microphone
interface, is not yet present.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-12-04 16:50:53 +00:00
Mark Brown dd1b3d53c2 ASoC: Export snd_soc_update_bits_unlocked()
Allows custom controls to use it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-12-04 16:07:06 +00:00
Takashi Iwai 86e1d57e4f Merge branch 'topic/hda' into for-linus 2009-12-04 16:22:45 +01:00
Takashi Iwai baf9226667 Merge branch 'topic/asoc' into for-linus 2009-12-04 16:22:41 +01:00
Takashi Iwai 57648cd52b Merge branch 'topic/misc' into for-linus 2009-12-04 16:22:37 +01:00
André Goddard Rosa af901ca181 tree-wide: fix assorted typos all over the place
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 15:39:55 +01:00
Jean Delvare 83cf0a9b86 comment typo fix: sybsystem -> subsystem
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 15:39:49 +01:00
Takashi Iwai 75639e7ee1 Merge branch 'topic/beep-rename' into topic/core-change 2009-12-01 15:58:10 +01:00
Takashi Iwai 980f31c46b Merge branch 'topic/ice1724-quartet' into topic/hda 2009-12-01 15:57:01 +01:00
Mark Brown c0fa59df72 ASoC: Add BCLK calculation utility for TDM mode too
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-11-25 19:55:46 +00:00
Krzysztof Helt 9dc9120c77 ALSA: opti-miro: expose ACI mixer to outside drivers
The ACI mixer is used to control the radio FM module
installed on the Miro PCM20 sound card. Expose ACI mixer
outside the sound card driver.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-23 09:41:55 +01:00
Krzysztof Helt 9aeba62971 ALSA: opti-miro: make miro.h header available outside the alsa directory
Move the miro.h header to the include/sound directory. It can
be used in the Miro PCM20 radio driver (v4l).

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-23 09:41:46 +01:00
Krzysztof Helt b753e03e5e ALSA: cs4236: update control names
Update control names to be more closer to their meaning.
Change the "Mono" name to the "Beep" as this line is usually
used to forward the PC beeper signal to sound card's output.
Update names for both cs423x and wss.

Clean up cs4235 controls according to the cs4235 doc. Rename
some of the cs4235 controls to be consistent with the cs4236's
ones.

Also, delete one misnamed cs4231 register define.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-18 07:23:16 +01:00
Joonyoung Shim c871a05315 ASoC: Add jack_status_check callback function for GPIO jacks
The jack_status_check callback function is the interface to check the
status of the jack. Some target provides the method to distinguish what
is the jack inserted - headphone jack, microphone jack, tvout jack, etc,
so we can implement it using the jack_status_check function.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-11-12 16:45:53 +00:00
Mark Brown 7aae816dae ASoC: Add bit clock rate calculator utility functions
Many devices need to calculate the bit clock rate desired to
work out the clock configuration required for the device.
Provide utility functions to do this using both hw_params
structures and raw numbers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2009-11-12 16:45:48 +00:00
Clemens Ladisch 7584af10cf sound: rawmidi: record a substream's owner process
Record the pid of the task that opened a RawMIDI substream.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-10 16:32:38 +01:00
Clemens Ladisch e7373b702f sound: pcm: record a substream's owner process
Record the pid of the task that opened a PCM substream. For sound
cards with hardware mixing, this allows determining which process
is associated with a specific substream's volume control.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-10 16:32:20 +01:00
Clemens Ladisch 25d27eded1 control: use reference-counted pid
Instead of storing the PID number, take a reference to the task's pid
structure.  This protects against duplicates due to PID overflows, and
using pid_vnr() ensures that the PID returned by snd_ctl_elem_info() is
correct as seen from the current namespace.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-06 14:32:06 +01:00
Clemens Ladisch 31cef7076e control: remove snd_konctrol_volatile::owner_pid field
We do not need to save the ID of the process that locked a control
because that information is already available in the owner's file data.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-06 14:32:03 +01:00
Krzysztof Helt d114cd84a1 ALSA: cs4236: detect chip in one pass
The cs4236 was two step detection with call to the snd_wss_free()
between two steps. The snd_wss_free() did not free a sound device
created in the snd_wss_create(). This caused an OOPS during module
removal as the same sound device was released twice. The same OOPS
happened if the cs4236 module loading failed.

Fix this by adapting the snd_cs4236_create() to correctly work with
chips less capable then cs4236. The snd_cs4236_create() behaves the
same as the snd_wss_create() if the chip is less capable than the cs4236.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-05 18:10:25 +01:00
Rafael Ignacio Zurita 9dcaa7b25f ALSA: sh: add SuperH DAC audio driver for ALSA V4
This is a port of the sound/oss/sh_dac_audio.c driver.
The driver uses an on-chip 8-bit D/A converter, which has a speaker connected
to one of its channels, found in several ancient HP machines.
For interrupts it uses a high-resolution timer (hrtimer).
Tested on SH7709 based hp6xx (HP Jornada 680/690 and HP Palmtop 620lx/660lx).

Also, since OSS Emulation works, the old OSS sound/oss/sh_dac_audio.c driver
would be obsolete soon, and it could be removed.

Signed-off-by: Rafael Ignacio Zurita <rizurita@yahoo.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-04 09:17:40 +01:00
Mark Brown fe3e78e073 ASoC: Factor out snd_soc_init_card()
snd_soc_init_card() is always called as the last part of the CODEC probe
function so we can factor it out into the core card setup rather than
have each CODEC replicate the code to do the initialiastation. This will
be required to support multiple CODECs per card.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-11-03 22:14:43 +00:00
Peter Ujfalusi c8bf93f0fe ASoC: Codec driver for Texas Instruments tlv320dac33 codec
Driver for Texas Instruments TLV320DAC33 (SLAS546) low power stereo
audio DAC.

TLV320DAC33 is a stereo audio codec with integrated 24KB FIFO for low
power audio playback.

The digital interface can use I2S, DSP (A or B), Right and Left
justified formats.
DAC33 has stereo analog input, which can be bypassed to the analog
outputs.

Regarding to the internal 24KB FIFO the driver implements 'FIFO bypass'
mode (default) and nSample mode (FIFO is in use).
a) In 'FIFO bypass' mode the internal FIFO is not in use, the codec is
working synchronously as a normal codec (it needs constant stream of
data on the digital interface).

b) The nSample mode implementation uses one interrupt line from DAC33 to
the host:
Alarm threshold is set to 10ms of audio data (limit by the driver
implementation).
DAC33 will signal an interrupt, when the FIFO level goes under the
Alarm threshold.
The host will write to nSample register a value (number of stereo
samples), to tell DAC33 how many samples it should read in a burst from
the host. When the DAC33 received the number of samples, it disables the
clocks on the I2S bus. When the FIFO use again goes under the Alarm
threshold, DAC33 signals the host with an interrupt, and the process is
repeated.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-15 15:02:04 +01:00
Mark Brown d2058b0cd0 ASoC: Remove snd_soc_suspend_device()
The PM core will grow pm_link infrastructure in 2.6.33 which can be
used to implement the intended functionality of the ASoC-specific
device suspend and resume callbacks so drop them.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-15 15:01:43 +01:00
Peter Ujfalusi 493b67efff ASoC: TPA6130A2 amplifier driver
Driver for Texas Instruments TPA6130A2 stereo headphone
amplifier.

The driver provides playback gain control and also pre-defined
DAPM_HP widgets and DAPM routings for power management.

The DAPM_HP widget names are:
"TPA6130A2 Headphone Left"
"TPA6130A2 Headphone Right"

From soc machine drivers to use with the tpa6130a2 amplifier,
the tpa6130a2_add_controls has to be called, which adds the alsa
controls and the DAPM routing needed for the tpa6130a2.
After that the machine driver can connect the codec's output
with 'TPA6130A2 Left' and 'TPA6130A2 Right':

        {"TPA6130A2 Left", NULL, "CODEC LEFT OUT"},
        {"TPA6130A2 Right", NULL, "CODEC RIGHT OUT"},

Internally the left and right channels are powered separately.
When none of the channels are needed the amplifier is powered
down:
hard power: valid GPIO number is passed within platform data
soft power: Using the software shutdown of the amplifier

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-09 18:50:37 +01:00
Mark Brown 907bc6c7fc Merge branch 'for-2.6.32' into for-2.6.33 2009-10-06 16:01:27 +01:00
Mark Brown d2b247a8be ASoC: Add virtual enumeration support for DAPM muxes
Sometimes it is desirable to have a mux which does not reflect any
direct register configuration but which will instead only have an
effect implicitly (for example, as a result of changing which parts
of the device are powered up). Provide a virtual mux for this purpose.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-06 15:57:02 +01:00
Takashi Iwai 7c824f4b69 ALSA: sscape - Remove sscap_ioctl.h from include/sound/Kbuild
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-02 07:22:58 +02:00
Peter Ujfalusi 88439ac793 ASoC: add support for multiple cards/codecs in debugfs
In order to support multiple codecs on the same system in the debugfs
the directory hierarchy need to be changed by adding directory per codec
under the asoc direcorty:

debugfs/asoc/{dev_name(socdev->dev)}-{codec->name}/codec_reg
                                                  /dapm_pop_time
                                                  /dapm/{widgets}

With the original implementation only the debugfs files are only
created for the first codec, other codecs loaded later would fail to
create the debugfs files (since they are already exist).
Furthermore in this situation any of the codecs has been removed, would
cause the debugfs entries to disappear, regardless if the codec, which
created them are still loaded (the one which loaded first).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-01 12:13:04 +01:00
Krzysztof Helt acd4710091 ALSA: sscape: convert to firmware loader framework
The conversion solves the problem that firmware size was set to 64KB
while non PnP cards have 128KB firmware files.

An additional firmware initialization code has been moved from the OSS
driver.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-01 07:51:56 +02:00
Lopez Cruz, Misael be2500b835 ASoC: Add PDM DAI format definition
Add DAI format definition for PDM interfaces.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-28 14:43:27 +01:00
Pavel Hofman 42cfa276ae ALSA: ak4113 support
* complete support for ak4113
* based on code for ak4114 and ak4117

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-21 15:45:07 +02:00
Pavel Hofman 8f34692f63 ALSA: ak4620 support, codec regs listed in proc
* complete support for ak4620
* codec regs listed in proc for all codecs/chips
* adding total regs for each codec
* fixing nb. of steps in input attenuation controls

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-21 15:44:51 +02:00
Pavel Hofman c0a9eedf9a ALSA: ak4114 - fix errors in output selector bits
* the previous version had a typo - values of AK4114_OPS10-12 were
  identical with AK4114_OPS00-02
* Since no cards actually use this feature, the bug was not identified earlier

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-21 15:44:39 +02:00
Mark Brown 9f072b7b22 Merge branch 'for-2.6.32' into for-2.6.33 2009-09-18 15:09:44 +01:00
Barry Song 472df3cbae ASoC: Provide API for reordering channels
The patch adds an interface to set the relationship between audio
channel number and slot number. The interface should be really useful
because audio channel n doesn't always use slot n in all platforms. And
for some devices, the relationship even can change with sound mode
switch in 2.1,3.1,4.1,5.1,6.1,7.1 etc.

Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-13 12:37:53 +01:00
Takashi Iwai 1110afbe72 Merge branch 'topic/ymfpci' into for-linus
* topic/ymfpci:
  sound: ymfpci: increase timer resolution to 96 kHz
2009-09-10 15:33:09 +02:00
Takashi Iwai b34c866394 Merge branch 'topic/tlv-minmax' into for-linus
* topic/tlv-minmax:
  ALSA: usb-audio - Correct bogus volume dB information
  ALSA: usb-audio - Use the new TLV_DB_MINMAX type
  ALSA: Add new TLV types for dBwith min/max
2009-09-10 15:33:06 +02:00
Takashi Iwai 9d416811f8 Merge branch 'topic/snd-printk' into for-linus
* topic/snd-printk:
  ALSA: Fixed a typo of printk()
  ALSA: Add debug module option
  ALSA: core - strip too long file names in snd_print*()
2009-09-10 15:33:03 +02:00
Takashi Iwai 2c0d19a78d Merge branch 'topic/pcm-drain-nonblock' into for-linus
* topic/pcm-drain-nonblock:
  ALSA: pcm - Increase protocol version
  ALSA: pcm - Fix drain behavior in non-blocking mode
2009-09-10 15:33:00 +02:00
Takashi Iwai 9cd9f42767 Merge branch 'topic/misc' into for-linus
* topic/misc:
  ALSA: Remove unneeded ifdef from sound/core.h
  ALSA: Remove struct snd_monitor_file from public sound/core.h
  ALSA: Release v1.0.21
2009-09-10 15:32:57 +02:00
Takashi Iwai 6a0f402146 Merge branch 'topic/dummy' into for-linus
* topic/dummy:
  ALSA: dummy - Increase MAX_PCM_SUBSTREAMS to 128
  ALSA: dummy - Add debug proc file
  ALSA: Add const prefix to proc helper functions
  ALSA: Re-export snd_pcm_format_name() function
  ALSA: dummy - Fake buffer allocations
  ALSA: dummy - Fix the timer calculation in systimer mode
  ALSA: dummy - Add more description
  ALSA: dummy - Better jiffies handling
  ALSA: dummy - Support high-res timer mode
2009-09-10 15:32:51 +02:00
Takashi Iwai f9892a52e2 Merge branch 'topic/dma-sgbuf' into for-linus
* topic/dma-sgbuf:
  ALSA: Fix SG-buffer DMA with non-coherent architectures
2009-09-10 15:32:50 +02:00
Mark Brown 215edda3ad ASoC: Allow per-route connectedness checks for supplies
Some chips with complex internal supply (particularly clocking)
arragements may have multiple options for some of the supply
connections. Since these don't affect user-visible audio routing
the expectation would be that they would be managed automatically
by one of the drivers.

Support these users by allowing routes to have a connected function
which is queried before the connectedness of the path is checked as
normal. Currently this is only done for supplies, other widgets
could be supported but are not currently since the expectation for
them is that audio routing will be under the control of userspace.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-08 19:24:56 +01:00
Takashi Iwai 4f7454a997 ALSA: Add const prefix to proc helper functions
Add appropriate const prefix to char * arguments in proc helper functions.
Also fixed the caller side to be proper const pointers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-08 14:45:06 +02:00
Takashi Iwai 6e5265ec34 ALSA: Re-export snd_pcm_format_name() function
Re-export snd_pcm_format_name() function to be used outside the PCM core.
As a first example, usbaudio is changed to use it now again.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-08 14:26:51 +02:00
Takashi Iwai b8c60ede6a ALSA: Remove unneeded ifdef from sound/core.h
Remove the old hack that was needed for building alsa-driver modules
externally for old kernels.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-07 15:58:30 +02:00
Takashi Iwai 82a783f4bc ALSA: Remove struct snd_monitor_file from public sound/core.h
The struct snd_monitor_file is used locally only in sound/core/init.c,
thus it should be moved there from the public sound/core.h.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-07 15:50:18 +02:00
Mark Brown 236cc52856 ASoC: Remove unuused hw_read_t
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-07 12:46:42 +01:00
Mark Brown 85488037bb ASoC: Add source argument to PLL configuration
More and more devices feature PLLs and FLLs with the ability to select
between multiple input clocks. In order to better support these devices
a new argument, source, has been added to the set_pll() configuration
API. Using set_clkdiv() is often difficult due to the need to stop the
PLL/FLL before any reconfiguration can be done.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-05 18:52:16 +01:00
Jaroslav Kysela 9d32e03d01 ALSA: Release v1.0.21
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-03 12:03:48 +02:00
Takashi Iwai cf0baf16c3 ALSA: Fixed a typo of printk()
Fixed a silly typo of printk() included in the previous patch...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-28 07:22:05 +02:00
Takashi Iwai 5a53a7640a ALSA: pcm - Increase protocol version
Increase the PCM protocol version to indicate the drain ioctl behavior
change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-27 21:04:12 +02:00