Commit graph

321 commits

Author SHA1 Message Date
Mark Brown f0b182b003 ASoC: Implement WM8994 thermal warning and shutdown interrupt support
ALSA doesn't really have good mechanisms for dealing with these so we just
log them - the hardware already has automatic shutdown support.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-17 00:49:03 +09:00
Mark Brown 1ddc07d0f1 ASoC: Add WM8958 noise gate support
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-17 00:48:47 +09:00
Mark Brown d09f3ecf1a ASoC: Disable pulls on WM8994 AIF2 when starting it
Pull control is availalbe for WM8994 AIF2, generally disabled as part of
the GPIO configuration in order to save power after system startup. As on
newer devices in the series there is no GPIO functionality on these pins
this will happen less naturally so have the driver disable the pulls as the
AIF is probed.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-15 23:54:12 +09:00
Mark Brown 4b7ed83aa3 ASoC: Disable WM8994 VMID for digital only paths
On WM8994 class devices only the analogue portions of the CODEC require
VMID so when running digital only paths we can leave VMID disabled.
On some earlier devices the FLL uses VMID so we don't use DAPM reference
counting alone, we maintain an internal reference count which is also
enabled and disabled by the FLL startup.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-14 13:44:23 +09:00
Mark Brown 4e04adaf87 ASoC: Add VMID widget for wm_hubs devices
Currently this does not actually do anything, it is being introduced in
order to facilitate additional power optimisations for current generation
devices.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-14 13:44:14 +09:00
Mark Brown 4158a05741 Merge branch 'for-3.1' into for-3.2 2011-08-11 10:43:40 +09:00
Mark Brown 280ec8b718 ASoC: Add missing break in WM8994 probe
This error would have no effect on current silicon revisions, the fall
through case has the same behaviour.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-11 10:43:20 +09:00
Mark Brown 4537c4e761 ASoC: Support separate left and right channel dcs_codes values
Some devices can have performance optimized by setting different offsets
for left and right channels.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-01 22:14:49 +09:00
Mark Brown 79ef0abcd8 ASoC: Implement new DC servo readback mode for late WM8994 revisions
Later WM8994 devices implement a new DC servo readback mode with the
register used to access the offset moved to register 0x59. Implement
support for this and enable it on the appropriate devices.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-01 22:14:30 +09:00
Mark Brown 4400855986 Merge branch 'for-3.0' into for-3.1 2011-07-17 18:25:58 +09:00
Mark Brown b793eb60a0 ASoC: Correct WM8994 MICBIAS supply widget hookup
The WM8994 and WM8958 series of devices have two MICBIAS supplies rather
than one, the current widget actually manages the microphone detection
control register bit (which is managed separately by the relevant API).

