Commit Graph

1944 Commits

Author SHA1 Message Date
Axel Lin 24441e17fe ASoC: ak4641: Use SND_SOC_DAPM_DAC for Voice Playback stream widget
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 18:01:43 +01:00
Ashish Chavan de5eaf844e ASoC: da7210: Add support for ALC and Noise suppression
This patch adds controls to set following ALC parameters,
 - Max gain, Min gain, Noise gain, Attack rate, Release rate and delay

It also adds a switch to enable/disable noise suppression.

As per DA7210 data sheet, ALC and noise suppression can be enabled
only if certain conditions are met. This condition checks are handled
by simply using "_EXT" version of controls to capture change events.

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Acked-by: Liam Girdwod <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 17:59:08 +01:00
Ashish Chavan 5eda19497b ASoC: da7210: Add support for mute and zero cross controls
This patch adds support for below set of controls,
(1) Mute controls for MIC, AUX and ADC
(2) Zero cross controls for head phone, AUX, INPGA and line out
(3) Head phone mode selection - class H or G

It also adds digital_mute() call back.

Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 17:58:58 +01:00
Axel Lin 812b404c90 ASoC: ak4641: Remove unused codec field from struct ak4641_priv
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 17:58:49 +01:00
Axel Lin 2ee9c183f3 ASoC: ssm2602: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 15:22:01 +01:00
Mark Brown f8faadb6f2 ASoC: WM9081 interrupt status register is volatile
Not that we have interrupt handling in the driver at the minute.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-10-19 13:10:01 +01:00
Axel Lin dc56c5a862 ASoC: sgtl5000: Fix setting mic bias resistor
According to the datasheet:
CHIP_MIC_CTRL 0x002A

BITS[9:8] BIAS_RESISTOR
        0x0 = Powerd off
        0x1 = 2.0 kohm
        0x2 = 4.0 kohm
        0x3 = 8.0 kohm

To set mic bias resistor, we need to update bits[9:8] of
SGTL5000_CHIP_MIC_CTRL register.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 13:08:39 +01:00
Axel Lin 56c09aa520 ASoC: sgtl5000: Fix define for SGTL5000_BIAS_R_MASK
According to the datasheet:
CHIP_MIC_CTRL 0x002A

BITS[9:8] BIAS_RESISTOR
        0x0 = Powerd off
        0x1 = 2.0 kohm
        0x2 = 4.0 kohm
        0x3 = 8.0 kohm

Thus SGTL5000_BIAS_R_MASK should be defined as 0x0300 instead of 0x0200.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 13:08:18 +01:00
Axel Lin 54c96cfd1a ASoC: ad193x: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Barry Song <21cnbao@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-19 12:07:43 +01:00
Mark Brown 680fa1f807 ASoC: Convert WM9081 to table based control init
At least for the core controls, the optionally selected controls are still
added programatically.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-10-18 11:16:15 +01:00
Mark Brown 6473a14805 ASoC: Update WM1811 DCS codes for latest evaluation results
Evaluation of larger quantities of material has provided new DCS codes
values to be applied for WM1811.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-10-18 11:15:36 +01:00
Axel Lin a6785d7df8 ASoC: wm8580: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:49:28 +01:00
Axel Lin 29c6a01df8 ASoC: wm8900: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:49:28 +01:00
Axel Lin de5035b1dd ASoC: wm8900: Fix the mask defines
Now we have done bitwise NOT against the mask bits for the defines of
WM8900_REG_CLOCKING1_BCLK_MASK,
WM8900_REG_CLOCKING1_OPCLK_MASK and WM8900_LRC_MASK.

But we don't have the bitwise NOT against the mask bits for the defines of
WM8900_REG_CLOCKING2_DAC_CLKDIV,
WM8900_REG_CLOCKING2_ADC_CLKDIV and WM8900_REG_DACCTRL_AIF_LRCLKRATE.

It is error prone to mix the inconsistent meaning for different mask defines.
So lets make the defines for each mask to be corresponding to the bits
defines in datasheet. Don't add extra "bitwise NOT" to the defines.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:49:28 +01:00
Axel Lin 151b75995a ASoC: wm8900: Fix wrong mask for setting DAC_CLKDIV/ADC_CLKDIV/LRCLK_MODE
After checking the datasheet, I think what we want to do here is to
clear the WM8900_REG_CLOCKING2_DAC_CLKDIV/WM8900_REG_CLOCKING2_ADC_CLKDIV/
WM8900_REG_DACCTRL_AIF_LRCLKRATE bits and then OR with div value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:49:28 +01:00
Axel Lin df3431b74e ASoC: wm8741: Use snd_soc_cache_sync to sync reg_cache with the hardware
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-17 22:47:01 +01:00
Axel Lin 3a340104fa ASoC: wm8741: Fix setting interface format for DSP modes
According to the datasheet:
Format Control (05h)
BITS[3:2]
        FMT[1:0] Audio data format selection
                00 = right justified mode
                01 = left justified mode
                10 = I2S mode
                11 = DSP mode
BIT[4]  LRP Polarity selec for LRCLK/DSP mode select
                0 = normal LRCLK poalrity/DSP mode A
                1 = inverted LRCLK poarity/DSP mode B

For SND_SOC_DAIFMT_DSP_A, we should set 0x000C instead of 0x0003.
For SND_SOC_DAIFMT_DSP_B, we should set 0x001C instead of 0x0013.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-17 22:46:41 +01:00
Ashish Chavan 4ced2b96f3 ASoC: da7210: Add support for High pass and Voice filters for ADC and DAC
This patch add controls for setting cut-off for high pass and voice
filters of ADC and DAC. There are also switches to enable/disable
these filters.

