Commit graph

1025 commits

Author SHA1 Message Date
Vinod Koul e60061a379 ALSA: core: add API header and driver header files
This patch adds the header files for ioctl definitions and header file for
driver APIs for lower level device drivers to use

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-23 10:08:11 +01:00
Vinod Koul 50c34cfe7b ALSA: core: add compress parameter definations
The patch adds the various definations used to define the encoder
and decoder parameters

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-23 10:07:58 +01:00
Omair Mohammed Abdullah 3eafc959b3 ALSA: core: add support for compressed devices
Use the minor numbers 2 and 3 for audio compressed offload devices.
Also add support for these devices in core

Signed-off-by: Omair Mohammed Abdullah <omair.m.abdullah@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-23 10:07:46 +01:00
Mark Brown 354a21423d ASoC: Declare soc_new_pcm() properly
Ensure that everything is seeing the same declaration by moving it to
a header file rather than putting the declaration in soc-core.c

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-12-22 17:34:25 +00:00
Stephen Warren 5a5049637c ASoC: Allow DAI links to be specified using device tree nodes
DAI link endpoints and platform (DMA) devices are currently specified
by name. When instantiating sound cards from device tree, it may be more
convenient to refer to these devices by phandle in the device tree, and
for code to describe DAI links using the "struct device_node *"
("of_node") those phandles map to.

This change adds new fields to snd_soc_dai_link which can "name" devices
using of_node, enhances soc_bind_dai_link() to allow binding based on
of_node, and enhances snd_soc_register_card() to ensure that illegal
combinations of name and of_node are not used.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-22 11:00:21 +00:00
Stephen Warren a4a54dd5bb ASoC: Add utility to parse DAPM routes from device tree
Implement snd_soc_of_parse_audio_routing(), a utility function that can
parses a simple DAPM route table from device tree.The machine driver
specifies the DT property to use, since this is binding-specific.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 01:05:34 +00:00
Stephen Warren bec4fa05e2 ASoC: Add utility to set a card's name from device tree
Implement snd_soc_of_parse_card_name(), a utility function that sets a
card's name from device tree. The machine driver specifies the DT
property to use, since this is binding-specific.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-20 01:05:34 +00:00
Mark Brown 1dfb6efd87 ASoC: Remove rbtree register cache
All users now use regmap directly so delete the ASoC version of the code.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-13 00:20:28 +08:00
Stephen Warren a0f203d384 ASoC: WM8903: Fix platform data gpio_cfg confusion
wm8903_platform_data.gpio_cfg[] was intended to be interpreted as follows:
0:       Don't touch this GPIO's configuration register
1..7fff: Write that value to the GPIO's configuration register
8000:    Write zero to the GPIO's configuration register
other:   Undefined (invalid)

The rationale is that platform data is usually global data, and a value of
zero means that the field wasn't explicitly set to anything (e.g. because
the field was new to the pdata type, and existing users weren't update to
initialize it) and hence the value zero should be ignored. 0x8000 is an
explicit way to get 0 in the register.

The code worked this way until commit 7cfe561 "ASoC: wm8903: Expose GPIOs
through gpiolib", where the behaviour was changed due to my lack of
awareness of the above rationale.

This patch reverts to the intended behaviour, and updates all in-tree users
to use the correct scheme. This also makes WM8903 consistent with other
devices that use a similar scheme.

WM8903_GPIO_NO_CONFIG is also renamed to WM8903_GPIO_CONFIG_ZERO so that
its name accurately reflects its purpose.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Colin Cross <ccross@android.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:29:22 +00:00
Lars-Peter Clausen 84b315ee89 ASoC: Drop unused state parameter from CODEC suspend callback
The existence of this parameter is purely historical. None of the CODEC drivers
uses it and we always pass in the same value anyway, so it should be safe to
remove it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-02 10:32:03 +00:00
Mark Brown 1ab97c8cad ASoC: Add signal generator widget type
A signal generator behaves as an input would but is not considered for
any of the special behaviour associated with external input pins. This
is especially useful when automatically working out not connected widgets.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-12-02 10:26:07 +00:00
Dong Aisheng 778825801d ASoC: mxs-saif: remove function in platform_data
Add master_mode and master_id in platfrom_data since it's board
specific and board knows it.
Then we can remove the function pointer in platfrom_data to make
the driver more devicetree friendly.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2011-12-02 13:56:42 +08:00
Kuninori Morimoto 45f3121615 ASoC: fsi-ak4642: modify specification method of FSI / ak464x
Current fsi-ak4642 was using id_entry name in order to specify
FSI port and ak464x codec.
But it was no sense, no flexibility.
Platform can specify FSI/ak464x pair by this patch.

Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-24 10:31:26 +00:00
Stephen Warren 1633281b79 ASoC: Implement fully_routed card property
A card is fully routed if the DAPM route table describes all connections on
the board.

