Commit graph

262989 commits

Author SHA1 Message Date
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
Jarkko Nikula 91a18ae8ff ASoC: omap-mcbsp: Fix FS polarity for LEFT_J, DSP_A and DSP_B formats
Commit 75d9ac4 ("ASoC: Allow DAI formats to be specified in the dai_link")
changed DAI format flag values and we cannot simply invert anymore e.g.
frame-sync with ^= SND_SOC_DAIFMT_NB_IF (which was anyway misuse) as there
is no anymore fixed bit position for bit-clock or frame-sync inversion.

Fix this by relying only on DAI format flag values passed to us and by not
making any assumption on individual bit positions.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 12:56:17 +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
Ujfalusi, Peter 5382ffbb17 ASoC: sdp4430: Fix string for FM input name
The name contains invalid valid character (/), which
causes problems when trying to create the debugfs
directory structure:
ASoC: Failed to create Aux/FM Stereo In debugfs file

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-30 12:56:12 +01:00
Jarkko Nikula ad51f76544 ASoC: Davinci: Fix FS polarity for I2S format
Commit 75d9ac4 ("ASoC: Allow DAI formats to be specified in the dai_link")
changed DAI format flag values and we cannot simply invert anymore e.g.
frame-sync with ^= SND_SOC_DAIFMT_NB_IF (which was anyway misuse) as there
is no anymore fixed bit position for bit-clock or frame-sync inversion.

Fix this by relying only on DAI format flag values passed to us and by not
making any assumption on individual bit positions

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: Vaibhav Bedia <vaibhav.bedia@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-30 11:56:56 +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
Mark Brown a8fdac83a3 ASoC: Also count neighbour checks for supplies
Missed when the stat was originally added.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 19:42:12 +01:00
Mark Brown 44fdd43387 ASoC: Use dai_fmt in speyside_wm8962
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:22:33 +01:00
Mark Brown 75d9ac46b9 ASoC: Allow DAI formats to be specified in the dai_link
For almost all machines the DAI format is a constant, always set to the
same thing. This means that not only should we normally set it on init
rather than in hw_params() (where it has been for historical reasons) we
should also allow users to configure this by setting a variable in the
dai_link structure. The combination of these two will make many machine
drivers even more data driven.

Implement a new dai_fmt field in the dai_link doing just that. Since 0 is
a valid value for many format flags and we need to be able to tell if the
field is actually set also add one to all the values used to configure
formats.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-28 13:22:28 +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
Axel Lin d1b73287c2 ASoC: Staticise sst_platform_dai
It is not used outside this driver so no need to make the symbol global.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 11:21:40 +01:00
Axel Lin fe0cc75193 ASoC: Remove unused fields in struct mfld_mc_private
Both *socdev and *codec of struct mfld_mc_private are not being used
in this driver, remove it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
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 7bf3d92cdd ASoC: sdp4430: Configure McPDM offset cancellation
Based on the values from twl6040 codec (HSOTRIM L/R) we can configure
the McPDM offset cancellation.

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 89b0d550a6 ASoC: omap-mcpdm: API to configure offset cancellation
The offset cancellation values can be different from board to board, even
on the same HW platform.
Provide a way for the machine drivers to configure the McPDM offset
cancellation.

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