Also removed hard coded, fixed  values of these parameters used by
previous version of driver.

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>
2011-10-17 22:43:33 +01:00
Ashish Chavan 0ee6e9e721 ASoC: da7210: Add support for ADC & DAC equalizers
This patch adds support for ADC and DAC five band equalizers
available on DA7210 codec.

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>
2011-10-17 22:43:32 +01:00
Peter Ujfalusi 35dec69757 ASoC: twl6040: Request core to inline the DAPM sequence
We need to have as less time between McPDM shutdown,
and power down of the DAC on the twl6040 codec as possible.
Request core to ignore the pmdown_time for the playback
stream.
Backround: with the McPDM protocol we are sendning not only
the pure audio stream, but OMAP McPDM also transmits
additional information (for example offset cancellation).
If McPDM is stopped prior to the DAC this information will
be not sent to the codec, which can result noise rendered
by the twl6040 codec.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:42:21 +01:00
Ashish Chavan 7a0e67b687 ASoC: da7210: bugfix for head phone volume control
This patch takes care of reserved bits of headphone volume
register by using correct volume range.

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>
2011-10-14 20:29:31 +01:00
Axel Lin f3aa7219b1 ASoC: ad193x: Fix define of AD193X_PLL_INPUT_MASK
Current code defines AD193X_PLL_INPUT_MASK as (~0x6) which is quite
different from other MASK defines.
To make it consistent with other mask defines, define AD193X_PLL_INPUT_MASK
as 0x6 and change the code accordingly.
I think this change improves the readability.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin 79d0726513 ASoC: wm8990: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