When a card is fully routed, some operations can be automated by the ASoC
core. The first, and currently only, such operation is described below, and
implemented by this patch.

Codecs often have a large number of external pins, and not all of these pins
will be connected on all board designs. Some machine drivers therefore call
snd_soc_dapm_nc_pin() for all the unused pins, in order to tell the ASoC core
never to activate them.

However, when a card is fully routed, the information needed to derive the
set of unused pins is present in card->dapm_routes. In this case, have
the ASoC core automatically call snd_soc_dapm_nc_pin() for each unused
codec pin.

This has been tested with soc/tegra/tegra_wm8903.c and soc/tegra/trimslice.c.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-23 21:34:54 +00:00
Takashi Iwai 35be544af3 ALSA: Introduce common helper functions for jack-detection control
Now move the helper function for creating and reporting the jack-detection
to the common place.  The driver that needs this functionality should
select CONFIG_SND_KCTL_JACK kconfig.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16 11:14:03 +01:00
Johannes Stezenbach 3fb5eac50d ASoC: sta32x: add workaround for ESD reset issue
sta32x resets and loses all configuration during ESD test.
Work around by polling the CONFA register once a second
and restore all coeffcients and registers when CONFA
changes unexpectedly.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-14 21:36:43 +00:00
Johannes Stezenbach e012ba2491 ASoC: sta32x: add platform data definition
Add a structure for platform specific configuration and use it,
thereby removing a few FIXMEs which marked hard-coded values.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-14 21:34:14 +00:00
Mark Brown c9016a7937 ASoC: Remove LZO cache type
There are no current users and new drivers ought to be using the regmap
API and its cache implementation directly so just delete the ASoC copy.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-10 13:08:09 +00:00
Mark Brown d66a327dda ASoC: Remove extra space in runtime struct definition
My usual technique for finding definitions is to search for "name {"
which breaks with the extra space.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-10 11:46:13 +00:00
Mark Brown 41966710ab Merge branch 'for-3.2' into for-3.3 2011-11-08 10:47:46 +00:00
Linus Torvalds 32aaeffbd4 Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
* 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
  Revert "tracing: Include module.h in define_trace.h"
  irq: don't put module.h into irq.h for tracking irqgen modules.
  bluetooth: macroize two small inlines to avoid module.h
  ip_vs.h: fix implicit use of module_get/module_put from module.h
  nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
  include: replace linux/module.h with "struct module" wherever possible
  include: convert various register fcns to macros to avoid include chaining
  crypto.h: remove unused crypto_tfm_alg_modname() inline
  uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
  pm_runtime.h: explicitly requires notifier.h
  linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
  miscdevice.h: fix up implicit use of lists and types
  stop_machine.h: fix implicit use of smp.h for smp_processor_id
  of: fix implicit use of errno.h in include/linux/of.h
  of_platform.h: delete needless include <linux/module.h>
  acpi: remove module.h include from platform/aclinux.h
  miscdevice.h: delete unnecessary inclusion of module.h
  device_cgroup.h: delete needless include <linux/module.h>
  net: sch_generic remove redundant use of <linux/module.h>
  net: inet_timewait_sock doesnt need <linux/module.h>
  ...

Fix up trivial conflicts (other header files, and  removal of the ab3550 mfd driver) in
 - drivers/media/dvb/frontends/dibx000_common.c
 - drivers/media/video/{mt9m111.c,ov6650.c}
 - drivers/mfd/ab3550-core.c
 - include/linux/dmaengine.h
2011-11-06 19:44:47 -08:00
Joe Perches b9075fa968 treewide: use __printf not __attribute__((format(printf,...)))
Standardize the style for compiler based printf format verification.
Standardized the location of __printf too.

Done via script and a little typing.

$ grep -rPl --include=*.[ch] -w "__attribute__" * | \
  grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
  xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

[akpm@linux-foundation.org: revert arch bits]
Signed-off-by: Joe Perches <joe@perches.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-31 17:30:54 -07:00
Paul Gortmaker de47725421 include: replace linux/module.h with "struct module" wherever possible
The <linux/module.h> pretty much brings in the kitchen sink along
with it, so it should be avoided wherever reasonably possible in
terms of being included from other commonly used <linux/something.h>
files, as it results in a measureable increase on compile times.

The worst culprit was probably device.h since it is used everywhere.
This file also had an implicit dependency/usage of mutex.h which was
masked by module.h, and is also fixed here at the same time.

There are over a dozen other headers that simply declare the
struct instead of pulling in the whole file, so follow their lead
and simply make it a few more.

