ak4642 register was 8bit, but cache table was defined as 16bit.
ak4642 doesn't work correctry without this patch.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Axel Lin [Thu, 13 Oct 2011 06:57:31 +0000 (14:57 +0800)]
ASoC: sta32x: Write the register default value to cache for reserved registers
Chip documentation explicitly requires that the reset values
of reserved register bits are left untouched.
codec->hw_read is broken now.
Here we use below trick to avoid writing to reserved registers while resume.
Write the register default value to cache for reserved registers,
so the write to the these registers are suppressed by the cache
restore code when it skips writes of default registers.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Wed, 12 Oct 2011 13:43:08 +0000 (21:43 +0800)]
ASoC: Make SND_SOC_SAARB and SND_SOC_TAVOREVB3 select MFD_88PM860X
In saarb_pm860x_init() and evb3_pm860x_init(), we call
pm860x_hs_jack_detect() and pm860x_mic_jack_detect() which in turn
calls pm860x_set_bits().
Thus make SND_SOC_SAARB and SND_SOC_TAVOREVB3 select MFD_88PM860X.
This patch fixes below build error if CONFIG_MFD_88PM860X is not configured.
LD .tmp_vmlinux1
sound/built-in.o: In function `pm860x_write_reg_cache':
last.c:(.text+0x29e9c): undefined reference to `pm860x_reg_write'
sound/built-in.o: In function `pm860x_set_bias_level':
last.c:(.text+0x29ecc): undefined reference to `pm860x_set_bits'
last.c:(.text+0x29f00): undefined reference to `pm860x_reg_write'
last.c:(.text+0x29f18): undefined reference to `pm860x_reg_write'
sound/built-in.o: In function `pm860x_read_reg_cache':
last.c:(.text+0x29f40): undefined reference to `pm860x_reg_read'
sound/built-in.o: In function `pm860x_probe':
last.c:(.text+0x2a034): undefined reference to `pm860x_bulk_read'
sound/built-in.o: In function `pm860x_codec_handler':
last.c:(.text+0x2a344): undefined reference to `pm860x_reg_read'
last.c:(.text+0x2a354): undefined reference to `pm860x_reg_read'
sound/built-in.o: In function `pm860x_mic_jack_detect':
last.c:(.text+0x2a450): undefined reference to `pm860x_set_bits'
sound/built-in.o: In function `pm860x_hs_jack_detect':
last.c:(.text+0x2a4d0): undefined reference to `pm860x_set_bits'
last.c:(.text+0x2a4f8): undefined reference to `pm860x_set_bits'
last.c:(.text+0x2a510): undefined reference to `pm860x_set_bits'
make: *** [.tmp_vmlinux1] Error 1
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Ashish Chavan [Wed, 12 Oct 2011 15:03:21 +0000 (20:33 +0530)]
ASoC: da7210: Add support for other DAI word lengths, format and mode
This patchs adds support for following,
(1) DAI 20 and 32 bit word sizes
(2) DAI left and right justified formats
(3) DAI slave mode
Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com> Signed-off-by: David Dajun Chen <dchen@diasemi.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Wed, 12 Oct 2011 11:46:02 +0000 (14:46 +0300)]
ASoC: twl6040: Workaround for headset DC offset caused pop noise
Both Headset DAC need to be turned on/off at the same time before
any of the output drivers are enabled (HS Left/Right, Earpiece).
Move the HS DAC enable code to sequenced DAPM_SUPPLY, and attach
it to the DACs.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Wed, 12 Oct 2011 08:57:57 +0000 (11:57 +0300)]
ASoC: twl6040: Support for vibra output paths
twl6040 have two vibra output drivers.
They can be operated with audio stream coming through
the PDM interface (fifth channel).
The vibra outputs can be controlled via the input/FF
driver as well.
Selection between the two mode is implemented within
the codec driver, the input/FF driver can only operate if
the routing is set to "Input FF".
Changing from "Input FF" to "Audio PDM" mode is protected
as well: The switchin can only be done, if there is no
running effect from the input/FF.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Wed, 12 Oct 2011 08:57:56 +0000 (11:57 +0300)]
Input: twl6040-vibra: Check the selected path for vibra
The VIBSELL/R bit in the VIBCTLL/R register tells the source of the data,
which is going to be used to drive the attached motor(s).
Do not allow effect execution if any of the channels are set to receive
audio data.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Wed, 12 Oct 2011 08:57:55 +0000 (11:57 +0300)]
MFD: twl6040: function to query the vibra status for clients
If the client only interested, if any of the vibra channels enabled, or
if any of the channels are set to receive audio data via PDM.
This function targets mainly the vibra driver, so it can check if it is
allowed to execute effects ot not.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Wed, 12 Oct 2011 08:57:54 +0000 (11:57 +0300)]
MFD: twl6040: Cache the vibra control registers
The vibra control register will be used from the ASoC codec driver as well.
In order to avoid latency issues caused by I2C read access, cache the two
control register within the core driver, so we do not need to reach out
to the chip to read it back.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The bits within the two control registers (for left and right channel)
are identical.
Use common names for the bits acros the two register.
Also add the missing definition for the path selection bit.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Tue, 27 Sep 2011 16:39:50 +0000 (17:39 +0100)]
ASoC: Implement WM5100 accessory detection support
The WM5100 includes an advanced, low power, accessory detect subsystem
capable of detecting both accessory presence and button presses while
the device is in an ultra low power mode. Implement initial support for
this.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Wolfram Sang [Tue, 11 Oct 2011 10:43:02 +0000 (12:43 +0200)]
ASoC: Fix typo in Kconfig symbol for tlv320aic32x4
It is currently named "TVL" instead of "TLV".
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>
Axel Lin [Tue, 11 Oct 2011 09:55:00 +0000 (17:55 +0800)]
ASoC: Writing register default value for the reset register
The WM8983 can be reset by performing a write of any value to
the software reset register.
To avoid writing to the software reset register while resume,
we should write the same value in wm8983_reg_defs to software
reset register in wm8983_probe().
The write to the reset register is suppressed by the cache
restore code when it skips writes of default registers.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>