This patch also includes a comment fix in wm8990_set_dai_pll(),
if freq_in and freq_out are 0, what we do is to clear WM8990_PLL_ENA bit.
Thus the comment should be "Turn off PLL".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin 790f932500 ASoC: wm8990: Fix wrong bit setting for WM8990_POWER_MANAGEMENT_2
If (fakepower & ((1 << WM8990_INMIXR_PWR_BIT) | (1 << WM8990_AINRMUX_PWR_BIT)))
is false, we should clear WM8990_AINR_ENA bits instead of WM8990_AINL_ENA.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin 1a8e8d2234 ASoC: wm8400: Fix wrong bit setting for WM8400_POWER_MANAGEMENT_2
If (fakepower & ((1 << WM8400_INMIXR_PWR) | (1 << WM8400_AINRMUX_PWR)))
is false, we should clear WM8400_AINR_ENA bits instead of WM8400_AINL_ENA.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin c639adc68f ASoC: wm8991: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:05 +01:00
Axel Lin 3f387a2170 ASoC: wm8991: Fix wrong bit setting for WM8991_POWER_MANAGEMENT_2
If (fakepower & ((1 << WM8991_INMIXR_PWR_BIT)|(1 << WM8991_AINRMUX_PWR_BIT))))
is false, we should clear WM8991_AINR_ENA bits instead of WM8991_AINL_ENA.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Axel Lin 370f464533 ASoC: wm8961: Convert codec->hw_read to snd_soc_read
codec->hw_read is broken now, let's covert to snd_soc_read.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Axel Lin 38c436aa9f ASoC: tlv320aic3x: Convert codec->hw_read to snd_soc_read
codec->hw_read is broken now, let's covert to snd_soc_read.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Axel Lin 524205ce71 ASoC: alc5623: Convert codec->hw_read to snd_soc_read
codec->hw_read is broken now, let's covert to snd_soc_read.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Axel Lin f9dfbf91cb ASoC: tlv320aic23: convert to soc-cache
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:29:04 +01:00
Mark Brown a6f096f3b6 ASoC: Convert DA7210 to table based DAPM init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-14 20:18:49 +01:00
Axel Lin bc6ae96a44 ASoC: tlv320aic32x4: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:38:36 +01:00
Peter Ujfalusi 694b00010b ASoC: twl6040: Rename the Earphone Driver event handler
Since the event handler is only used by the Earphone Driver, it is better
to rename it from twl6040_power_mode_event to twl6040_ep_drv_event.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:19:40 +01:00
Peter Ujfalusi aa1a41082f ASoC: twl6040: Change event ordering for Earphone driver
It is better to switch HS Power Mode (if it was in low power mode) before
we enable the Earpiece driver. The switched off EP driver can filter out
noise coming from the Low Power to High Performance transition on the
HSL DAC.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:19:40 +01:00
Peter Ujfalusi fac2f3e4dc ASoC: twl6040: Remove PLL usage restrictions
There is no limitation dictated by outputs or inputs regarding to the
selected PLL (LP/HP).
Remove the checks for this, and allow all path with any PLL configuration.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:19:39 +01:00
Peter Ujfalusi f872826e94 ASoC: twl6040: Remove Capture restriction for 17.64MHz sysclk
Capture is supported in all PLL configuration.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 17:19:39 +01:00
Mark Brown 1cba77c163 ASoC: Update WM5100 accessory detection for revision A
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 12:20:24 +01:00
Axel Lin 7c04241acb ASoC: ak4535: fixup cache register table
ak4535_reg should be 8bit, but cache table is defined as 16bit.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-13 11:59:20 +01:00
Kuninori Morimoto 19b115e523 ASoC: ak4642: fixup cache register table
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
2011-10-13 11:58:10 +01:00
Axel Lin edf413f689 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>
2011-10-13 11:50:05 +01:00
Axel Lin f0bbc2b55f ASoC: sta32x: Set reg_cache_default to sta32x_regs
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13 11:50:05 +01:00
Ashish Chavan 0f8ea586d7 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>
2011-10-12 15:57:06 +01:00
Peter Ujfalusi 33b6816ca3 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>
2011-10-12 13:11:54 +01:00
Peter Ujfalusi 67c341302f 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>
2011-10-12 11:48:52 +01:00
Axel Lin 40a4971010 ASoC: da7210: convert to soc-cache
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 11:25:59 +01:00
Axel Lin 48df93d4c7 ASoC: Remove impossible case from wm8994_hw_params
We set hw_params callback for wm8994_aif3_dai_ops to wm8994_aif3_hw_params.
Thus no need to check wm8994-aif3 in wm8994_hw_params.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 11:25:58 +01:00
Axel Lin 75b9a5782e ASoC: Delete ads117x.h
This is not required after multi-component patch.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 11:25:58 +01:00
Axel Lin b91470bb37 ASoC: ak4642: convert to soc-cache
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-12 11:21:12 +01:00
Mark Brown ba896ede9a 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>
2011-10-11 18:59:01 +01:00
Mark Brown 3a53d82729 ASoC: Add missing default for WM5100 Clocking 1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 18:25:11 +01:00
Wolfram Sang 684a65d4fb 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>
2011-10-11 14:32:22 +01:00
Peter Ujfalusi 8066eb55b5 ASoC: tlv320dac33: Convert to table based init
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 14:32:22 +01:00
Peter Ujfalusi f7c93f018d ASoC: twl4030: Convert to table based init
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 14:32:22 +01:00
Peter Ujfalusi a175fce01b ASoC: twl6040: Convert to table based init
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-11 14:32:22 +01:00
Axel Lin 6f25e4eed9 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>
2011-10-11 14:32:22 +01:00
Axel Lin 3b18450371 ASoC: ak4535: convert to soc-cache
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:59 +01:00
Axel Lin fa5fdb473e ASoC: wm8988: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:59 +01:00
Axel Lin 0bad3d8453 ASoC: wm8974: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:59 +01:00
Axel Lin e46199ece4 ASoC: wm8971: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:58 +01:00
Axel Lin bc45df2dd9 ASoC: wm8960: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:58 +01:00
Axel Lin 788b6e8efa ASoC: wm8940: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:58 +01:00
Axel Lin abe11d0aac ASoC: wm8776: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:58 +01:00
Axel Lin 4d4adfc979 ASoC: wm8750: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:57 +01:00
Axel Lin 9bf311fe17 ASoC: wm8731: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:57 +01:00
Axel Lin 960622da0d ASoC: wm8711: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:57 +01:00
Axel Lin 94f17e9cfa ASoC: wm8510: Convert to snd_soc_cache_sync
Convert to snd_soc_cache_sync for sync reg_cache with the hardware.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-10 10:29:56 +01:00
Mark Brown 25c77c5fae ASoC: Fix DAPM sync for TLV320AIC3x custom DAPM widget
We really should be doing this in the core, not in a driver...

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
2011-10-10 10:28:26 +01:00
Mark Brown 4f6d45f121 Merge branch 'for-3.1' into for-3.2 2011-10-06 20:03:18 +01:00
Axel Lin ac60155f7a 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>
2011-10-06 20:02:56 +01:00
Axel Lin 3c08600144 ASoC: wm8990: Remove incorrect comments
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 20:02:56 +01:00
Axel Lin 416a0ce5f2 ASoC: wm8990: Convert to snd_soc_cache_sync for sync reg_cache with the hardware
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 20:02:55 +01:00
Wolfram Sang 23524eb16a 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>
2011-10-06 20:00:11 +01:00
Peter Ujfalusi c4671a9585 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>
2011-10-06 11:16:08 +01:00
Mark Brown 9a185b9aba ASoC: Remove references to linux@wolfsonmicro.com
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06 11:10:01 +01:00
Axel Lin 698570062d 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>
2011-10-05 17:16:58 +01:00
Peter Ujfalusi a0acf47f1b ASoC: twl6040: Warn user in twl6040_put_volsw for error case
Let the user know, that the callback has been called with unexpected
register parameter.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:10 +01:00
Peter Ujfalusi db382da5ff ASoC: twl6040: Simply call snd_soc_put_volsw form the custom code
The ASoC core now have one callback function, which can handle
single, and double register mixer controls.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:10 +01:00
Peter Ujfalusi 08a1ed76f5 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>
2011-10-05 17:10:09 +01:00
Peter Ujfalusi e49b68339e 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>
2011-10-05 17:10:09 +01:00
Peter Ujfalusi 0f9887d11e ASoC: Consolidate use of controls with custom get/put function
Use the macros for controls require custom get/put function.
This is to make sure that the soc_mixer_control is used
consistently among the drivers.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Arun KS <arunks@mistralsolutions.com>
Cc: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05 17:10:08 +01:00
Mark Brown 38f3f31a0a ASoC: Remove direct register cache accesses from WM8962 driver
Also fix return values for speaker switch updates.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-04 16:50:09 +01:00
Peter Ujfalusi bfd3d4e9fb ASoC: twl6040: Simplify custom put_volsw callback
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>
2011-10-04 16:28:29 +01:00
Axel Lin 672f4c4d75 ASoC: Remove unneeded hw_write initialisation in wm8523
It is not required after commit 8d50e447
"ASoC: Factor out I/O for Wolfson 8 bit data 16 bit register CODECs"

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:06:23 +01:00
Axel Lin 499cb184e2 ASoC: Remove unneeded hw_write initialisation in ak4671
It is not required now.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:06:23 +01:00
Axel Lin d434bc32d0 ASoC: wm8711: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:05:13 +01:00
Axel Lin 696f9175fc ASoC: wm8988: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:05:12 +01:00
Axel Lin f5b00d024f ASoC: wm8750: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:05:11 +01:00
Axel Lin 1a3bbb40da ASoC: Avoid writing to WM8971_RESET in wm8971_resume
Writing to WM8971_RESET resets all registers to the default state.
Thus we should avoid writing to WM8971_RESET on resume.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 16:04:30 +01:00
Mark Brown 5d224e8f18 Merge branch 'for-3.1' into for-3.2 2011-10-04 15:44:43 +01:00
Axel Lin c527e6aadc ASoC: wm8994: Fix setting rate_reg for wm8994-aif2
For wm8994-aif2, the rate_reg should be WM8994_AIF2_RATE.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-04 15:43:29 +01:00
Axel Lin 734787550a ASoC: wm8995: Slightly optimize configure_clock
snd_soc_update_bits() will only write new register value
if the old value is different from the new value.
In additional, snd_soc_update_bits() returns 0 for no change.
No need to read WM8995_CLOCKING_1 register before calling snd_soc_update_bits().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 13:09:55 +01:00
Axel Lin 04f45c493a ASoC: wm8994: Slightly optimize configure_clock
snd_soc_update_bits() will only write new register value
if the old value is different from the new value.
In additional, snd_soc_update_bits() returns 0 for no change.
No need to read WM8994_CLOCKING_1 register before calling snd_soc_update_bits().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 13:09:55 +01:00
Axel Lin 9cd113261b ASoC: wm8988: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 12:03:49 +01:00
Axel Lin c6d43417dd ASoC: wm8971: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 12:03:49 +01:00
Axel Lin 11b9ce622a ASoC: wm8711: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 12:03:48 +01:00
Ryan Mallon c855a1a7ff ASoC: max98095 codec: Catch driver bugs for biquad channel name
Move the biquad channel names to a separate array and iterate over it in
max98095_get_bq_channel rather than duplicating the hardcoded channel
names. Add an error message if an invalid channel is passed and check
the error in the callers.

