Peter Ujfalusi [Mon, 10 Oct 2011 12:34:12 +0000 (15:34 +0300)]
ASoC: sdp3430: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Oct 2011 12:34:11 +0000 (15:34 +0300)]
ASoC: osk5912: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core. With this change we do not need the init function
since the remaining snd_soc_dapm_enable_pin calls are
not needed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Oct 2011 12:34:10 +0000 (15:34 +0300)]
ASoC: n810: Let the core to register DAPM widgets/routes and controls
Pass the DAPM widgets/routes and static controls via the
snd_soc_card struct to core. In this way the machine driver
does not need to handle the DAPM widgets/routes.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Oct 2011 12:34:09 +0000 (15:34 +0300)]
ASoC: am3517evm: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core. With this change we do not need the init function
since the remaining snd_soc_dapm_enable_pin calls are
not needed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Anuj Aggarwal <anuj.aggarwal@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Oct 2011 12:34:16 +0000 (15:34 +0300)]
ASoC: sdp4430: No need to call dapm_pin_enable at init time
Widgets are connected by default.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Oct 2011 12:34:15 +0000 (15:34 +0300)]
ASoC: sdp4430: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Oct 2011 12:34:14 +0000 (15:34 +0300)]
ASoC: zoom2: No need to call dapm_pin_enable at init time
Widgets are connected by default.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Oct 2011 12:34:13 +0000 (15:34 +0300)]
ASoC: zoom2: Let core to deal with the DAPM widgets
Pass the DAPM widgets/routes via the snd_soc_card struct
to core.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Michael Opdenacker <michael.opdenacker@linaro.org> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Sun, 9 Oct 2011 13:06:13 +0000 (14:06 +0100)]
ASoC: Squash error codes from regmap down to -1 on read
The ASoC code always uses -1 as the error code due to reporting errors in
band with the value. Ensure we don't confuse anything by making sure we
don't pass actual error codes back into the rest of the code on read.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Sun, 9 Oct 2011 10:52:05 +0000 (11:52 +0100)]
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:
Mark Brown [Fri, 7 Oct 2011 13:29:19 +0000 (14:29 +0100)]
ASoC: Suppress early calls to snd_soc_dapm_sync()
Ensure we only have one sync during the initial startup of the card by
making snd_soc_dapm_sync() a noop on non-instantiated cards. This avoids
any bounces due to things like jacks reporting their initial state on
partially initialised cards. The callers that don't also get called at
runtime should just be removed.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Wed, 5 Oct 2011 23:29:56 +0000 (07:29 +0800)]
ASoC: Return early with -EINVAL if invalid dai format is detected
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Wolfram Sang [Thu, 6 Oct 2011 18:53:36 +0000 (20:53 +0200)]
ASoC: tlv320aic32x4 fix initialization of micpga routing
Checking the pdata-flags used 'or', so the check is always true. Use 'and' to
correctly mask the flags.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Javier Martin <javier.martin@vista-silicon.com> Cc: Liam Girdwood <lrg@ti.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Thu, 6 Oct 2011 12:30:55 +0000 (13:30 +0100)]
ASoC: Ensure DAPM widgets are set up before we sync jacks
We synchronise jack state on startup - when we do that make sure that we
have set up all the DAPM widgets first in case we end up touching any of
the partially set up widgets when syncing the jack pins.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Peter Ujfalusi [Thu, 6 Oct 2011 06:59:12 +0000 (09:59 +0300)]
ASoC: Replace remaining use of *_volsw_2r with *_volsw
The snd_soc_*_volsw_2r functionality has been merged to
*volsw callbacks.
Few places still used the get, or put variant of volsw_2r,
replace those with the corresponding *_volsw.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Wed, 5 Oct 2011 06:47:15 +0000 (14:47 +0800)]
ASoC: Remove unused variable 'wm9090' in wm9090_probe
Eliminate below build warning:
CC sound/soc/codecs/wm9090.o
sound/soc/codecs/wm9090.c: In function 'wm9090_probe':
sound/soc/codecs/wm9090.c:550: warning: unused variable 'wm9090'
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Wed, 5 Oct 2011 06:40:46 +0000 (14:40 +0800)]
ASoC: Remove unused function declaration in imx-ssi.h
These functions are removed in commit f0fba2ad
"ASoC: multi-component - ASoC Multi-Component Support".
Let's remove the leftover function declaration in header file.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Wed, 5 Oct 2011 07:29:21 +0000 (10:29 +0300)]
ASoC: twl6040: Prepare for core put_volsw/volsw_2r merger
Avoid using the mc->rreg to identify the 2r type of gain control.
Introduce a variable to track this.
This change is needed to avoid breakage with the upcoming volsw volsw_2r
merger.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Wed, 5 Oct 2011 07:29:20 +0000 (10:29 +0300)]
ASoC: twl6040: Simplify custom get_volsw callback
The custom get_volsw does not need to call any core get_volsw calls,
since we are returning the shadow values for the gains.
Return -EINVAL in the unlikely event, if the function has been called
for unhandled control. This way we can remove one check in the code.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Tue, 4 Oct 2011 21:57:50 +0000 (22:57 +0100)]
ASoC: Stop checking for supplied widgets after we find the first
We don't really care how many widgets a supply is supplying, we just care
if the number is non-zero. This didn't actually produce any improvement
in the test cases I've been using but seems obviously sensible enough that
I'm pushing it out anyway.
We could do a similar thing for other widgets but this may be unhelpful
for further refactorings Liam was working on aiming to allow us to
identify connected audio paths.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Tue, 4 Oct 2011 21:43:31 +0000 (22:43 +0100)]
ASoC: Don't mark the outputs of supplies as dirty on state changes
The whole point of supply widgets is that they aren't inputs to their
sinks so a state change in a supply should never affect the state of the
widget being supplied and we don't need to mark them as dirty.
Mark Brown [Tue, 4 Oct 2011 21:15:59 +0000 (22:15 +0100)]
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:
Mark Brown [Tue, 4 Oct 2011 21:28:08 +0000 (22:28 +0100)]
ASoC: Add verbose debugging showing why widgets get marked dirty
Help diagnose why we're checking widgets by providing some logging when
we first dirty them. This should possibly be a trace point if it's useful
but can be absurdly verbose if enabled, we can always change it later if
desired.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Mon, 3 Oct 2011 21:36:57 +0000 (22:36 +0100)]
ASoC: Reduce the number of neigbours we mark dirty when updating power
If two widgets are not currently connected then there is no need to
propagate a power state change between them as we mark the affected
widgets when we change a connection. Similarly if a neighbour widget is
already in the state being set for the current widget then there is no
need to recheck.
Mark Brown [Mon, 3 Oct 2011 20:06:40 +0000 (21:06 +0100)]
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:
Mark Brown [Mon, 3 Oct 2011 21:41:09 +0000 (22:41 +0100)]
ASoC: Mark headphone, mic, speaker and line widgets as always connected
We're not actually doing any dynamic power management based on connection
and output drivers (which are pretty much the same thing) are marked as
unconditionally connected already.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Wed, 28 Sep 2011 16:19:47 +0000 (17:19 +0100)]
ASoC: Move bias level decision into main dapm_power_widgets()
Future patches will try to reduce the number of widgets we check on each
DAPM run but we're still going to need to look and see if the devices is
on at all so we can manage the overall device bias. Move these checks out
into the main dapm_power_widgets() function so we don't have to think about
them for now.
Once we're doing more incremental updates it'll probably be worth using
refcounts for each bias level to avoid having to do the sweep over all
widgets but that's not going to be where the big performance wins are.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Tue, 4 Oct 2011 12:08:04 +0000 (20:08 +0800)]
ASoC: wm8995: Slightly optimize configure_clock
snd_soc_update_bits() will only write new register value
if the old value is different from the new value.
In additional, snd_soc_update_bits() returns 0 for no change.
No need to read WM8995_CLOCKING_1 register before calling snd_soc_update_bits().
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Tue, 4 Oct 2011 12:07:03 +0000 (20:07 +0800)]
ASoC: wm8994: Slightly optimize configure_clock
snd_soc_update_bits() will only write new register value
if the old value is different from the new value.
In additional, snd_soc_update_bits() returns 0 for no change.
No need to read WM8994_CLOCKING_1 register before calling snd_soc_update_bits().
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Tue, 4 Oct 2011 08:09:52 +0000 (11:09 +0300)]
ASoC: omap-pcm: Fix the no period wakeup implementation
After omap_request_dma the BLOCK_IRQ is enabled as default
configuration for the channel.
If we are requested for no period wakeup, we need to disable
the BLOCK_IRQ in order to not receive any interrupts.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Ryan Mallon [Mon, 3 Oct 2011 22:55:41 +0000 (09:55 +1100)]
ASoC: max98095 codec: Catch driver bugs for biquad channel name
Move the biquad channel names to a separate array and iterate over it in
max98095_get_bq_channel rather than duplicating the hardcoded channel
names. Add an error message if an invalid channel is passed and check
the error in the callers.
Also added a BUILD_BUG_ON to ensure that the bq_mode_name and controls
arrays are the same size.
Signed-off-by: Ryan Mallon <rmallon@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Ryan Mallon [Mon, 3 Oct 2011 22:55:40 +0000 (09:55 +1100)]
ASoC: max98088 codec: Catch driver bugs for eq channel name
Move the EQ channel names to a separate array and iterate over it in
max98088_get_channel rather than duplicating the hardcoded channel
names. Add an error message if an invalid channel is passed and check
the error in the callers.
Also added a BUILD_BUG_ON to ensure that the eq_mode_name and controls
arrays are the same size.
Signed-off-by: Ryan Mallon <rmallon@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Tue, 24 May 2011 09:35:53 +0000 (17:35 +0800)]
ASoC: Add WM1811 support
The WM1811 is mostly register compatible with the WM8994 and WM8958,
providing a high performance audio hub CODEC in a small form factor
suitable for ultra compact system designs.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Tue, 24 May 2011 09:35:40 +0000 (17:35 +0800)]
mfd: Add WM1811 support
The WM1811 is mostly register compatible with the WM8994 and WM8958,
providing a high performance audio hub CODEC in a small form factor
suitable for ultra compact system designs.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Sun, 2 Oct 2011 13:34:26 +0000 (21:34 +0800)]
ASoC: samsung: s3c-i2s-v2.c needs module.h
Include <linux/module.h> to fix below build error:
CC sound/soc/samsung/s3c-i2s-v2.o
sound/soc/samsung/s3c-i2s-v2.c:573: warning: data definition has no type or storage class
sound/soc/samsung/s3c-i2s-v2.c:573: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
sound/soc/samsung/s3c-i2s-v2.c:573: warning: parameter names (without types) in function declaration
sound/soc/samsung/s3c-i2s-v2.c:638: warning: data definition has no type or storage class
sound/soc/samsung/s3c-i2s-v2.c:638: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
sound/soc/samsung/s3c-i2s-v2.c:638: warning: parameter names (without types) in function declaration
sound/soc/samsung/s3c-i2s-v2.c:677: warning: data definition has no type or storage class
sound/soc/samsung/s3c-i2s-v2.c:677: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
sound/soc/samsung/s3c-i2s-v2.c:677: warning: parameter names (without types) in function declaration
sound/soc/samsung/s3c-i2s-v2.c: In function 's3c_i2sv2_register_dai':
sound/soc/samsung/s3c-i2s-v2.c:736: warning: initialization discards qualifiers from pointer target type
sound/soc/samsung/s3c-i2s-v2.c: At top level:
sound/soc/samsung/s3c-i2s-v2.c:754: warning: data definition has no type or storage class
sound/soc/samsung/s3c-i2s-v2.c:754: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
sound/soc/samsung/s3c-i2s-v2.c:754: warning: parameter names (without types) in function declaration
sound/soc/samsung/s3c-i2s-v2.c:756: error: expected declaration specifiers or '...' before string constant
sound/soc/samsung/s3c-i2s-v2.c:756: warning: data definition has no type or storage class
sound/soc/samsung/s3c-i2s-v2.c:756: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
sound/soc/samsung/s3c-i2s-v2.c:756: warning: function declaration isn't a prototype
make[3]: *** [sound/soc/samsung/s3c-i2s-v2.o] Error 1
make[2]: *** [sound/soc/samsung] Error 2
make[1]: *** [sound/soc] Error 2
make: *** [sound] Error 2
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Arnd Bergmann [Mon, 3 Oct 2011 14:35:46 +0000 (16:35 +0200)]
ASoC: samsung: WM8994 depends on MFD_WM8994
Any driver that selects SND_SOC_WM8994 should also make sure that
MFD_WM8994 is set, since the codec relies on the mfd code:
sound/built-in.o: In function `wm8994_read':
last.c:(.text+0x20160): undefined reference to `wm8994_reg_read'
sound/built-in.o: In function `wm8994_write':
last.c:(.text+0x20e68): undefined reference to `wm8994_reg_write'
This solves the problem by selecting the MFD driver directly
and adding extra 'depends on' statements to make sure that we
respect the dependencies of that driver.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Mon, 3 Oct 2011 03:09:01 +0000 (11:09 +0800)]
ASoC: Fix setting update bits for WM8741_DACRMSB_ATTENUATION
After checking the code and datasheet, I think what we want in the second
snd_soc_update_bits call is to update WM8741_DACRMSB_ATTENUATION register
instead of WM8741_DACRLSB_ATTENUATION.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Mon, 3 Oct 2011 03:33:05 +0000 (11:33 +0800)]
ASoC: Staticise ep93xx_ac97_dai
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mika Westerberg <mika.westerberg@iki.fi> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>