Fix this, hooking the relevant supplies up to the MICBIAS1 and MICBIAS2
widgets.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-07-17 18:24:29 +09:00
Mark Brown 7d02173cd1 ASoC: Reduce power consumption for idle DAIs in WM8994
If DAIs are idle but their clocks are in use for some reason (eg, as
SYSCLK or for accessory detect) then set the clock dividers to the maximum
to reduce slightly the power consumption of the unclocked circuits.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-17 17:51:10 +09:00
Mark Brown f0f5039c3d ASoC: Handle failed WM8994 FLL lock waits
Try the completion before we start the FLL so that if an interrupt was
delayed long enough for us to miss it we don't wait for the completion
it signalled.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-17 13:15:00 +09:00
Mark Brown 47d90a03eb Merge branch 'for-3.0' into for-3.1 2011-07-15 22:43:07 +09:00
Mark Brown b35e160a11 ASoC: Fix shift in WM8958 accessory detection default implementation
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-07-15 22:41:38 +09:00
Mark Brown 3b1af3f8c8 ASoC: Log WM8994 FIFO errors from the interrupt
We should spot them anyway on state changes but logging them gives us
better time information about when the misconfiguration happened.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-14 17:17:23 +09:00
Mark Brown f05bdb8bb6 ASoC: Don't warn on low WM8994/58 AIFnCLKs
We can have valid but very low clocks in accessory detection modes.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-14 00:38:30 +09:00
Mark Brown c7ebf932e5 ASoC: Use WM8994 FLL lock interrupt
If we have interrupts then wait for the FLL lock interrupt rather than
using dead reckoning when waiting for the FLL to start.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-14 00:38:22 +09:00
Mark Brown b30ead5f39 ASoC: Hook up DC servo completion IRQ for WM8994 and WM8958
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-14 00:38:14 +09:00
Mark Brown b70a51bab9 ASoC: Use late enable handling for direct voice, speaker and headphone
This ensures appropriate clocking for bypass paths to speaker and
headphone and direct voice paths on affected revisions.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-14 00:37:52 +09:00
Mark Brown 5b7396709e ASoC: Conditionalize the enable of WM8994 ADC TDM mode
Future devices will not benefit from this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-07-09 23:16:48 +09:00
Mark Brown 469bb638dc Merge branch 'for-3.0' into for-3.1 2011-07-04 08:54:40 -07:00
Mark Brown 8e9ddf811b ASoC: Ensure we delay long enough for WM8994 FLL to lock when starting
This delay is very conservative.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
2011-07-04 08:51:44 -07:00
Mark Brown f9acf9fe5b ASoC: Trigger wm_hubs series update startup off a separate flag
Allowing the two to be used independently.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-23 20:05:23 +01:00
Jarkko Nikula 9d03545d88 ASoC: Fix wrong data type access in a few codec drivers
Commit fafd217 ("ASoC: Store a list of widgets in a DAPM mux/mixer kcontrol")
changed the control private data type that is passed to snd_soc_cnew when
creating dapm mixer and mux controls. Commit did not update a few codec
drivers that are using their own put callbacks and thus are accessing a
wrong data type.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-05-16 09:06:47 -07:00
Mark Brown ca629928b9 ASoC: Disable WM8994/58 microphone detection over suspend
It will be non-functional with the basises and clocks off anyway, if the
system needs microphone detection enabled over suspend then it should be
causing the CODEC to ignore suspend using the APIs for that to prevent
the biases being disabled.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-05-11 15:56:32 +02:00
Mark Brown d9b3e4c515 Merge branch 'for-2.6.39' into for-2.6.40 2011-04-07 08:27:06 +09:00
Mark Brown baa8160382 ASoC: Set left channel volume update bits for WM8994
Ensures that we apply volume updates that don't affect the right channel.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-07 08:26:09 +09:00
Mark Brown 312158718f ASoC: Add WM8958 enhanced EQ support
DSP2 in the WM8958 can be used to support an upgraded EQ for use in
demanding applications.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-03-22 18:41:28 +00:00
Mark Brown 09e10d7fe5 ASoC: Add WM8958 VSS support
With appropriate firmware the WM8958 can support Virtual Surround Sound or
VSS, widening the stereo audio image for improved user experience. Enable
support for this mode of operation when the appropriate firmware can be
loaded at runtime.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-03-22 18:41:27 +00:00
Mark Brown fbbf592002 ASoC: Support download of WM8958 MBC firmware
Allow userspace to supply an update to the ROM firmware. The firmware
request is non-blocking so userspace can load the firmware at its
leisure without delaying startup, the driver will begin using the
firmware the next time MBC is started after it has been supplied.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-03-22 18:41:20 +00:00
Mark Brown af9af86602 ASoC: Mark WM8958 DSP2 registers readable
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-03-18 10:53:25 +00:00
Mark Brown c6b7b57012 ASoC: Handle startup sequencing of WM8958 DSP2 with deferred clocking
The DSP2 startup requires that the clock be enable so if we've deferred
clock startup we need to defer DSP2 startup

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-03-18 10:52:50 +00:00
Mark Brown f701a2e594 ASoC: Factor WM8958 DSP2 handling into separate file
DSP2 on the WM8958 has a default ROM which provides a multi-band
compressor for enhanced performance on mobile devices but can also
support runtime download of alternative firmware. In preparation for
more exploiting this functionality refactor the code to split the
handling of DSP2 into a separate file.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-03-18 10:52:40 +00:00
Mark Brown 780e280698 ASoC: Treat WM8958 revision A as WM8994 revision D
The first WM8958 revision requires similar treatment.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-03-18 10:52:25 +00:00
Mark Brown 80e1b84ffe Merge branch 'for-2.6.38' into for-2.6.39 2011-03-10 14:16:35 +00:00
Mark Brown 7c2de63386 ASoC: Ensure WM8958 gets all WM8994 late revision widgets
Without this fix the driver won't instantiate properly on relevant
devices.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
2011-03-09 20:30:29 +00:00
Mark Brown 0627bd2575 ASoC: Fix typo in late revision WM8994 DAC2R name
Without this fix the driver won't instantiate properly on relevant
devices.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
2011-03-09 20:30:22 +00:00
Dimitris Papastamos b462c6e69a ASoC: WM8994: Ensure MICBIAS is provided with a clock
The patch 'ASoC: WM8994: Improve Playback Robustness' did not handle
this case properly.

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-03-01 23:29:12 +00:00
Mark Brown c496ccd5db Merge branch 'for-2.6.38' into for-2.6.39 2011-03-01 23:29:04 +00:00
Dimitris Papastamos 04d286819b ASoC: WM8994: Ensure late enable events are processed for the ADCs
Ensure that the ADCs are provided with a clock as the previous patch
"ASoC: WM8994: Improve playback robustness" did not handle this case
properly.

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>
Cc: stable@kernel.org
2011-03-01 23:27:07 +00:00
Dimitris Papastamos a3cff81ac1 ASoC: WM8994: Don't disable the AIF[1|2]CLK_ENA unconditionaly
Since we began using the late clock disable functionality, ensure that
we don't disable the clock if any of the ADC or DAC paths are still
enabled.  This happens when we have simultaneous playback and recording.

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>
Cc: stable@kernel.org
2011-03-01 23:27:00 +00:00
Mark Brown 864c4bd248 ASoC: Simplify default WM8958 jack detection code
The default WM8958 jack detection handler implements a full set of buttons
and also support for video detection. Support for multi-button jacks is
fairly system specific and will usually require some tuning for headsets
so simplify the implementation to only report a simple short to ground
button, leaving multi-button headsets to be handled by system specific
code.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-02-22 10:42:33 -08:00
Mark Brown 48e028ecca ASoC: Support configuration of WM8958 microphone bias analogue parameters
The WM8958 has a different microphone bias architecture to WM8994 so needs
different configuration to WM8994. Support this in platform data.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-02-22 10:42:06 -08:00
Mark Brown 9b7c525dfa ASoC: Support WM8958 direct microphone detection IRQ
Allow direct routing of the WM8958 microphone detection signal to a GPIO
to be used, saving the need to demux the interrupt.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-02-22 10:41:41 -08:00
Mark Brown 4c090edfbb Merge branch 'for-2.6.38' into for-2.6.39 2011-02-22 10:38:13 -08:00
Mark Brown 406e56c9df ASoC: Fix WM8958 default microphone detection argument ordering
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-02-22 10:37:32 -08:00
Mark Brown 4a8d929d14 ASoC: Fix missing space in WM8994
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-02-18 09:13:30 -08:00
Mark Brown f98dedcefd Merge branch 'for-2.6.38' into for-2.6.39 2011-02-13 19:51:04 +00:00
Dimitris Papastamos c52fd021bc ASoC: WM8994: Improve playback robustness
On WM8994 revision D and earlier ensure proper playback robustness
as some rare use cases can trigger issues.

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>
Cc: stable@kernel.org
2011-02-13 19:45:01 +00:00
Dimitris Papastamos 173efa09e4 ASoC: WM8994: Improve robustness in some use cases
Ensure that on disabling certain registers such as AIF1DAC1L,
AIF1DAC1R etc. the AIF1CLK and AIF2CLK remain enabled.  Similarly
when enabling those registers, AIF1CLK and AIF2CLK will remain
disabled.

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>
Cc: stable@kernel.org
2011-02-13 19:44:54 +00:00
Mark Brown 7d7a7e0438 Merge branch 'for-2.6.38' into for-2.6.39 2011-02-03 20:17:54 +00:00
Mark Brown 6ed8f1485f ASoC: Improve WM8994 digital power sequencing
On WM8994 revision D and earlier ensure optimal sequencing with
simultaneous usage of AIF1 and AIF2 by tying the signals together
so if paths through both are connected the streams are started
simultaneously.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2011-02-03 20:17:13 +00:00
Mark Brown 7f94de483f ASoC: Create an AIF1ADCDAT signal widget to match AIF2
Due to the different routing for AIF1 and AIF2 we weren't using a
single widget to represent the ADCDAT signal. For consistency add
one.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2011-02-03 20:16:46 +00:00
Mark Brown e66ef2f81f Merge branch 'for-2.6.38' into for-2.6.39 2011-01-19 14:50:22 +00:00
Qiao Zhou 78b3fb4675 ASoC: WM8994: fix wrong value in tristate function
fix wrong value in wm8994_set_tristate func. when updating reg bits,
it should use "value", not "reg".