Also added a BUILD_BUG_ON to ensure that the bq_mode_name and controls
arrays are the same size.

Signed-off-by: Ryan Mallon <rmallon@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 12:03:47 +01:00
Ryan Mallon 8754f2263f ASoC: max98088 codec: Catch driver bugs for eq channel name
Move the EQ channel names to a separate array and iterate over it in
max98088_get_channel rather than duplicating the hardcoded channel
names. Add an error message if an invalid channel is passed and check
the error in the callers.

Also added a BUILD_BUG_ON to ensure that the eq_mode_name and controls
arrays are the same size.

Signed-off-by: Ryan Mallon <rmallon@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 12:03:35 +01:00
Mark Brown 81204c84ca ASoC: Add WM1811 support
The WM1811 is mostly register compatible with the WM8994 and WM8958,
providing a high performance audio hub CODEC in a small form factor
suitable for ultra compact system designs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-04 11:59:46 +01:00
Mark Brown 11c2b5f2dc ASoC: Fix typo in 24.576MHz rate in WM5100
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-03 21:34:57 +01:00
Axel Lin 9b5999b1bc ASoC: Fix setting update bits for WM8741_DACRMSB_ATTENUATION
After checking the code and datasheet, I think what we want in the second
snd_soc_update_bits call is to update WM8741_DACRMSB_ATTENUATION register
instead of WM8741_DACRLSB_ATTENUATION.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-03 14:15:40 +01:00
Axel Lin 43419b80fa ASoC: Remove needless codec->dapm.bias_level assignment to SND_SOC_BIAS_OFF
This assignment is done by the snd_soc_register_codec so there is no need
to redo it in probe function of a codec driver.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-03 14:15:22 +01:00
Axel Lin 3f0456bfd7 ASoC: wm8782: Add __devexit_p at necessary place
According to the comments in include/linux/init.h:

"Pointers to __devexit functions must use __devexit_p(function_name), the
wrapper will insert either the function_name or NULL, depending on the config
options."

We have __devexit annotation for wm8782_remove(), thus add __devexit_p at
necessary place.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-02 19:58:44 +01:00
Mark Brown ea945ab4d2 Merge branch 'for-3.1' into for-3.2 2011-10-02 19:57:19 +01:00
Axel Lin 21d17dd2a3 ASoC: Fix setting update bits for WM8753_LADC and WM8753_RADC
Current code set update bits for WM8753_LDAC and WM8753_RDAC twice,
but missed setting update bits for WM8753_LADC and WM8753_RADC.

