Commit Graph

493 Commits

Author SHA1 Message Date
Janusz Krzysztofik 459dc35233 ASoC: Add support for Conexant CX20442-11 voice modem codec
This patch adds support for Conexant CX20442-11 voice modem codec, suitable
for use by the ASoC board driver for Amstrad E3 (Delta) videophone. Related
sound card driver will follow.

This codec is an optional part of the Conexant SmartV three chip modem design.
As such, documentation for its proprietary digital audio interface is not
available. However, on Amstrad Delta board, thanks to Mark Underwood who
created an initial, omap-alsa based sound driver a few years ago[1], the codec
has been discovered to be accessible not only from the modem side, but also
over the OMAP McBSP based CPU DAI. Thus, the driver can be used by any sound
card that can access the codec DAI directly. The DAI configuration parameters
(sample rate and format, number of channels) has been selected out empirically
for best user experience.

The codec analogue interface consists of two pairs of analogue I/O pins:
speakerphone interface or telephone handset/headset interface. Furthermore, it
seams to provide two operation modes for speakerphone I/O: standard and
advanced, with automatic gain control and echo cancelation. Even if the codec
control interface is unknown and not available, all those interfaces and modes
can be selected over the modem chip using V.253 commands. The driver is able
to issue necessary commands over a suitable hw_write function if provided by a
sound card driver. Otherwise, the codec can be controlled over the modem from
userspace while inactive.

Even if nothig is known about the codec internal power management
capabilities, DAPM widgets has been used to model the codec audio map.
Automatically performed powering up/down of those virtual widgets results in
corresponding V.253 commands being issued.

Some driver features/oddities may be board specific, but I have no way to
verify that with any board other than Amstrad Delta.

[1] http://www.earth.li/pipermail/e3-hacking/2006-April/000481.html

Created and tested against linux-2.6.31-rc3.
Applies and works with linux-omap-2.6 commit
7c5cb7862d32cb344be7831d466535d5255e35ac as well.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-23 11:08:29 +01:00
Mark Brown c30853df98 Merge branch 'for-2.6.31' into for-2.6.32 2009-07-23 08:22:58 +01:00
Chaithrika U S 06c71282a9 ASoC: tlv320aic3x: Enable PLL when not bypassed
PLL was not being enabled when it was not bypassed. This patch
enables the PLL when it is used. Additionally, it disables the PLL
when it is bypassed.

Without this patch, the audio on TI DM646x EVM and DM355 EVM
does not work properly. The bit clocks and the frame sync signals
from the codec are not correct and hence the playback/record are faster
than usual for most sample rates. The reason for this was that the PLL
was not enabled when it was not bypassed.

Tested on DM6467 EVM, playback tested on DM355 EVM.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-23 08:14:29 +01:00
Joonyoung Shim e458a48f87 ASoC: MAX9877: separate callback functions
The callback function to control register was used by whole controls in
MAX9877 driver, but this causes using many if statement for double
register control or invert.
So, the callback function for double register control is separate
differently, and the code for invert is added in the callback function.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 11:02:49 +01:00
javier Martin 25cbf46520 ASoC: Correct a bug with "ADC Inversion Switch" in wm8974 codec.
This corrects a bug with ADC Inversion Switch in wm8974 codec.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-22 00:13:27 +01:00
Mark Brown bca146578c ASoC: Fix checkpatch issues in AD1938
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-18 11:09:42 +01:00
Mark Brown 0c11f65555 ASoC: Fix FLL reference clock division setup in WM8993
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-17 22:13:01 +01:00
Mark Brown 8aa2df5308 ASoC: Bodge around GCC 4.4.0 flow analysis bug in GCC 4.4.0
GCC 4.4.0 doesn't appear to be able to spot that we don't apply any FLL
configuration if the output frequency is zero.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-17 21:53:49 +01:00
Takashi Iwai 416c8fe3cd ASoC: Kill direct accesses to driver_data
Replaced with dev_{get|set}_drvdata().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-17 07:48:03 +02:00
Barry Song 1274738d85 ASoC: new ad1938 codec driver based on asoc
Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-16 11:14:39 +01:00
Joonyoung Shim 9db9ed977d ASoC: MAX9877: add MAX9877 amp driver
The MAX9877 combines a high-efficiency Class D audio power amplifier
with a stereo Class AB capacitor-less DirectDrive headphone amplifier.