Most of the implicit dependencies on module.h being present by
these headers pulling it in have been now weeded out, so we can
finally make this change with hopefully minimal breakage.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:32:32 -04:00
Linus Torvalds 68d99b2c8e Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (549 commits)
  ALSA: hda - Fix ADC input-amp handling for Cx20549 codec
  ALSA: hda - Keep EAPD turned on for old Conexant chips
  ALSA: hda/realtek - Fix missing volume controls with ALC260
  ASoC: wm8940: Properly set codec->dapm.bias_level
  ALSA: hda - Fix pin-config for ASUS W90V
  ALSA: hda - Fix surround/CLFE headphone and speaker pins order
  ALSA: hda - Fix typo
  ALSA: Update the sound git tree URL
  ALSA: HDA: Add new revision for ALC662
  ASoC: max98095: Convert codec->hw_write to snd_soc_write
  ASoC: keep pointer to resource so it can be freed
  ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
  ASoC: wm8996: Fix wrong mask for setting WM8996_AIF_CLOCKING_2
  ASoC: da7210: Add support for line out and DAC
  ASoC: da7210: Add support for DAPM
  ALSA: hda/realtek - Fix DAC assignments of multiple speakers
  ASoC: Use SGTL5000_LINREG_VDDD_MASK instead of hardcoded mask value
  ASoC: Set sgtl5000->ldo in ldo_regulator_register
  ASoC: wm8996: Use SND_SOC_DAPM_AIF_OUT for AIF2 Capture
  ASoC: wm8994: Use SND_SOC_DAPM_AIF_OUT for AIF3 Capture
  ...
2011-10-28 14:25:01 -07:00
ramesh.babu@linux.intel.com e50fad4f02 ASoC: Allow machines to ignore pmdown_time per-link
With this flag, each dai_link in machine driver can choose
to ignore pmdown_time during DAPM shut down sequence.

If the ignore_pmdown_time is set, the DAPM for corresponding DAI
will be executed immediately.

Signed-off-by: Ramesh Babu K V <ramesh.babu@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-27 12:05:50 +02:00
Takashi Iwai bb14eb0da7 Merge branch 'topic/asoc' into for-linus 2011-10-27 10:43:40 +02:00
Takashi Iwai 9430148d80 Merge branch 'topic/remove-irqf_disable' into for-linus 2011-10-26 23:51:48 +02:00
Takashi Iwai d226657022 Merge branch 'topic/misc' into for-linus 2011-10-26 23:51:43 +02:00
Peter Ujfalusi 1d69c5c5de ASoC: core: Add flag to ignore pmdown_time at pcm_close
With this flag codec drivers can indicate that it is desired
to ignore the pmdown_time for DAPM shutdown sequence when
playback stream is stopped.
The DAPM sequence will be executed without delay in this case.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:42:21 +01:00
Mark Brown 25c77c5fae ASoC: Fix DAPM sync for TLV320AIC3x custom DAPM widget
We really should be doing this in the core, not in a driver...

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
2011-10-10 10:28:26 +01:00
Mark Brown 024dc07855 ASoC: Cache connected input and output recursions
The number of connected input and output endpoints for a given widgets
can't change during a DAPM run so there is no need to redo the recursion
through branches of the tree we've already visited. Doing this on one of
my test systems gives an improvement of:

         Power    Path   Neighbour
Before:  63       607    731
After:   63       141    181

which scales up well as more widgets are involved in paths.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-09 12:07:48 +01:00
Clemens Ladisch 8d448162bd ALSA: control: add support for ENUMERATED user space controls
Handling of user control elements was implemented for all types except
ENUMERATED.  This type will be needed for the device-specific mixers of
upcoming FireWire drivers.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-10-09 09:09:11 +02:00
Peter Ujfalusi a92f1394a1 ASoC: fix codec breakage caused by the volsw/volsw_2r merger
By accident few places still uses the _2r calls from
the core.
This is a quick fix, the drivers using the old callbacks
going to be changed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 20:02:55 +01:00
Peter Ujfalusi 1576a5ff49 ASoC: core: Remove snd_soc_put_volsw_2r definition
We do not have users for snd_soc_put_volsw_2r anymore.
It can be removed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:10 +01:00
Peter Ujfalusi 974815ba4f ASoC: core: Combine snd_soc_put_volsw/put_volsw_2r functions
Handle the put_volsw/put_volsw_2r in one function.

To avoid build breakage in twl6040 keep the
snd_soc_put_volsw_2r as define, and map it snd_soc_put_volsw.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:10 +01:00
Peter Ujfalusi f7915d9975 ASoC: core: Combine snd_soc_get_volsw/get_volsw_2r functions
Handle the get_volsw/get_volsw_2r in one function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:09 +01:00
Peter Ujfalusi e8f5a10307 ASoC: core: Combine snd_soc_info_volsw/info_volsw_2r functions
Handle the info_volsw/info_volsw_2r in one function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:09 +01:00
Peter Ujfalusi 30d86ba47f ASoC: core: Change SOC_SINGLE/DOUBLE_VALUE representation
SOC_SINGLE/DOUBLE_VALUE is used for mixer controls, where the
bits are within one register.

