diff options
| author | Daniel Mack <zonque@gmail.com> | 2013-06-27 15:59:11 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2013-06-28 07:15:30 -0400 |
| commit | a975873a9acc0788c1aee5ca183deb420b5c00e5 (patch) | |
| tree | ffb92c13515f509579bbc106ae516806da3bd6db | |
| parent | 9f24dc877093744c0db323cc3d8a9c82aa2af8a5 (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>
| -rw-r--r-- | sound/soc/codecs/tas5086.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c index 8bbdf25530ca..6d31d88f7204 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) | |||
| 721 | { | 721 | { |
| 722 | struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec); | 722 | struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec); |
| 723 | int charge_period = 1300000; /* hardware default is 1300 ms */ | 723 | int charge_period = 1300000; /* hardware default is 1300 ms */ |
| 724 | u8 pwm_start = TAS5086_PWM_START_CHANNEL_MASK; | 724 | u8 pwm_start_mid_z = 0; |
| 725 | int i, ret; | 725 | int i, ret; |
| 726 | 726 | ||
| 727 | if (of_match_device(of_match_ptr(tas5086_dt_ids), codec->dev)) { | 727 | 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) | |||
| 735 | "ti,mid-z-channel-%d", i + 1); | 735 | "ti,mid-z-channel-%d", i + 1); |
| 736 | 736 | ||
| 737 | if (of_get_property(of_node, name, NULL) != NULL) | 737 | if (of_get_property(of_node, name, NULL) != NULL) |
| 738 | pwm_start &= ~(1 << i); | 738 | pwm_start_mid_z |= 1 << i; |
| 739 | } | 739 | } |
| 740 | } | 740 | } |
| 741 | 741 | ||
| 742 | /* | 742 | /* |
| 743 | * Configure 'part 2' of the PWM starts to always use MID-Z, and tell | 743 | * If any of the channels is configured to start in Mid-Z mode, |
| 744 | * all configured mid-z channels to start start under 'part 2'. | 744 | * configure 'part 1' of the PWM starts to use Mid-Z, and tell |
| 745 | * all configured mid-z channels to start start under 'part 1'. | ||
| 745 | */ | 746 | */ |
| 746 | regmap_write(priv->regmap, TAS5086_PWM_START, | 747 | if (pwm_start_mid_z) |
| 747 | TAS5086_PWM_START_MIDZ_FOR_START_2 | pwm_start); | 748 | regmap_write(priv->regmap, TAS5086_PWM_START, |
| 749 | TAS5086_PWM_START_MIDZ_FOR_START_1 | | ||
| 750 | pwm_start_mid_z); | ||
| 748 | 751 | ||
| 749 | /* lookup and set split-capacitor charge period */ | 752 | /* lookup and set split-capacitor charge period */ |
| 750 | if (charge_period == 0) { | 753 | if (charge_period == 0) { |