The max9877_add_controls() is called to register the MAX9877 specific
controls on machine specific init() of the machine driver.

The datasheet for the MAX9877 can find at the following url:
http://datasheets.maxim-ic.com/en/ds/MAX9877.pdf

[Slight edit to sort the ALL_CODECS entries -- broonie.]

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-15 16:59:31 +01:00
Mark Brown 4b75e94767 ASoC: Error out if we can't determine a suitable WM9081 sysclk
Due to the flexibility of the WM9081 FLL this should never happen
in a real system.

Reported-by: Jaswinder Singh Rajput <jaswinder@kernel.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-15 11:03:51 +01:00
Mark Brown e465d544fa ASoC: Fix sample rate lookup in WM8993
We need to use the best value we picked, not the last value we
looked at.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-15 10:01:30 +01:00
Kevin Hilman 0a0cf58d93 ASoC: spdif: set module licence to GPL
Without MODULE_LICENCE("GPL"), when built as a module it will fail
to load because it uses other GPL symbols from kernel.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-13 23:01:30 +01:00
Kevin Hilman a27e304b5c ASoC: spdif codec: enable use by modules
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-13 23:01:30 +01:00
Roel Kluin 33e319fba7 ASoC: Keep index within stac9766_reg[]
Keep index within stac9766_reg[]

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-13 10:32:18 +01:00
Greg Kroah-Hartman 864e1e8db4 Sound: remove direct access of driver_data
This is the last in-kernel direct usage of driver_data, replace it with
the proper dev_get/set_drvdata() calls.

Cc: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@perex.cz>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-07-12 13:02:10 -07:00
Mark Brown 030c819e79 Merge branch 'tlv320aic3x' into reg-cache 2009-07-10 21:06:33 +01:00
Mark Brown cc369cf504 ASoC: WM8510 has a single frame clock so needs symmetric rates
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-09 11:28:07 +01:00
Mark Brown 4934482d93 ASoC: Limit WM8731 to symmetric rates
While the hardware is capable of some limited asynmmetric modes the
driver does not currently support those modes so tell applications
that only symmetric rates are available.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-08 17:48:12 +01:00
Mark Brown 942c435ba7 ASoC: Add WM8993 CODEC driver
The WM8993 is a highly integrated ultra-low power hi-fi CODEC designed
for portable devices such as multimedia phones.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-08 17:20:20 +01:00
Mark Brown ef38ed888e ASoC: Correct WM8731 Mic Capture Switch control name
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-08 17:18:28 +01:00
Mark Brown d00efa648d ASoC: Add TLV information for WM8731
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-08 17:08:40 +01:00
Mark Brown 4ec5c9693b Merge branch 'for-2.6.31' into for-2.6.32 2009-07-06 21:49:35 +01:00
Mark Brown f6f1eb1033 ASoC: Factor out WM8580 register cache code
Note the slightly tricky cache usage in the volume update function due
to the requirement for a separate write for the VU bit.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-05 17:57:57 +01:00
Mark Brown 5f345346dd ASoC: Remove use of hw_read from TLV320AIC3x driver
The TLV320AIC3x driver is currently the only user of the CODEC hw_read
operation and is jumping through some hoops in order to do so.  In order
to support future refactoring to make the hw_read operation more usable
unwrap the usage in this driver to avoid its use.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-05 17:35:28 +01:00
Mark Brown 1e30a5828e ASoC: Remove unused AK4535 hardware read functionality
Nothing uses it and the existing hw_read operation needs to be
refectored so it's easier to remove it rather than work with it.
Support can be re-added if the code requires volatile registers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-05 17:28:41 +01:00
Mark Brown 17a52fd60a ASoC: Begin to factor out register cache I/O functions
A lot of CODECs share the same register data formats and therefore
replicate the code to manage access to and caching of the register
map. In order to reduce code duplication centralised versions of
this code will be introduced with drivers able to configure the use
of the common code by calling the new snd_soc_codec_set_cache_io()
API call during startup.