Signed-off-by: Qiao Zhou <zhouqiao@marvell.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-01-19 14:49:32 +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
Mark Brown 7116f452c8 ASoC: Yet more x86 tracepoint workarounds
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-29 13:06:18 +00:00
Mark Brown 2bbb5d6679 ASoC: Trace Wolfson jack detection IRQs
Add jack detection interrupt trace to Wolfson CODEC drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-22 11:08:55 +00:00
Mark Brown 458350b31f ASoC: Fix WM8994/58 3D stereo control definitions
Cut'n'paste in the register names.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-21 12:43:01 +00:00
Mark Brown 49db7e7b99 ASoC: Fix widgets for WM8994/58 AIF2 source control
The compiler really ought to have been warning about unreferenced
variables...

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-13 11:33:14 +00:00
Mark Brown 154b26aa9e ASoC: Implement WM8994/58 DAC and ADC oversampling control
The oversampling rate of the DAC and ADC can be controlled to optimise
for either low power consumption or maximum performance.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-10 17:39:54 +00:00
Uk Kim 146fd574ec ASoC: Add ADC high pass filter support to WM8994
Signed-off-by: Uk Kim <w0806.kim@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-08 15:46:49 +00:00
Mark Brown b1e43d933a ASoC: Support WM8994 mono AIF configurations
The WM8994 supports mono signals - enable this in the driver. With DSP
mode an automatic data channel selector is available, activate this
when in mono mode.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-08 13:56:31 +00:00
Mark Brown 4514e8997f ASoC: When disabling WM8994 FLL force a source selection
When we disable the WM8994 FLL code path sharing means that we end up
writing out a configuration. Currently this is the currently active
input and output frequency (which causes snd_soc_update_bits() to
suppress actual writes both immediately and in the common case where
we reenable the same configuration later) but we allow machine drivers
to pass through a source of zero. Since the register values written
are one less than the source constants this causes corruption of other
bitfields in the register.