I think it is a copy-paste bug in commit 776065
"ASoC: codecs: wm8753: Fix register cache incoherency".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-02 19:55:48 +01:00
Axel Lin 177fdd89f9 ASoC: tlv320aic3x: Use driver_data field of struct i2c_device_id to identify models
Save model information in driver_data so we can simplify the implementation.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 13:56:35 +01:00
Peter Ujfalusi 009d196b47 ASoC: twl6040: Simplify code in out_drv_event for pending work check
Instead of checking, if the work is pending, it is safer to cancel
the pending work, or wait till the scheduled work finishes.
This way we can avoid modifying the variables used by the work
function.
Since we know that no work is pending, we can remove the two additional
checks in POST_PMU, and PRE_PMD for non pending works.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 13:55:08 +01:00
Peter Ujfalusi 6fbb32d175 ASoC: twl6040: Shift 2 identifies the HS output in out_drv_event
None of the driver handled by out_drv_event have it's power
bit shifted by 3.
Remove the case for shift 3, and also add comment for the cases.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 13:55:08 +01:00
Peter Ujfalusi 93eebc6982 ASoC: twl6040: correct loop counters for HS/HF ramp code
The Headset gain range is 0 - 0xf (4 bit resolution)
The Handsfree gain range is 0 - 0x1d (5 bit resolution,
0x1e, and 0x1f values are invalid)

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 13:55:08 +01:00
Peter Ujfalusi a46737aee5 ASoC: twl6040: One workqueue should be enough
It is a bit overkill to have three (3) separate
workqueue for a single driver.
We can manage things with one workqueue nicely.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 13:55:08 +01:00
Axel Lin f34dafb287 ASoC: sn95031: Do not use static variable for channel_index
No reason to use static variable for channel_index.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 12:56:16 +01:00
Axel Lin 5992c58781 ASoC: Add missed regulator_unregister_notifier and regulator_bulk_free in wm8995_remove
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 12:56:16 +01:00
Axel Lin 6423aa9154 ASoC: Remove unused "control_data" field of struct aic3x_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 12:56:15 +01:00
Axel Lin 00e982a6a3 ASoC: Remove unused "control_data" field of struct cs4271_private
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 11:56:56 +01:00
Mark Brown 6d447be014 ASoC: Remove unused function check_vdac_to_outmix from rt5631
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 11:19:47 +01:00
Mark Brown f79e5e8ce2 ASoC: Staticise non-exported symbols in rt5631
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 11:19:40 +01:00
Susan Gao fbc7c62a3f ASoC: Fix a bug in WM8962 DSP_A and DSP_B settings
Signed-off-by: Susan Gao <sgao@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmico.com>
Cc: stable@kernel.org
2011-09-29 11:13:53 +01:00
Axel Lin c29429f3b7 ASoC: tlv320dac33: Add guarding parentheses to macros
Put parentheses around macro argument uses. This avoids pitfalls
for the programmer, where the argument expansion does not give the
expected result, for example:

SAMPLES_TO_US(substream->runtime->rate, dac33->uthr - DAC33_MODE7_MARGIN + 1);

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-29 10:53:12 +01:00
Axel Lin 21326db156 ASoC: adau1701: Fix prototype for adau1701_set_sysclk
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:21:14 +01:00
Axel Lin 16b7a9aa9a ASoC: Remove unused "control_data" field of struct ak4671_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:19:59 +01:00
Axel Lin 63de012f35 ASoC: Remove unused "control_data" field of struct max98095_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:19:59 +01:00
Axel Lin 72a921da07 ASoC: Remove unused "control_data" field of struct max98088_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:19:59 +01:00
Axel Lin 6d4f7097df ASoC: Remove unused "control_data" field of struct cs42l51_private
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:19:58 +01:00
Axel Lin 217069ea9a ASoC: Remove unused "control_data" field of struct cs4270_private
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:19:58 +01:00
Axel Lin 44cb209d33 ASoC: Remove unused "control_data" field of struct alc5623_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:19:58 +01:00
Axel Lin 23d622b14b ASoC: adau1701: Initialize codec->control_data before using it
Currently codec->control_data is not initialized before calling
process_sigma_firmware(codec->control_data, ADAU1701_FIRMWARE).

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 09:58:06 +01:00
Axel Lin 458f6f6921 ASoC: Fix setting adau1373_dai->master for SND_SOC_DAIFMT_CBS_CFS
In the case of SND_SOC_DAIFMT_CBS_CFS, adau1373_dai->master should be false.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 09:57:58 +01:00
Axel Lin 4addfd88ea ASoC: Remove unused "control_data" field of struct wm8904_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 19:53:38 +01:00
Axel Lin b6ba8cc287 ASoC: Remove unused "control_data" field of struct wm9090_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 19:53:38 +01:00
Axel Lin 6e34216490 ASoC: Remove unused "control_data" field of struct wm9081_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 19:53:38 +01:00
Axel Lin 8c0c459ced ASoC: Remove unused "control_data" field of struct wm8978_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 19:53:38 +01:00
Axel Lin ec61bde573 ASoC: Remove unused "control_data" field of struct wm8960_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 19:53:38 +01:00
Axel Lin c9241ec6af ASoC: Remove unused "control_data" field of struct wm8940_priv
The control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 19:53:38 +01:00
Mark Brown 644f1ff4ff ASoC: Add device ID for WM9093 to WM9090 driver
The WM9093 is an enhanced version of the WM9093.  Add the device ID to
the driver, further patches will add support for the additional features
in the WM9093.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 19:21:44 +01:00
Karl Tsou bcec267a17 ASoC: Add DRC control for WM8996
Signed-off-by: Karl Tsou <karl@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 19:02:45 +01:00
Lars-Peter Clausen 0289053526 ASoC: ssm2602: Support setting the oscillator and the clock output state
Currently the oscillator is always enabled and the clock output is always
disabled. This patch adds support for controlling the oscillator and clock
output state through snd_soc_dai_set_sysclk. Which makes it possible to
disable or enable them dynamically according to the requirements of the board
on which the CODEC is used.