Assign .rreg to be the same as .reg for these types.

With this change we can tell if the mixer in question:
is mono:
mc->reg == mc->rreg && mc->shift == mc->rshift

is stereo, within single register:
mc->reg == mc->rreg && mc->shift != mc->rshift

is stereo, in two registers:
mc->reg != mc->rreg

The patch provide a small inline function to query, if the mixer
is stereo, or mono.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:09 +01:00
David Henningsson 7c2f8e4009 ALSA: jack - Add "Line In" input jack constants
Similar to Line Out, these constants form the base for future
patches enabling input jack reporting for Line in jacks.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-10-05 17:22:04 +02:00
Mark Brown 9b8a83b205 ASoC: Only run power_check() on a widget once per run
Some widgets will get power_check() run on them more than once during a
DAPM run, most commonly due to supply widgets checking to see if their
consumers are powered up. It's wasteful to do this so cache the result
of power_check() during a run. For one system I tested this on I got an
improvement of:

           Power    Path   Neighbour
Before:    106      970    1186
After:     69       727    905

from this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 11:22:22 +01:00
Mark Brown db432b414e ASoC: Do DAPM power checks only for widgets changed since last run
In order to reduce the number of DAPM power checks we run keep a list of
widgets which have been changed since the last DAPM run and iterate over
that rather than the full widget list. Whenever we change the power state
for a widget we add all the source and sink widgets it has to the dirty
list, ensuring that all widgets in the path are checked.

This covers more widgets than we need to as some of the neighbour widgets
won't be connected but it's simpler as a first step. On one system I tried
this gave:

           Power    Path   Neighbour
Before:    207      1939   2461
After:     114      1066   1327

which seems useful.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:50:20 +01:00
Peter Ujfalusi cdffa775e7 ASoC: core: Introduce SOC_DOUBLE_R_VALUE macro
With the new macro we can remove duplicated code
for the SOC_DOUBLE_R type of controls.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:27:05 +01:00
Peter Ujfalusi 460acbec1e ASoC: core: Introduce SOC_DOUBLE_VALUE macro
With the new macro we can remove duplicated code
for the SOC_DOUBLE type of controls.
We can also remap the SOC_SINGLE_VALUE macro to
SOC_DOUBLE_VALUE

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:27:05 +01:00
Takashi Iwai 18a2b96233 ALSA: pcm - Export snd_pcm_lib_default_mmap() helper
Export the default mmap function, snd_pcm_lib_default_mmap().
The upcoming non-snooping support in HD-audio driver will use this
to override the mmap method.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-28 17:15:14 +02:00
Mark Brown 75d9ac46b9 ASoC: Allow DAI formats to be specified in the dai_link
For almost all machines the DAI format is a constant, always set to the
same thing. This means that not only should we normally set it on init
rather than in hw_params() (where it has been for historical reasons) we
should also allow users to configure this by setting a variable in the
dai_link structure. The combination of these two will make many machine
drivers even more data driven.

Implement a new dai_fmt field in the dai_link doing just that. Since 0 is
a valid value for many format flags and we need to be able to tell if the
field is actually set also add one to all the values used to configure
formats.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:22:28 +01:00
Mark Brown 213eb0fb1e ASoC: Add platform data for WM1250 EV1 GPIOs
The WM1250 EV1 has some GPIOs which can be used to control the behaviour
at runtime. Request them all if supplied and add a set_bias_level()
function to start and stop the clocks.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23 17:05:38 +01:00
Mark Brown e56235e099 ASoC: Add another DAPM stat for neighbour checks
The number of times we look at a potentially connected neighbour is just
as important as the number of times we actually recurse into looking at
that neighbour so also collect that statistic.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:24:40 +01:00
Yong Zhang 88e24c3a4b sound: irq: Remove IRQF_DISABLED
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-22 11:19:20 +02:00
Takashi Iwai af1910a817 Merge branch 'topic/asoc' into topic/remove-irqf_disable 2011-09-22 09:56:12 +02:00
Peter Ujfalusi 0722d055ac ASoC: tpa6130a2: Remove model_id from platform data
The model_id is no longer needed within the platform_data
for the TPA driver since the model of TPA specified
with the device name (tpa6130a2/tpa6140a2).

Also update rx51 (the only affected user) to use the device name rather
than platform data.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-21 16:07:45 +01:00
Dong Aisheng 17841020e9 ASoC: soc-core: symmetry checking for each DAIs separately
The orginal code does not cover the case that one DAI such as codec
may be shared between other two DAIs(CPU).
When do symmetry checking, altough the codec DAI requires symmetry,
the two CPU DAIs may still be configured to run on different rates.