Fix this by using the most recently configured FLL source when none is
provided.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2010-12-03 16:45:12 +00:00
Mark Brown 8bc3c2c207 ASoC: Tune performance of WM8958 revision A
Update some of the default configuration for the device to improve
the performance.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-02 13:03:53 +00:00
Mark Brown 131d81061e ASoC: Allow user-specified WM8958 multiband compressor configurations
The paramters of the WM8958 multiband compressor can be tuned by the
user for their system using a graphical configuration tool on the host.
Allow the user to specify a set of such paramters in platform data and
select between them at runtime.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-01 11:47:29 +00:00
Mark Brown b2822a8c22 ASoC: Correct event flags for WM8958 AIF DACs
We need a post notification as we need to shut down the MBC after the
data stops flowing rather than before.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-01 11:46:10 +00:00
Mark Brown 39fb51a123 ASoC: Implement runtime PM for WM8994/58
This allows us to communicate our power management state back to the
parent device, allowing it to do a full power down when the device is
idle.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:14 +00:00
Mark Brown 2e19b0c8c2 ASoC: Enable rbtree compression for WM8994/58 register cache
The WM8994 and WM8958 register map is relatively sparse so benefits
from compression. The rbtree compression gives better results than
LZO for both memory and CPU consumption on a map as sparse as this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:14 +00:00
Mark Brown ca9aef5072 ASoC: Convert WM8994 to use soc-cache.c cache functions
In the process we convert the driver to read registers one at a time
when initialising the cache. This has the effect of working around
limitations in the sizes of I2C transactions which can be done by some
CPUs. Due to the sparseness of the register map the overhead from this
should be minimual unless I2C transactions are very expensive to start.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:14 +00:00
Mark Brown 821edd2fb5 ASoC: Add WM8958 microphone detection support
The WM8958 contains an advanced accessory detection feature which allows
detection of up to seven different impedence levels on the microphone
bias output, including detection of video outputs. Since some of the
more involved accessory interfaces may involve noticable interactions
with external components a simple detection scheme is provided by
default with the option to provide custom handling of accessory detect.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:13 +00:00
Mark Brown d6addcc9d8 ASoC: Add WM8958 Multi-band compressor support
The WM8958 features a multi-band compressor which can be enabled on
any of the AIF inputs. The MBC allows different gains to be applied to
differnt audio bands, providing an improvement in perceived loudness
of the signal by avoiding overdriving the output transducers. This
patch enables support for the MBC.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:13 +00:00
Mark Brown c4431df050 ASoC: Implement support for enhanced AIF3 on WM8958
Additional audio routing options are available on the WM8958 audio
interface 3. Add support for these.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:13 +00:00
Mark Brown 3a42315740 ASoC: Initial WM8958 audio configuration
The WM8958 is a WM8994 derivative. This patch merely ensures that some
revision specific configuration for WM8994 is not enabled on WM8994,
additional patches will add support for the new features introduced on
the WM8958.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:13 +00:00
Mark Brown d50a87402e Merge branch 'for-2.6.37' into for-2.6.38 2010-11-23 14:30:41 +00:00
Axel Lin 24fb2b1174 ASoC: wm8994 - fix memory leaks
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-23 14:30:12 +00:00
Mark Brown cbe80def41 Merge branch 'for-2.6.37' into for-2.6.38 2010-11-22 20:33:12 +00:00
Mark Brown eba19fdd81 ASoC: Restore WM8994 volatile and readable register operations
They went AWOL during the multi-component merge.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-22 20:30:04 +00:00
Jarkko Nikula 505fb824e7 ASoC: Do not include soc-dapm.h
There is no need to include soc-dapm.h since soc.h includes it.

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:04:41 +00:00
Mark Brown 7b306dae22 ASoC: Move WM8994 read/write access data into separate file
Makes the WM8994 driver file itself substantially smaller.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-19 11:44:41 +00:00
Mark Brown 96b101efae ASoC: Provide ADC left/right channel source selection on WM8994
Allow the application to choose if the ADC data presented on the left
and right channels is sourced from the internal left or right channel.
This allows a mono recording to be presented as stereo on the external
bus.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-19 11:17:27 +00:00
Mark Brown 3df94756fe Merge branch 'for-2.6.37' into for-2.6.38 2010-11-17 18:59:19 +00:00
Mark Brown 11e713a07e ASoC: Fix register cache setup WM8994 for multi-component
During the multi-component conversion the WM8994 register cache init
got lost.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-17 18:32:51 +00: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 7b0f42b59a ASoC: Remove register write trace from WM8994
We now have trace in the ASoC core so we don't need to our own trace in
the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-03 14:28:53 -04:00
Mark Brown fec6dd833e ASoC: Store DC offset correction for wm_hubs devices in class W mode
Providing the analogue configuration of the output path remains the same
the DC offset corrected by the DC servo will remain identical so we can
skip the callibration, reducing the startup time for the headphone output.
Implement this for the wm_hubs devices as has been done for several other
CODECs.