As an initial user the 7 bit address/9 bit data format used by many
Wolfson devices is supported for write only CODECs and the drivers
with straightforward register cache implementations are converted to
use it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-05 17:24:50 +01:00
Mark Brown 5420f30723 ASoC: Fix leaks in WM8988 registration error handling
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-05 16:29:39 +01:00
Mark Brown 1a01417e85 ASoC: Fix WM8960 leaks on probe failure
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-05 15:47:03 +01:00
Mark Brown fe5422fc4a ASoC: Fix leaks in WM8731 probe error handling
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-05 15:18:01 +01:00
Lars-Peter Clausen 637a935aab ASoC: Fix wm8753 register cache size and initialization
Register cache space was not being allocated for the final register,
causing bugs when it was used.  Allocate space for it.

Also ensure that the final register is displayed in sysfs.

[Commit message rewritten to document actual issue. -- broonie]

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-03 14:35:49 +01:00
Lopez Cruz, Misael 6814044324 ASoC: TWL4030: Add tristate callbacks for HiFi and Voice
Add "set_tristate" callbacks for HiFi and Voice DAIs.
Machine drivers can enable and disable tristate for each
DAI with "snd_soc_dai_set_tristate" function.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-03 11:01:05 +01:00
Mark Brown 1df892cba4 ASoC: Fix register cache initialisation for WM8753
The wrong register cache variable was being used to provide the size for
the memcpy(), resulting in a copy of only a void * of data.

Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2009-07-03 10:41:45 +01:00
Candelaria Villareal, Jorge 4e49ffd10f ASoC: TWL4030: Add EXTMUTE to reduce pop-noise effect
According to TRM, an external FET controlled by a 1.8V output signal
can be used to reduce the pop-noise heard when the audio amplifier is
switched on. It is suggested that GPIO6 of TWL4030 be used, but any
other gpio can be used instead. This is indicated in machine driver
with the following twl4030_setup_data members:

-hs_extmute. Set to 1 if board has support for EXTMUTE.

-set_hs_extmute. Set to a callback funcion to control an external gpio
line. Set to NULL if MUTE[GPIO6] pin is used.

Codec driver takes care of enabling and disabling this output during
the headset pop attenuation sequence.

Also add a delay to let VMID settle in ramp up sequence.