This patch also slightly modifies the behavior as to when the oscillator is
going to be disabled in low-power states. Previously it would only be disabled
in BIAS_OFF, now it is also going to be disabled in BIAS_STANDBY, since no
components which depend on it should be active in this state.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 13:30:48 +01:00
Lars-Peter Clausen a9d1974ea1 ASoC: ssm2602: Set initial bias level to standby
Set the initial bias level to standby during CODEC probe instead of leaving the
CODEC powered off.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 11:21:40 +01:00
Mark Brown 60c9e3178f Merge branch 'for-3.1' into for-3.2 2011-09-27 11:21:11 +01:00
Lars-Peter Clausen 9058020cd9 ASoC: ssm2602: Re-enable oscillator after suspend
Currently the the internal oscillator is powered down when entering BIAS_OFF
state, but not re-enabled when going back to BIAS_STANDBY. As a result the
CODEC will stop working after suspend if the internal oscillator is used to
generate the sysclock signal. This patch fixes it by clearing the appropriate
bit in the power down register when the CODEC is re-enabled.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-09-27 11:20:38 +01:00
Peter Ujfalusi 4d64bdca44 ASoC: twl6040: No need to change delay during HF ramp
The Handsfree gain have 2dB steps all the way, so there is no
reason to have different delays as we approaching to the
end of the scale.
The comment was also wrong, since we have 0dB at 0x3 raw, at 16 the gain
is -26dB.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 22:33:31 +01:00
Peter Ujfalusi 8ff1e17098 ASoC: twl6040: No need to change delay during HS ramp
The Headset gain have 2dB steps all the way, so there is no
reason to have different delays as we approaching to the
end of the scale.
The comment was also wrong, since we have 0dB at 0x0 raw at
one end of the range, and not in the middle.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 22:33:31 +01:00
Peter Ujfalusi 46dd0b93a0 ASoC: twl6040: Move the delayed_work for HS detection under twl6040_jack_data
The delayed_work named 'delayed_work' is for the headset detection,
so move it to the twl6040_jack_data struct.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 22:24:18 +01:00
Peter Ujfalusi e71a5e5af6 ASoC: twl6040: Move delayed_work struct inside twl6040_output for HS/HF
The delayed works for the output can be moved within the
twl6040_output struct (from the twl6040_data) to be better
organized.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 22:23:33 +01:00
Peter Ujfalusi a8cc7189cd ASoC: twl6040: Combine the custom volsw get, and put functions
We can manage with one set of get, and put function for the gain
controls we need to handle with custom code due to the shadowing
of the register.
For both get, and put function we can call decide based on the
mc->rreg value, if we need to call the volsw, or the vlosw_2r
variant (in 2r case rreg is not 0).
Handling of the shadow values are the same for both type of
controls.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 22:23:32 +01:00
Peter Ujfalusi eb6b71e7d9 ASoC: twl6040: Rename pga_event to out_drv_event
This event handler is used with the OUT_DRV widgets.
The name pga_event was misleading.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 22:23:32 +01:00
Peter Ujfalusi db4aabcc1f ASoC: twl6040: Function to fetch the TRIM values
Provide API to fetch the TRIM values (for machine drivers)

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 22:23:32 +01:00
Peter Ujfalusi f97217f18e ASoC: twl6040: Read the TRIM values from the chip
Update the reg_cache with values from chip regarding to TRIM.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 22:23:32 +01:00
Axel Lin c0fd9c9c42 ASoC: Drop exporting ad1980_dai
ad1980_dai is not used outside this driver,
thus drop exporting it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 09:58:23 +01:00
Axel Lin 575e498ae1 ASoC: Drop exporting sn95031_get_mic_bias
sn95031_get_mic_bias() is not used outside this driver
and it is a static function now.
Thus drop exporting sn95031_get_mic_bias.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-26 09:58:23 +01:00
Mark Brown a850260e47 ASoC: Set idle_bias_off for WM1250 EV1
The WM1250 EV1 is functionally digital in a system (the analogue I/O
is either ground referenced or always powered) so flag it as idle_bias_off.

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

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23 17:05:38 +01:00
Mark Brown 086d7f804e ASoC: Convert WM8962 MICBIAS to a supply widget
A supply widget is generally clearer than a MICBIAS widget and a mic bias
is just a type of supply so use a supply widget for the MICBIAS. This also
avoids confusion with the routing when connected to multiple inputs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23 16:59:43 +01:00
Mark Brown 3f7d55a19a ASoC: Rename WM8962 DMIC widget to DMIC_ENA
Matches the register name and avoids confusion with board widgets.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23 16:59:38 +01:00
Axel Lin 0a742681e6 ASoC: Add missed free_irq in wm5100_remove and wm5100_probe error path
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23 11:54:24 +01:00
Axel Lin 0010bcc226 ASoC: Remove unneeded mutex_init in wl1273_probe()
Since f0fba2ad "ASoC: multi-component - ASoC Multi-Component Support",
snd_soc_register_codec() now does all the codec list and mutex init.
Thus don't need to call mutex_init(&codec->mutex) in wl1273_probe() any more.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23 11:54:24 +01:00
Axel Lin a436089b77 ASoC: Staticize sn95031_dais
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23 11:54:24 +01:00
Axel Lin 51e19fb385 ASoC: Staticize rt5631_dai
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23 11:54:24 +01:00
Peter Ujfalusi f34c660662 ASoC: twl6040: No need to read the INTID register
Since our irq handler has been called, it is granted, that
the reason was either PLUGINT, or UNPLUGINT.
The INTID register has been checked in the MFD part of
twl6040 driver (twl6040-irq.c).
We have no reason to read from chip again here.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-23 11:54:24 +01:00
Axel Lin 689b956e2c ASoC: Add Kconfig and Makefile entries for rt5631 codec
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 18:18:28 +01:00
Mark Brown d73ec75cc4 ASoC: Add missed BCLK rate to WM5100 driver
Reported-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:48:01 +01:00
Mark Brown 7aefb086c1 ASoC: Dynamically manage DBVDD2 and DBVDD3 on WM5100
Allow the DBVDD2 and DBVDD3 rails to be powered down when idle, helping
fully power down connected devices when idle.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:24:32 +01:00
Peter Ujfalusi ab6cf13943 ASoC/MFD: twl6040: Combine bit definitions for Headset control registers
Use one set of defines for the HS bits, since they are identical in both
control register.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:22 +01:00
Peter Ujfalusi d13f1fe044 ASoC: twl6040/sdp4430: Change legacy DAI name
Change the legacy DAI name from "twl6040-hifi" to "twl6040-legacy" to
be more intuitive.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:22 +01:00
Peter Ujfalusi fdb625ffd2 ASoC: twl6040: Support for AUX L/R output
AUX L/R outputs can be driver from the Handsfree PGA output.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:22 +01:00
Peter Ujfalusi 45b0f60de2 ASoC: twl6040: Use consistent names for Headset path
Use "Headset XYZ" for user visible controls, while the internal DAPM
widgets can use "HS XYZ".
In this way we can group the Headset related controls in UI
(alsamixer for example).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:22 +01:00
Peter Ujfalusi df11ce295a ASoC: twl6040: Use consistent names for Handsfree path
Use "Handsfree XYZ" for user visible controls, while the internal DAPM
widgets can use "HF XYZ".
In this way we can group the Handsfree related controls in UI
(alsamixer for example).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:22 +01:00
Peter Ujfalusi 317596a694 ASoC: twl6040: Earphone path correction
Fix the DAPM routing for the earphone path.
Convert the DAPM_SWITCH_E to DAPM_OUT_DRV_E, so we can have correct
power up, and down sequence for EP.
Introduce mute control (Earphone Playback Switch) for users to
enable/disable the EP path.
Note: the EP does not have it's own dedicated DAC. EP is connected to
HSL DAC.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:22 +01:00
Peter Ujfalusi d17bf31832 ASoC: twl6040: Introduce SW only shadow register
Software only shadow register to be used by the driver.
For example Earpiece path will need this shadow register.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:21 +01:00
Peter Ujfalusi 5bf692d972 ASoC: twl6040: Remove strings "NULL" from DAPM route
Replace the string with plain NULL.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:21 +01:00
Peter Ujfalusi 4548dc3c05 ASoC: twl6040: Fix comments for register names
Change the register name strings in the comments for the
twl6040_reg table, so it is easier to search for specific
register.