Don't do this if we have any analogue paths enabled since offsets may be
being introduced by the analogue paths which could vary outside the
control of the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-28 11:34:03 -07:00
Joe Perches c14c05c19f ASoC: Remove unused vol field from WM8994 access mask table
Remove unused vol from struct access_mask

Reduces object size ~3kb.

$ size sound/soc/codecs/wm8994.o*
   text	   data	    bss	    dec	    hex	filename
  40727	   4384	   4480	  49591	   c1b7	sound/soc/codecs/wm8994.o.new
  43879	   4384	   4480	  52743	   ce07	sound/soc/codecs/wm8994.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-15 11:54:25 +01:00
Mark Brown 8c7f78b3c3 ASoC: Restore DAI ID specification for WM8994
WM8994 relies on the DAIs having IDs that match the AIF numbers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-13 10:37:29 +01:00
Mark Brown 5ab230a768 ASoC: Fix cut'n'paste comment in WM8994
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-06 17:44:07 +01:00
Ian Lartey 3079aed5f5 ASoC: Added a missing 32-bit PCM format, to the wm8994 codec.
Signed-off-by: Ian Lartey <ian@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-01 12:45:51 +01:00
Mark Brown f554885f92 ASoC: Implement WM8994 DAC data source muxes
Allow selection of the channel used for input to the AIFnDAC signals.
This isn't integrated into DAPM since we treat the data as a single
mono channel until just beyond this selection so it ends up having
no visible effect on the routing.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-01 12:14:44 +01:00
Mark Brown 7d83d21383 ASoC: Log WM8994 separate ADC LRCLKs every time we configure
This makes it that little bit easier to spot the diagnostics in the
logs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-23 13:31:45 +01:00
Mark Brown ec62dbd7eb Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into for-2.6.37
Trivial overlap with the removal of the local revision variable.