Signed-off-by: Jorge Eduardo Candelaria <x0107209@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-02 11:06:26 +01:00
Mark Brown 1dcf98ff8e ASoC: Add WM8523 CODEC driver
The WM8523 is a high performance stereo DAC with integral charge
pump providing 2Vrms line driver outputs using a single 3.3V power
supply rail.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-01 18:47:45 +01:00
Mark Brown 8a123ee2a4 ASoC: WM8974 DAPM cleanups
Also implement AUX mode control.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-30 21:30:42 +01:00
Mark Brown 8b83a19367 ASoC: WM8974 cosmetic cleanups
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-30 21:30:35 +01:00
Mark Brown cb11d39ead ASoC: Use symmetric rates for WM8974
The chip has a single LRCLK.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-30 21:30:25 +01:00
Mark Brown a5f8d2f1b8 ASoC: Add WM8974 TLV information
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-30 19:34:32 +01:00
Mark Brown 91d0c3ecba ASoC: Refresh WM8974 PLL configuration
Move away from a fixed table to runtime calculation.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-30 19:34:23 +01:00
Mark Brown 33d81af4d1 ASoC: Declare 2 channels for WM8974
The device is a mono device but it can read two channel data and
many I2S controllers only understand 2 channels.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-30 19:34:16 +01:00
Mark Brown df1ef7a38d ASoC: Refresh WM8974 bias configuration
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-30 19:34:09 +01:00
Mark Brown 9ea21ebca1 ASoC: Fix WM8961 suspend function type
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-29 16:34:57 +01:00
Mark Brown 372a14a4a4 ASoC: Remove unreferenced wm8974_add_controls()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-29 16:14:19 +01:00
Lopez Cruz, Misael e3c7dbb07c ASoC: Remove word "Switch" from Handsfree switch name
SoC dapm adds the suffix "Switch" to SND_SOC_DAPM_SWITCH controls,
removing word "Switch" from HandsfreeL/HandsfreeR widget name
for avoiding to duplicate it.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-26 10:39:52 +01:00
Mark Brown d5fc3b5fe3 Merge branch 'for-2.6.31' into for-2.6.32 2009-06-25 13:58:37 +01:00
Mark Brown e2f551dacb ASoC: Add core suspend and resume callbacks to WM8961
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-25 13:57:59 +01:00
Lopez Cruz, Misael 30808ca751 ASoC: TWL4030: Correct bypass event for voice sidetone
Event for voice sidetone was being interpreted as an
analog HiFi bypass event because VSTPGA register offset
is less than ARXR2_APGA_CTL offset. Reordering the
register checks allows to handle voice digital bypass
event properly.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-23 10:57:38 +01:00
Lopez Cruz, Misael 328d0a138e ASoC: TWL4030: Add AVADC Clock Priority
AVDAC clk priority allows to determine the path ADC must
be connected when the codec is in option2 and both HiFi
and Voice paths are enabled.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-23 10:57:37 +01:00
Lopez Cruz, Misael c264301c77 ASoC: TWL4030: Fix voice interface clock masters
Voice interface of twl4030 codec supports: CBM_CFM and
CBS_CFS. It doesn't support CBS_CFM.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-By: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-22 11:24:04 +01:00
Mark Brown e370f45aeb Merge branch 'wm8961' into for-2.6.32 2009-06-22 11:08:26 +01:00
Mark Brown 423c238d71 ASoC: Staticise put_twl4030_opmode_enum_double()
It's an operation for a control and doesn't need to be exported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-20 13:58:09 +01:00
Mark Brown b53109db5e ASoC: Fix shadowed variables in twl4030
No need to define second copies of mode and format, they're declared
with exactly the same type at the head of the function and there's no
conflict in their use.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-20 13:58:08 +01:00
Mark Brown a583cd5347 ASoC: Regulator support for WM8580
Add basic support for integration with the regulator API to WM8580.
Since the core cannot yet disable biases when the CODEC is idle we
simply request and enable the regulators for the entire time the
driver is active.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-17 17:33:01 +01:00
Philipp Zabel 1abd918499 ASoC: UDA1380: refactor device registration
This patch mostly follows commit 5998102b90
"ASoC: Refactor WM8731 device registration" to make UDA1380 use standard
device instantiation. Similarly, the I2C device registration temporarily
moves into the magician machine driver before it will find its final
resting place in the board file.