This is cosmetic change.

Before we had for example:
TWL6040_REG_HSLCTL as register definition.

At the register table we had:
TWL6040_HSLCTL

Searching for TWL6040_HSLCTL resulted no hits.

While if we look for REG_HSLCTL, we can find the places
the register has been used.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:21 +01:00
Peter Ujfalusi 3acef6854c ASoC: twl6040: Lower the power on gain values at startup
The default gains on outputs/inputs are set to 0dB.
This is fixing the pop noise issue at the first playback, which
caused by the wrong starting point of the ramp code.
The ramp code for the outputs expects the gains to be in
their lowest configuration in order to be effective.
After the playback stops, the ramp code takes care of
ramping down the gains to their minimum.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 17:20:21 +01:00
Mark Brown 8af0894546 ASoC: Include delay.h in 88pm860x
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-22 11:16:10 +01:00
Yong Zhang 88e24c3a4b sound: irq: Remove IRQF_DISABLED
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

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

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

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

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-21 16:07:45 +01:00
Peter Ujfalusi 07441006b2 ASoC: tpa6130a2: Model support cleanup
Use the device name and driver_data to identify
the TPA model supported by the driver.
Board files should use either "tpa6130a2" or
"tpa6140a2" as device name to specify the model
in used on the specific board.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-21 16:07:40 +01:00
Bas Vermeulen 548aae8cc4 ASoC: 88pm860x-codec - reset the codec correctly
Reset the codec according to the Audio power-up delay errata for the 88PM8607.

Signed-off-by: Bas Vermeulen <bas.vermeulen@novero.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-21 15:52:28 +01:00
Bas Vermeulen 06c15baf90 ASoC: 88pm860x-codec - Allow independent use of both I2S playback and capture
Introduce a I2S CLK supply so playback and capture can operate independently.