Conflicts:
	sound/soc/codecs/wm8994.c
2010-08-15 14:56:40 +01:00
Mark Brown b6b056911a ASoC: Only tweak WM8994 chip configuration on devices up to rev D
Any subsequent revisions will have these configuration changes applied
by default.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-13 14:55:13 +01:00
Mark Brown 0c17b39394 ASoC: Optimise DSP performance for WM8994
Change the chip defaults to optimise performance of some of the DSP
functionality.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-13 14:55:01 +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
Mark Brown d1ce6b200c ASoC: Unconditionally enable WM8994 AIF1ADC TDM mode
AIF1ADC TDM mode has no effect other than causing the ADCDAT line to
be tristated rather than driven low on clock cycles where there is no
data to be transmitted. If the clock cycle is idle then there should
be no devices using the data so tristating should have no adverse
effects.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-20 10:27:05 +01:00
Mark Brown a3257ba869 ASoC: Implement WM8994 AIF1ADC2 paths
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-20 09:48:25 +01:00
Mark Brown 66b47fdb85 ASoC: Implement WM8994 OPCLK support
The WM8994 can output a clock derived from its internal SYSCLK, called
OPCLK.  The rate can be selected as a sysclk, with a division from the
SYSCLK rate specified (multiplied by 10 since a division of 5.5 is
supported) and the clock can be disabled by specifying a divisor of
zero.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-09 08:50:12 +09:00
Mark Brown e88ff1e6db ASoC: Include WM8994 GPIO and interrupt registers in codec_reg
Very handy for debug.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-09 01:37:06 +09: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
Mark Brown 6a2f1ee1f9 ASoC: Don't restart unconfigured WM8994 FLLs
If the FLL is not configured attempting to resume it will produce a
warning message so skip the resume.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-11 14:18:52 +01:00
Mark Brown fd5722e5cd ASoC: Add register write logging for WM8994
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-11 14:18:18 +01:00
Mark Brown 5e5e2bef28 ASoC: Warn on low WM8994 AIFCLK
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-26 15:26:13 +01:00
Mark Brown 7add84aa77 ASoC: Allow unspecified source when stopping WM8994 FLLs
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-22 02:29:01 +09:00
Mark Brown ee839a2127 ASoC: Tone down debugging for WM8994 class W
It's a little verbose during path changes.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-21 01:41:28 +09:00
Mark Brown 7d48a6acbc ASoC: Set full range of WM8994 FLL Fratio values
Use all the available Fratio values when configuring the WM8994 FLL, not
just 0 and 3, following more complete characterisation of the device
performance.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-21 01:41:27 +09:00
Mark Brown 136ff2a272 ASoC: Support FLL input clock selection on WM8994
The WM8994 FLL can be clocked from one of four inputs, the two MCLKs and
the LRCLK and BCLK of the AIF associated with the FLL. Allow all four
inputs to be used rather than defaulting to MCLK1.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-21 01:41:26 +09: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
Linus Torvalds 84db18bbeb 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:
  ALSA: mixart: range checking proc file
  ALSA: hda - Fix a wrong array range check in patch_realtek.c
  ALSA: ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream
  ALSA: hda - Enable amplifiers on Acer Inspire 6530G
  ASoC: Only do WM8994 bias off transition from standby
  ASoC: Don't use DCS_DATAPATH_BUSY for WM hubs devices
  ASoC: Don't do runtime wm_hubs DC servo updates if using offset correction
  ASoC: Support second DC servo readback method for wm_hubs
  ASoC: Avoid wraparound in wm_hubs DC servo correction
  ALSA: echoaudio - Eliminate use after free
  ALSA: i2c: cleanup: change parameter to pointer
  ALSA: hda - Add MSI blacklist for Aopen MZ915-M
  ASoC: OMAP: Fix capture pointer handling for OMAP1510 to work correctly with recent ALSA PCM code
  ALSA: hda - Update document about MSI and interrupts
  ALSA: hda: Fix 0 dB offset for Lenovo Thinkpad models using AD1981
  ALSA: hda - Add missing printk argument in previous patch
  ASoC: Fix passing platform_data to ac97 bus users and fix a leak
  ALSA: hda - Fix ADC/MUX assignment of ALC269 codec
  ALSA: hda - Fix invalid bit values passed to snd_hda_codec_amp_stereo()
  ASoC: wm8994: playback => capture