At the same time, platform specific configuration is moved to platform data
and common power/reset GPIO handling moves into the codec driver.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-15 21:54:48 +01:00
Mark Brown b3b50b3f31 ASoC: Add suspend and resume callbacks to Wolfson CODEC drivers
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-13 22:30:18 +01:00
Mark Brown 619439998a ASoC: Automatically manage WM8350 sloping stopband filter
For best performance the DAC sloping stopband filter should be enabled
below 24kHz and not enabled above that so remove the user visible
control for this and do it autonomously in the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-13 20:06:25 +01:00
Mark Brown 21002e2076 ASoC: Automatically manage WM8900 sloping stopband filter
For best performance the DAC sloping stopband filter should be
enabled below 24kHz and not enabled above that so remove the
user visible control for this and do it autonomously in the
driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-13 20:06:23 +01:00
Mark Brown 9e79261f30 ASoC: Automatically control WM8903 sloping stopband filter
For best performance the DAC sloping stopband filter should be
enabled below 24kHz and not enabled above that so remove the
user visible control for this and do it autonomously in the
driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-13 20:06:23 +01:00
Mark Brown 5ba73683ba ASoC: Revert duplicated code in SSM2602 driver
The Blackfin submission was done as a patch against a different tree
and contained a duplicate hunk which will cause us to loose track of the
substream pointers when shutting down.  Remove one of the duplicated
hunks.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-13 19:35:24 +01:00
Mark Brown ba2533a478 ASoC: Remove odd bit clock ratios for WM8903
These are not supported since performance can not be guaranteed
when they are in use.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2009-06-12 17:29:54 +01:00
Mark Brown 74dc55ed5b ASoC: Add WM8961 driver
The WM8961 is a low power, high quality stereo CODEC designed for
portable digital applications with headphone and stereo class D speaker
drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-12 17:16:06 +01:00
Troy Kisky ccff4b15e0 ASoC: codec tlv320aic23 fix bogus divide by 0 message
Some code analyzer software mistakenly gives
divide by 0 error messages for these lines.
This patch will end its confusion.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-06 09:24:48 +01:00
Takashi Iwai d08664fdb5 ASoC: Fix build error in twl4030.c
Fix the (likely cut-n-paste) error by commit
16a30fbb0d, which causes the error below:
  sound/soc/codecs/twl4030.c: In function 'twl4030_read_reg_cache':
  sound/soc/codecs/twl4030.c:152: error: 'cache' undeclared (first use in this function)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-04 10:01:11 +02:00
Cliff Cai f692fce0cf ASoC: SSM2602: assign last substream to the master when shutting down
Fixes crash when shutting down.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-03 11:38:23 +01:00
Cliff Cai 2552a710f4 ASoC: SSM2602: remove unsupported sample rates
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-03 11:25:51 +01:00
Peter Ujfalusi eaf1ac8bb5 ASoC: TWL4030: Check the interface format for 4 channel mode
In addition to the operating mode check, also check the
codec's interface format in case of four channel mode.
If the codec is not in TDM (DSP_A) mode, return with error.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-01 23:46:08 +01:00
Peter Ujfalusi 16a30fbb0d ASoC: TWL4030: Use reg_cache in twl4030_init_chip
Use the codec->reg_cache instead of the array directly
in twl4030_init_chip for setting the default values.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-29 11:02:48 +01:00
Mark Brown 203350c1a8 ASoC: Initialise dev for the dummy S/PDIF DAI
Also include the header to make sure the DAI is prototyped.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-28 18:54:52 +01:00
Chaithrika U S be461ba836 ASoC: Add dummy S/PDIF codec support
McASP on DM646x can operate in DIT (S/PDIF) where no codec is needed.
This patch provides stub codec that can be used in these configurations.
On DM646x EVM the McASP1 is connected to the S/PDIF out.

Signed-off-by: Steve Chen <schen@mvista.com>
Signed-off-by: Pavel Kiryukhin <pkiryukhin@ru.mvista.com>
Signed-off-by: Naresh Medisetty <naresh@ti.com>
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-28 14:48:38 +01:00
Roel Kluin 449bd54dcb ASoC: correct print specifiers for unsigneds
Unsigned variables should use `%u' rather than `%d'.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-28 10:20:26 +01:00
Peter Ujfalusi 0f89bdcac6 ASoC: TWL4030: HandsfreeL/R mute DAPM switch
Add DAPM switch for HeadsetL/R mute. Since all bits are are needed
for the HFL/R pop removal to work the switch is using the SW_SHADOW
no HW register for the HandsfreeL/R mute.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-25 11:54:14 +01:00
Peter Ujfalusi f3b5d3002d ASoC: TWL4030: Add shadow register
Shadow, non HW register for dealing with the HandsfreeL/R
muting.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-25 11:54:14 +01:00
Peter Ujfalusi 5a2e9a48b1 ASoC: TWL4030: Handsfree pop removal redesign
Move the HandsfreeL/R (IHFL/R) pop removal code from the DAPM_MUX_E
to a more appropriate DAPM_PGA_E widget.
Also fix the power-up sequence to match with the TRM.
The power-down sequence is not described in the TRM, so do it
in a way, which seams like the correct sequence.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-25 11:54:13 +01:00
Mark Brown 05e1efa2de ASoC: Fix minor issues in STAC9766 driver
Fairly minor issues:
 - Don't register the DAIs, it's not required for AC97 devices.
 - Make unexported functions static.
 - Wrap some excessively long lines.
 - Undo tab/space breakage.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-24 13:32:24 +01:00