We change to check each DAI's state separately instead of only checking
the dai link to prevent this issue.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-21 15:59:46 +01:00
Mark Brown de02d0786d ASoC: Trace and collect statistics for DAPM graph walking
One of the longest standing areas for improvement in ASoC has been the
DAPM algorithm - it repeats the same checks many times whenever it is run
and makes no effort to limit the areas of the graph it checks meaning we
do an awful lot of walks over the full graph. This has never mattered too
much as the size of the graph has generally been small in relation to the
size of the devices supported and the speed of CPUs but it is annoying.

In preparation for work on improving this insert a trace point after the
graph walk has been done. This gives us specific timing information for
the walk, and in order to give quantifiable (non-benchmark) numbers also
count every time we check a link or check the power for a widget and report
those numbers. Substantial changes in the algorithm may require tweaks to
the stats but they should be useful for simpler things.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-21 14:53:44 +01:00
Mark Brown 6d4baf084f ASoC: Add WM5100 driver
The WM5100 is a highly integrated low power audio subsystem with advanced
digital signal processing capabilities including effects, speech clarity
enhancement and active noise cancellation.  This initial driver provides
support for basic audio paths, further patches will provide more
complete functionality.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-20 16:02:16 +01:00
Clemens Ladisch d5b702a64b ALSA: pcm: add snd_pcm_hw_rule_noresample()
Add a helper function to allow drivers to disable hardware resampling
when the application has specified the SNDRV_PCM_HW_PARAMS_NORESAMPLE
flag.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-20 08:56:45 +02:00
Dong Aisheng 76067540c6 ASoC: mxs-saif: add record function
1. add different clkmux mode handling
SAIF can use two instances to implement full duplex (playback &
recording) and record saif may work on EXTMASTER mode which is
using other saif's BITCLK&LRCLK.

The clkmux mode could be set in pdata->init() in mach-specific code.
For generic saif driver, it only needs to know who is his master
and the master id is also provided in mach-specific code.

2. support playback and capture simutaneously however the sample
rates can not be different due to hw limitation.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19 18:31:59 +01:00
Clemens Ladisch dba8b46992 ALSA: mpu401: clean up interrupt specification
The semantics of snd_mpu401_uart_new()'s interrupt parameters are
somewhat counterintuitive:  To prevent the function from allocating its
own interrupt, either the irq number must be invalid, or the irq_flags
parameter must be zero.  At the same time, the irq parameter being
invalid specifies that the mpu401 code has to work without an interrupt
allocated by the caller.  This implies that, if there is an interrupt
and it is allocated by the caller, the irq parameter must be set to
a valid-looking number which then isn't actually used.

With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value,
which forces us to handle the parameters differently.

This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the
device interrupt is handled by the caller, and makes the allocation of
the interrupt to depend only on the irq parameter.  As suggested by
Takashi, the irq_flags parameter was dropped because, when used, it had
the constant value IRQF_DISABLED.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-14 11:00:51 +02:00
Mark Brown da1c6ea6cf ASoC: Allow source specification for CODEC level sysclk
Similarly to PLLs/FLLs some modern CODECs provide selectable system clock
sources. When the clock is the clock for a DAI we do not usually need to
identify which clock is being configured so can use clk_id for the source
clock but with CODEC wide system clocks we will need to specify both the
clock being configured and the source.

Add a source argument to the CODEC driver set_sysclk() operation to
reflect this. As this operation is not as widely used as the DAI
set_sysclk() operation the change is not very invasive. We probably
ought to go and make the same alternation for DAIs at some point.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-31 09:57:35 +01:00
Mark Brown 4a8923ba99 ASoC: Allow register defaults to be larger than unsigned short
Devices that need this exist; obviously the newer regmap defaults
mechanism will deal with this more happily.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-31 09:51:50 +01:00
Jean Pihet cc74998618 PM QoS: Minor clean-ups
- Misc fixes to improve code readability:
  * rename struct pm_qos_request_list to struct pm_qos_request,
  * rename pm_qos_req parameter to req in internal code,
    consistenly use req in the API parameters,
  * update the in-kernel API callers to the new parameters names,
  * rename of fields names (requests, list, node, constraints)

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

