summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-06-27 21:59:11 +0200
committerMark Brown <broonie@linaro.org>2013-06-28 12:15:30 +0100
commita975873a9acc0788c1aee5ca183deb420b5c00e5 (patch)
treeffb92c13515f509579bbc106ae516806da3bd6db /sound/soc/codecs
parent9f24dc877093744c0db323cc3d8a9c82aa2af8a5 (diff)
ASoC: tas5086: fix Mid-Z implementation
It turns out that the TAS5086 doesn't like channel start parts to be empty, and if all channels are configured to Mid-Z, part 1 has to be used. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/tas5086.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index 8bbdf25530c..6d31d88f720 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -721,7 +721,7 @@ static int tas5086_probe(struct snd_soc_codec *codec)
{
struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
int charge_period = 1300000; /* hardware default is 1300 ms */
- u8 pwm_start = TAS5086_PWM_START_CHANNEL_MASK;
+ u8 pwm_start_mid_z = 0;
int i, ret;
if (of_match_device(of_match_ptr(tas5086_dt_ids), codec->dev)) {
@@ -735,16 +735,19 @@ static int tas5086_probe(struct snd_soc_codec *codec)
"ti,mid-z-channel-%d", i + 1);
if (of_get_property(of_node, name, NULL) != NULL)
- pwm_start &= ~(1 << i);
+ pwm_start_mid_z |= 1 << i;
}
}
/*
- * Configure 'part 2' of the PWM starts to always use MID-Z, and tell
- * all configured mid-z channels to start start under 'part 2'.
+ * If any of the channels is configured to start in Mid-Z mode,
+ * configure 'part 1' of the PWM starts to use Mid-Z, and tell
+ * all configured mid-z channels to start start under 'part 1'.
*/
- regmap_write(priv->regmap, TAS5086_PWM_START,
- TAS5086_PWM_START_MIDZ_FOR_START_2 | pwm_start);
+ if (pwm_start_mid_z)
+ regmap_write(priv->regmap, TAS5086_PWM_START,
+ TAS5086_PWM_START_MIDZ_FOR_START_1 |
+ pwm_start_mid_z);
/* lookup and set split-capacitor charge period */
if (charge_period == 0) {