Jon Smirl 3c166c7f18 ASoC: Codec for STAC9766 used on the Efika
Datasheet: http://www.idt.com/products/getDoc.cfm?docID=13134007

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-24 13:15:21 +01:00
Mark Brown 4fcbbb67a3 ASoC: Update WM8974 to use standard I2C device probe methods
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-23 16:43:12 +01:00
Mark Brown 1a55b3f6ed ASoC: WM8974 checkpatch cleanups
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-23 11:31:40 +01:00
Mark Brown 0a1bf55335 ASoC: Add WM8974 CODEC driver
The WM8974 is a low power, high quality mono CODEC designed for portable
applications such as digital still cameras or digital voice recorders.

This driver was originally written by Graeme Gregory and Liam Girdwood
and has since been maintained by myself with some updates contributed by
Brett Saunders and Javier Martin.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-23 11:28:03 +01:00
Mark Brown 0154724d48 ASoC: Fix WM9081 PowerPC compiler issues
Ensure that we always set a new sysclk when using the FLL in master mode
and pick out the correct value for the sample rate in hw_params().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-23 10:24:15 +01:00
Mark Brown 86ed3669f0 ASoC: WM9081 mono DAC with integrated 2.6W class AB/D amplifier driver
The WM9081 is designed to provide high power output at low distortion
levels in space-constrained portable applications.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-22 15:11:22 +01:00
Peter Ujfalusi b4852b793a ASoC: TWL4030: Differentiate the playback streams
Give unique stream names for the two playback streams so
DAPM can figure out which codec_dai is in use.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-22 15:08:43 +01:00
Peter Ujfalusi 9da28c7b38 ASoC: TWL4030: Add support for platform dependent configuration
twl4030_setup_data structure can be passed from platform drivers to
the codec via the snd_soc_device->codec_data pointer.

Currently the setup data has support for the Headset pop-removal
related configuration, which differs from board to board.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-22 10:23:22 +01:00
Peter Ujfalusi 6943c92e87 ASoC: TWL4030: Move the Headset pop-attenuation code to PGA event
This patch adds SND_SOC_DAPM_PGA_E to the headset path, which handles
the headset ramp up and down sequences needed for the pop noise
removal.

With this patch the order of the internal components in the twl4030
codec is turned on and off in a correct order.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Tested-by: Anuj Aggarwal <anuj.aggarwal@ti.com>
Tested-by: Jarkko Nikula <jhnikula@gmail.com>
Tested-by: Misael Lopez Cruz  <x0052729@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-20 09:53:25 +01:00
Peter Ujfalusi 4005d39a5f ASoC: TWL4030: Change DAPM routings and controls for DACs and PGAs
Restructuring the twl4030 codec's DAPM routing to be able to handle the power
sequences correctly.

The twl4030 codec internal implementation have this order:
DAC -> Analog PGA -> Mixer/Mux

While the ASoC framework expects the following order:
DAC -> Mixer -> Analog PGA

This patch moves the Analog PGA handling from SND_SOC_DAPM_PGA to _MIXER and
adds two levels of mixer to handle the digital and analog loopback
functionality.

Now the analog loopback does not powers on any of the DACs.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Tested-by: Anuj Aggarwal <anuj.aggarwal@ti.com>
Tested-by: Jarkko Nikula <jhnikula@gmail.com>
Tested-by: Misael Lopez Cruz  <x0052729@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-20 09:52:51 +01:00
Lopez Cruz, Misael b74bd40fa4 ASoC: TWL4030: Add control for selecting codec operation mode
Add a control for selecting the codec operation mode. TWL4030 codec
has two modes:
- Option 1. Audio only (4 audio DACs)
- Option 2. Voice/Audio (2 audio DACs and voice ADC/DAC)

