summaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/ams-delta.c
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>2011-12-30 04:04:54 +0100
committerLiam Girdwood <lrg@ti.com>2012-01-09 11:20:16 +0000
commitf75a8ff67d161b5166a2c2360bb2ffaefd5eb853 (patch)
treedfba447099152b8deae514492e0e1e2a7bcd87cc /sound/soc/omap/ams-delta.c
parentb425b88418e302caf27e9cf44aa987b83c04cb2d (diff)
downloadlinux-f75a8ff67d161b5166a2c2360bb2ffaefd5eb853.tar.gz
linux-f75a8ff67d161b5166a2c2360bb2ffaefd5eb853.tar.bz2
linux-f75a8ff67d161b5166a2c2360bb2ffaefd5eb853.zip
ASoC: cx20442: add bias control over a platform provided regulator
Now that a regulator device for controlling the codec chip reset state over a platform agnostic regulator API is available on the only board using this driver so far, extend the driver with a bias control function which will request virtual power to the codec chip from that virtual regulator, and will supersede the present implementation existing at the sound card level. Thanks to the regulator sharing mechanism, both the old (the sound card) and the new (the codec) implementations should coexist smoothly until the sound card file is updated. For this to work as expected, update the sound card .set_bias_level callback to not touch codec->dapm.bias_level. While extending the cx20442 structure, drop unused control_type member. Created against linxu-3.2-rc6, tested on top of patch 1/4 "ARM: OMAP1: ams-delta: set up a regulator over the modem reset GPIO pin". Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/omap/ams-delta.c')
-rw-r--r--sound/soc/omap/ams-delta.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 3e523a7a9efb..a67f4370bc9f 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -431,22 +431,20 @@ static int ams_delta_set_bias_level(struct snd_soc_card *card,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level)
{
- struct snd_soc_codec *codec = card->rtd->codec;
-
switch (level) {
case SND_SOC_BIAS_ON:
case SND_SOC_BIAS_PREPARE:
case SND_SOC_BIAS_STANDBY:
- if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
+ if (card->dapm.bias_level == SND_SOC_BIAS_OFF)
ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
AMS_DELTA_LATCH2_MODEM_NRESET);
break;
case SND_SOC_BIAS_OFF:
- if (codec->dapm.bias_level != SND_SOC_BIAS_OFF)
+ if (card->dapm.bias_level != SND_SOC_BIAS_OFF)
ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET,
0);
}
- codec->dapm.bias_level = level;
+ card->dapm.bias_level = level;
return 0;
}