Signed-off-by: Bas Vermeulen <bas.vermeulen@novero.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-21 15:52:28 +01:00
johnnyhsu@realtek.com d80852223e ASoC: Add driver for rt5631
Signed-off-by: Johnny Hsu <johnnyhsu@realtek.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-21 15:52:23 +01:00
Mark Brown 6d4baf084f ASoC: Add WM5100 driver
The WM5100 is a highly integrated low power audio subsystem with advanced
digital signal processing capabilities including effects, speech clarity
enhancement and active noise cancellation.  This initial driver provides
support for basic audio paths, further patches will provide more
complete functionality.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-20 16:02:16 +01:00
Mark Brown f648de832d Merge branch 'for-3.1' into for-3.2 2011-09-20 12:59:35 +01:00
Lars-Peter Clausen 26806a4266 ASoC: ssm2602: Do not dereference codec->control_data
The driver assumes that control_data points to the drivers i2c_client struct,
but this is no longer the case since the ASoC core has switched to regmap.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-20 12:59:07 +01:00
Mark Brown f93dc4b6c9 ASoC: Remove bitrotted wm8962_resume()
This functionality is now subsumed within the bias management, using the
standard cache management functionality, without assuming the cache type.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-20 12:57:48 +01:00
Mark Brown ded71dcb77 ASoC: Refcount WM8996 bandgap from FLL too
For digital only paths we need to make sure the bandgap is enabled prior
to starting the FLL which isn't tied into DAPM.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-20 12:56:53 +01:00
Mark Brown c9d023adb6 ASoC: Fix unused variable warning in WM8996
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-20 12:56:36 +01:00
Peter Ujfalusi cdd5054c3e ASoC: twl6040: Correct supported number of playback channels
twl6040 supports 5 playback, and 2 capture channels

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19 23:15:59 +01:00
Peter Ujfalusi d8dd032d53 ASoC: twl6040: Fix the number of channels for vibra
Only mono audio can be used for vibra (DL4 channel).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19 23:15:59 +01:00
Peter Ujfalusi 2c27ff41d8 ASoC: twl6040: Use chip defaults in the initial reg_cache
Reset the twl6040_reg array to hold the chip default values.
The only changed values were for the microphone input selection.
Select no input for the microphones in the twl6040_init_chip function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19 23:15:58 +01:00
Peter Ujfalusi a52762eee9 ASoC: twl6040: Chip initialization cleanup
There is no need to write to the vio registers at probe time, since most
them either read only, or shared with MFD or not used.
On the other hand it is a good idea to updated the ASICREV register in
the cache at this time.

After power up we need to restore some registers. Clean up the list to
contain only the registers we are going to restore.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19 23:15:57 +01:00
Axel Lin 5d42940c25 ASoC: sn95031: Staticize sn95031_pcm_hw_params
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Vinod Koul <vinod.koul@linux.intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-19 18:31:00 +01:00
Mark Brown 0b684cc14a ASoC: Initial WM8996 headphone impedance measurement support
The WM8996 can measure the impedance of accessories connected to the
headphone output. Implement initial support for this, measuring the
left channel impedance when an accessory is detected and using this
to distinguish between a line load and a headphone load.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-19 18:30:59 +01:00
Mark Brown 8259df12fd ASoC: WM8996 only needs bandgap for analogue functionality
Rather than managing the bandgap in the bias level control use a supply
widget as we only actually need to enable it for analogue paths, not
fully digital ones.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-19 18:30:58 +01:00
Timur Tabi 0016226d03 ASoC: support all possible sample rates in the WM8776 driver
The WM8776 supports a continuous range of sample rates rather than
discrete values and supports a wider range of sample rates on the
playback path than is currently supported.  Update the constraints on
the DAIs to reflect this.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-16 17:35:18 +01:00
Axel Lin 0547d0f3da ASoC: wm8995: Remove unused i2c variable in wm8995_remove()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-16 10:49:21 +01:00
Axel Lin 6fa0c25bf4 ASoC: wm8995: Return -EINVAL if device ID mismatch
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-16 10:49:09 +01:00
Axel Lin 275708f88d ASoC: tpa6130a2: Remove obsolete cleanup for clientdata
The i2c core will clear the clientdata pointer automatically,
we don't have to set the `data' field to NULL in remove() or
if probe() failed anymore.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-16 10:13:53 +01:00
Timur Tabi d1dc698a54 ASoC: support sample sizes properly in the WM8776 codec driver
Use snd_pcm_format_width() to determine the sample size, instead of
checking specify sample formats and assuming that those are the only
valid format.

This change adds support for big-endian architectures (which use the _BE
formats) and the packed 24-bit format (SNDRV_PCM_FORMAT_S24_3xE).

[Fixed single letter variable name legibility problem -- broonie]

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-16 10:06:31 +01:00
Mark Brown f998f257c9 ASoC: Fix WM8996 DC servo operation without IRQ
We need to count the timeout down.

Reported-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-16 00:54:08 +01:00
Mark Brown 32d2a0c17d ASoC: Correct channel numbers for WM8996 AIF2
The AIF1 channels are numbered from zero than one; do the same thing for
AIF2 too.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-14 11:00:07 +01:00
Mark Brown c83495af63 ASoC: Disable WM8996 CPVDD supply when not in use
The WM8996 only requires CPVDD when the charge pump is active so control
it separately to the other supplies, only enabling it when the charge pump
is active. This will result in a small power saving on systems which are
able to provide independent software control of the supply.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-14 10:59:36 +01:00
Lars-Peter Clausen 30ab1e7886 ASoC: ad193x: Setup regmap read and write flag masks for SPI
Currently register read-back for the ad193x is broken, because it expects bit 0
of the upper byte to be set to indicate a read operation, while the regmap
default for SPI is to use bit 7.

This patch also addresses another oddity of the device. There are SPI and I2C
versions of this codec. In both cases the registers are 8-bit wide and numbered
from 0x0 to 0x10, but in the SPI case there is also a so called
'global address' which is prefixed in-front of the register address. The global
address mimics I2C behaviour and includes a static device address the and the
read/write flag. This basically extends the register address to an 16-bit value
numbered from 0x800 to 0x810. These are the register numbers which are
currently used by the driver. This works, because I2C will ignore the upper
8 bits of the register, but it is still a bit confusing, as there are no such
register numbers in the I2C case.

The approach taken by this patch is to number the registers from 0x00 to 0x10
and encode the global address for SPI mode into the read and write flag masks.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-09 11:13:31 -07:00