Control is restricted when a stream is ongoing, since codec's
operation mode cannot be changed on-the-fly.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-by: Peter Ujflausi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-19 10:35:11 +01:00
Peter Ujfalusi 181da78cd0 ASoC: TWL4030: Fix Analog capture path for AUXR
AUXR is selected by bit 2 and not by bit 1 in the ANAMICR register.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-19 09:38:57 +01:00
Misael Lopez Cruz b7a755a8a1 ASoC: TWL4030: Enable/disable voice digital filters
Enable TWL4030 VTXL/VTXR and VRX digital filters for uplink
and downlink paths, respectively.

This patch also corrects voice 8/16kHz mode selection bit
(SEL_16K) of CODEC_MODE register.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-18 11:13:12 +01:00
Takashi Iwai 2baaec2806 ASoC: Add missing __devexit in wm8940.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-15 12:18:47 +02:00
Marek Vasut 63c26baa2a ASoC: Support AC97 link off by default on WM9712
The WM9712 can be configured by resistor strapping GPIO4 to behave like
the WM9713 and default to leaving the AC97 link disabled after cold
reset until a warm reset occurs.  In this configuration we need to issue
a warm reset after cold to bring the link up so do so.  The warm reset
will be harmless on systems that don't need it.

[Changelog rewritten to document the reasoning. -- broonie]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-14 20:52:46 +01:00
Joonyoung Shim 97b8096dc9 ASoC: TWL4030: change DAPM for analog microphone selection
The inputs of the twl4030 codec can be mixed, so we will use the mixer
DAPM for the analog microphone registers(0x05, 0x06), but if we enable
more than one input at the same time, the input impedance of the input
amplifier will be reduced.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-12 10:53:22 +01:00
Roel Kluin 31cb31f76e ASoC: remove driver_data direct access of struct device
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-11 22:09:22 +01:00
Peter Ujfalusi c198d81181 ASoC: TWL4030: Fix typo in twl4030_codec_mute function
Copy-paste error: TWL4030_PRECKL_GAIN >> TWL4030_PRECKR_GAIN
It has not caused problems, since
TWL4030_PRECKL_GAIN == TWL4030_PRECKR_GAIN == 0x30

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-08 12:00:12 +01:00
Daniel Mack 5e7c034425 ASoC: cs4270: add power management support
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-07 09:00:27 +01:00
Daniel Mack 80ab8817bf ASoC: cs4270: introduce CS4270_I2C_INCR
Replace the magic 0x80 value with a suitable macro definition.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-05 19:16:41 +01:00
Mark Brown b290750172 Merge branch 'for-2.6.30' into for-2.6.31 2009-05-05 10:13:01 +01:00
Peter Ujfalusi 376f7839b7 ASoC: TWL4030: Add VIBRA output
This patch adds support for the VIBRA output on TWL4030 codec.
The VIBRA output can be driven with audio data or with
local vibrator driver.
Add the needed DAPM elements and routes for the VIBRA output and
controls for the VIBRA driver configuration.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-05 10:12:45 +01:00
Lopez Cruz, Misael ee8f6894f3 ASoC: TWL4030: Add voice digital loopback: sidetone
This patch add voice digital loopback (sidetone) to the twl4030
driver. It mixes voice uplink attenuated (by sidetone gain) with
voice downlink when the codec is working in option2 (voice/audio
mode).

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-05 10:12:20 +01:00
Lopez Cruz, Misael fcd274a345 ASoC: TWL4030: Add VDL analog bypass
This patch adds voice downlink analog bypass switch. It follows
the same approach as in other analog bypass switches.
DAC switch is moved from 'DAC Voice' to 'Analog Voice Playback Mixer',
that will also allow voice DAC to be powered in digital voice
loopback (sidetone).

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-05-05 10:12:14 +01:00