2010-04-07 08:42:25 -07: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
Mark Brown 8876698406 ASoC: Implement interrupt based WM8994 microphone detection
Support interrupt based microphone bias detection. The WM8994 has two
microphone bias supplies, with detection supported on both. Detection
using GPIOs together with the standard GPIO based jack framework is
already supported via the platform data for the WM8994 core driver.

Note that as well as the microphone bias itself the system clock and
whichever AIF clock is supplying the system clock will need to be
enabled for detection to function.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-05 19:18:12 +01:00
Mark Brown d522ffbfb9 ASoC: Only do WM8994 bias off transition from standby
Otherwise we may try to power down multiple times when the using
idle bias off and the driver is removed.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-05 16:20:49 +01:00
Mark Brown 8437f7006b ASoC: Support second DC servo readback method for wm_hubs
More recent Wolfson hubs devices add the ability to read back the DC
servo calibration information from the register used to write offsets,
and later still ones remove the old readback registers. Add support
for the new scheme, and use it for WM8994 device revisions that
support it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-05 16:19:09 +01:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Mark Brown 2c9504228f Merge branch 'for-2.6.34' into for-2.6.35 2010-03-29 21:03:20 +01:00
Dan Carpenter a8462bde78 ASoC: wm8994: playback => capture
Sparse caught that initialize "playback" two times instead of
initializing "capture".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-03-24 14:05:28 +00:00
Mark Brown 778a76e2db ASoC: Implement WM8994 DAI tristate support
This also adds the first DAI operation for AIF3 so fill out the ID and
the ops for that too.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-23 10:57:11 +00:00
Joonyoung Shim 07cd8ada1a ASoC: Fix BCLK calculation of WM8994
This fixes BCLK calculation and removes unnecessary check code.

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>
2010-02-02 11:21:11 +00:00
Mark Brown 9e6e96a197 ASoC: Add WM8994 CODEC driver
The WM8994 is a highly integrated ultra-low power hi-fi audio subsystem
designed for smartphones and other portable devices rich in multimedia
features.  It provides advanced digital mixing facilities enabling low
power high quality interconnection of CPU, baseband and other audio
sources through flexible digital and analogue routing, and integrates
a class W headphone driver and stereo class D speaker drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-02-01 18:37:01 +00:00