The PM QoS support is compiled under the CONFIG_PM option.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Acked-by: markgross <markgross@thegnar.org>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-08-25 15:35:03 +02:00
Mark Brown 33c5f969b9 ASoC: Allow idle_bias_off to be specified in CODEC drivers
If devices can unconditionally support idle_bias_off let them flag it in
their driver structure.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-22 23:23:29 +01:00
Lars-Peter Clausen ddd7a26094 ASoC: Add ADAU1373 codec support
This patch adds support for the Analog Devices ADAU1373 audio codec.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-17 00:53:54 +09:00
Mark Brown 42bef6866f Merge branch 'for-3.1' into for-3.2 2011-08-12 11:48:29 +09:00
Jarkko Nikula 7ec41ee5ad ASoC: omap: Update e-mail address of Jarkko Nikula
My gmail account got disabled and I'm not going to reopen it.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-12 11:45:10 +09:00
Mark Brown 6f1a7767fd Merge branch 'for-3.1' into for-3.2 2011-08-09 10:00:05 +09:00
Mark Brown bb3784ae36 Merge branch 'regmap-asoc' into for-3.2 2011-08-08 15:00:13 +09:00
Mark Brown 0671da189c ASoC: Add regmap as a control type
Allow drivers to set up their own regmap API structures. This is mainly
useful with MFDs where the core driver will have set up regmap at the
minute, though it may make sense to push the existing regmap setup out
of the core into the drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-08 14:59:55 +09:00
Mark Brown be3ea3b9e8 ASoC: Use new register map API for ASoC generic physical I/O
Remove all the ASoC specific physical I/O code and replace it with calls
into the regmap API. The bulk write code can only be used safely if all
regmap calls are locked with the CODEC lock, we need to add bulk support
to the regmap API or replace the code with an open coded loop (though
currently it has no users...).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-08 14:59:44 +09:00
Mark Brown 18d4ed4342 Merge branch 'for-3.1' into for-3.2
Conflict due to the fix for the register map failure - taken the for-3.1
version.

Conflicts:
	sound/soc/codecs/sgtl5000.c
2011-08-08 14:56:19 +09:00
Mark Brown a9ba615134 ASoC: Rename WM8915 to WM8996
For marketing reasons the part will be called WM8996. In order to avoid
user confusion rename the driver to reflect this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-08 14:30:37 +09:00
Linus Torvalds 664a41b8a9 Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (430 commits)
  [media] ir-mce_kbd-decoder: include module.h for its facilities
  [media] ov5642: include module.h for its facilities
  [media] em28xx: Fix DVB-C maxsize for em2884
  [media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHz
  [media] v4l: mt9v032: Fix Bayer pattern
  [media] V4L: mt9m111: rewrite set_pixfmt
  [media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear
  [media] V4L: initial driver for ov5642 CMOS sensor
  [media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails
  [media] V4L: soc-camera: remove soc-camera bus and devices on it
  [media] V4L: soc-camera: un-export the soc-camera bus
  [media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier
  [media] V4L: add media bus configuration subdev operations
  [media] V4L: soc-camera: group struct field initialisations together
  [media] V4L: soc-camera: remove now unused soc-camera specific PM hooks
  [media] V4L: pxa-camera: switch to using standard PM hooks
  [media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param
  [media] Don't OOPS if videobuf_dvb_get_frontend return NULL
  [media] NetUP Dual DVB-T/C CI RF: load firmware according card revision
  [media] omap3isp: Support configurable HS/VS polarities
  ...

Fix up conflicts:
 - arch/arm/mach-omap2/board-rx51-peripherals.c:
     cleanup regulator supply definitions in mach-omap2
   vs
     OMAP3: RX-51: define vdds_csib regulator supply
 - drivers/staging/tm6000/tm6000-alsa.c (trivial)
2011-07-30 00:08:53 -07:00
Ondrej Zary 6a529c1a4a [media] tea575x: allow multiple opens
Change locking to allow tea575x-radio device to be opened multiple times.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:53:07 -03:00
Ondrej Zary 4522e825db [media] tea575x: convert to control framework
Convert tea575x-tuner to use the new V4L2 control framework. Also add
ext_init() callback that can be used by a card driver for additional
initialization right before registering the video device (for SF16-FMR2).

Also embed struct video_device to struct snd_tea575x to simplify the code.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27 17:52:20 -03:00
Linus Torvalds 7562343716 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: (22 commits)
  ALSA: hda - Cirrus Logic CS421x support
  ALSA: Make pcm.h self-contained
  ALSA: hda - Allow codec-specific set_power_state ops
  ALSA: hda - Add post_suspend patch ops
  ALSA: hda - Make CONFIG_SND_HDA_POWER_SAVE depending on CONFIG_PM
  ALSA: hda - Make sure mute led reflects master mute state
  ALSA: hda - Fix invalid mute led state on resume of IDT codecs
  ASoC: Revert "ASoC: SAMSUNG: Add I2S0 internal dma driver"
  ALSA: hda - Add support of the 4 internal speakers on certain HP laptops
  ALSA: Make snd_pcm_debug_name usable outside pcm_lib
  ALSA: hda - Fix DAC filling for multi-connection pins in Realtek parser
  ASoC: dapm - Add methods to retrieve snd_card and soc_card from dapm context.
  ASoC: SAMSUNG: Add I2S0 internal dma driver
  ASoC: SAMSUNG: Modify I2S driver to support idma
  ASoC: davinci: add missing break statement
  ASoC: davinci: fix codec start and stop functions
  ASoC: dapm - add DAPM macro for external enum widgets
  ASoC: Acknowledge WM8962 interrupts before acting on them
  ASoC: sgtl5000: guide user when regulator support is needed
  ASoC: sgtl5000: refactor registering internal ldo
  ...
2011-07-27 09:25:15 -07:00
Takashi Iwai 636f78581d Merge branch 'fix/asoc' into for-linus 2011-07-26 17:47:05 +02:00
Takashi Iwai b51beb756a ALSA: Make pcm.h self-contained
Move the macros depending on snd_mask_min() and co out of pcm.h into
pcm_params.h.  Otherwise using some params_*() macros will give comiple
errors without inclusion of pcm_params.h.

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

Reported-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-26 17:21:24 +02:00
Liam Girdwood 64a648c220 ASoC: dapm - Add DAPM stream completion event.
In preparation for Dynamic PCM (AKA DSP) support.

This adds a callback function to be called at the completion of a DAPM stream
event.

This can be used by DSP components to perform calculations based on DAPM graphs
after completion of stream events.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-25 22:07:24 +01:00
Linus Torvalds d3ec4844d4 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: (43 commits)
  fs: Merge split strings
  treewide: fix potentially dangerous trailing ';' in #defined values/expressions
  uwb: Fix misspelling of neighbourhood in comment
  net, netfilter: Remove redundant goto in ebt_ulog_packet
  trivial: don't touch files that are removed in the staging tree
  lib/vsprintf: replace link to Draft by final RFC number
  doc: Kconfig: `to be' -> `be'
  doc: Kconfig: Typo: square -> squared
  doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
  drivers/net: static should be at beginning of declaration
  drivers/media: static should be at beginning of declaration
  drivers/i2c: static should be at beginning of declaration
  XTENSA: static should be at beginning of declaration
  SH: static should be at beginning of declaration
  MIPS: static should be at beginning of declaration
  ARM: static should be at beginning of declaration
  rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
  Update my e-mail address
  PCIe ASPM: forcedly -> forcibly
  gma500: push through device driver tree
  ...

Fix up trivial conflicts:
 - arch/arm/mach-ep93xx/dma-m2p.c (deleted)
 - drivers/gpio/gpio-ep93xx.c (renamed and context nearby)
 - drivers/net/r8169.c (just context changes)
2011-07-25 13:56:39 -07:00
Eliot Blennerhassett acb03d440b ALSA: Make snd_pcm_debug_name usable outside pcm_lib
Formatting a PCM name is useful for module debug too.
Add snd_prefix when making function public.

[minor coding-style fixes by tiwai]

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-24 13:34:32 +02:00
Takashi Iwai 7d339ae997 Merge branch 'topic/misc' into for-linus 2011-07-22 08:43:24 +02:00
Takashi Iwai 13b137ef03 Merge branch 'topic/asoc' into for-linus 2011-07-22 08:43:19 +02:00
Phil Carmody 497888cf69 treewide: fix potentially dangerous trailing ';' in #defined values/expressions
All these are instances of
  #define NAME value;
or
  #define NAME(params_opt) value;

These of course fail to build when used in contexts like
  if(foo $OP NAME)
  while(bar $OP NAME)
and may silently generate the wrong code in contexts such as
  foo = NAME + 1;    /* foo = value; + 1; */
  bar = NAME - 1;    /* bar = value; - 1; */
  baz = NAME & quux; /* baz = value; & quux; */

Reported on comp.lang.c,
Message-ID: <ab0d55fe-25e5-482b-811e-c475aa6065c3@c29g2000yqd.googlegroups.com>
Initial analysis of the dangers provided by Keith Thompson in that thread.

There are many more instances of more complicated macros having unnecessary
trailing semicolons, but this pile seems to be all of the cases of simple
values suffering from the problem. (Thus things that are likely to be found
in one of the contexts above, more complicated ones aren't.)

Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-07-21 14:10:00 +02:00
Liam Girdwood c219c80929 ASoC: dapm - add DAPM macro for external enum widgets
Add a convenience macro for external enumerated widgets.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-20 20:51:08 +01:00
Liam Girdwood cb2cf612fb ASoC: core - Add convenience register for platform kcontrol and DAPM
Allow platform probe to register platform kcontrols and DAPM just like
the CODEC probe().

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-05 11:07:41 -07:00
Liam Girdwood b795064137 ASoC: core - Add platform widget IO
Allow platform driver widgets to perform any IO required for DAPM.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-05 11:07:39 -07:00
Liam Girdwood a491a5c84f ASoC: core - Add API call to register platform kcontrols.
In preparation for Dynamic PCM (AKA DSP) support.

Allow platform drivers to register kcontrols.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-05 11:07:34 -07:00
Liam Girdwood f1442bc1e9 ASoC: core - Add platform read and write.
In preparation for ASoC Dynamic PCM (AKA DSP) support.

Allow platform driver to perform IO. Intended for platform DAPM.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-04 12:41:07 -07:00
Takashi Iwai 4f3c7a18d9 ALSA: sb16 - Fix build errors on MIPS and others with 13bit ioctl size
One of ioctl definition in sound/sb16_csp.h contains the data size
over 8kB, and this causes build errors on architectures like MIPS,
which define _IOC_SIZEBITS=13.

For avoiding this build errors but keeping the compatibility, manually
expand with _IOC() instead of using _IOW() for the problematic ioctl.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-30 15:33:57 +02:00
Takashi Iwai b3c705aa9e ALSA: rawmidi - Use workq for event handling
Kill tasklet usage in rawmidi core code.  Use workq for the event callback
instead of tasklet (which is used only in core/seq/seq_midi.c).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-14 14:37:06 +02:00
Mark Brown 169d5a83f6 ASoC: Fix mismerge with release branch
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-06-14 09:51:50 +01:00
Mark Brown 65fdd5c05a Merge branch 'for-3.0' into for-3.1
Trival fixup for move of I/O code into separate file.

Conflicts:
	sound/soc/soc-cache.c
2011-06-13 19:21:09 +01:00
Mark Brown e9c039052b ASoC: Remove unused and about to be broken SND_SOC_CUSTOM I/O bus
This will be removed in -next so let's drop it from mainline as soon as
we can in order to minimise surprises.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-06-13 19:17:55 +01:00
Mark Brown bf3a9e137c ASoC: Add weak routes for sidetone style paths
Normally DAPM will power up any connected audio path. This is not ideal
for sidetone paths as with sidetone paths the audio path is not wanted in
itself, it is only desired if the two paths it provides a sidetone between
are both active. If the sidetone path causes a power up then it can be
hard to minimise pops as we first power up either the sidetone or the main
output path and then power the other, with the second power up potentially
introducing a DC offset.

Address this by introducing the concept of a weak path. If a path is marked
as weak then DAPM will ignore that path when walking the graph, though all
the relevant controls are still available to the application layer to allow
these paths to be configured.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-13 18:59:33 +01:00
Liam Girdwood b8c0dab9bf ASoC: core - PCM mutex per rtd
In preparation for the new ASoC Dynamic PCM support (AKA DSP support).

The new ASoC Dynamic PCM core allows DAIs to be dynamically re-routed
at runtime between the PCM device end (or Frontend - FE) and the physical DAI
(Backend - BE) using regular kcontrols (just like a hardware CODEC routes
audio in the analog domain). The Dynamic PCM core therefore must be
able to call PCM operations for both the Frontend and Backend(s) DAIs at
the same time.

Currently we have a global pcm_mutex that is used to serialise
the ASoC PCM operations. This patch removes the global mutex
and adds a mutex per RTD allowing the PCM operations to be reentrant and
allow control of more than one DAI at at time. e.g. a frontend PCM hw_params()
could configure multiple backend DAI hw_params() with similar or different
hw parameters at the same time.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-06-09 19:29:29 +01:00
Liam Girdwood 0168bf0d13 ASoC: core - Allow components to probe/remove in sequence.
Some ASoC components depend on other ASoC components to provide clocks and
power resources in order to probe() and vice versa for remove().

Allow components to be ordered so that components can be probed() and removed()
in sequences that conform to their dependencies.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-06-07 18:38:27 +01:00
Liam Girdwood 552d1ef6b5 ASoC: core - Optimise and refactor pcm_new() to pass only rtd
Currently pcm_new() passes in 3 arguments :- card, pcm and DAI.

Refactor this to only pass in 1 argument (i.e. the rtd) since struct rtd contains
card, pcm and DAI along with other members too that are useful too.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-06-07 18:38:27 +01:00
Mark Brown d4c6005f8e ASoC: Add context parameter to card DAPM callbacks
The card callback will get called for each DAPM context in the card so it
can be useful for it to know which device is currently undergoing a
transition.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-06 21:46:45 +01:00
Mark Brown 56fba41f8f ASoC: Specify target bias state directly as a bias state
Rather than a simple flag to say if we want the DAPM context to be at full
power specify the target bias state. This should have no current effect
but is a bit more direct and so makes it easier to change our decisions
about the which bias state to go into in future.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-06 21:45:44 +01:00
Takashi Iwai 7ec298dfef Merge branch 'topic/asoc' into for-linus 2011-05-22 10:01:33 +02:00
Takashi Iwai 02e5fbf622 Merge branch 'topic/misc' into for-linus 2011-05-22 10:01:29 +02:00