diff options
author | Mark Brown <broonie@linaro.org> | 2014-01-30 15:04:34 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-03 07:50:59 -0500 |
commit | d6f95e5407674d2f7d61feef81fef96b364d9188 (patch) | |
tree | a5b91fab644d4713bf6f87abae75be375a7d25aa | |
parent | df6ab65f2fef3d7b769f3ba87c7bb265ace80b4e (diff) |
ASoC: wm8962: Clean up error handling for failed FLL start
Don't record the FLL as having started and leave the hardware disabled
ensuring we are in a better state if this does happen to be a transient
error and making debugging easier.
Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/wm8962.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index d7d43c9371f4..cd96d463a505 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -2898,8 +2898,6 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
2898 | 2898 | ||
2899 | dev_dbg(codec->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout); | 2899 | dev_dbg(codec->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout); |
2900 | 2900 | ||
2901 | ret = 0; | ||
2902 | |||
2903 | /* This should be a massive overestimate but go even | 2901 | /* This should be a massive overestimate but go even |
2904 | * higher if we'll error out | 2902 | * higher if we'll error out |
2905 | */ | 2903 | */ |
@@ -2913,14 +2911,17 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source, | |||
2913 | 2911 | ||
2914 | if (timeout == 0 && wm8962->irq) { | 2912 | if (timeout == 0 && wm8962->irq) { |
2915 | dev_err(codec->dev, "FLL lock timed out"); | 2913 | dev_err(codec->dev, "FLL lock timed out"); |
2916 | ret = -ETIMEDOUT; | 2914 | snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, |
2915 | WM8962_FLL_ENA, 0); | ||
2916 | pm_runtime_put(codec->dev); | ||
2917 | return -ETIMEDOUT; | ||
2917 | } | 2918 | } |
2918 | 2919 | ||
2919 | wm8962->fll_fref = Fref; | 2920 | wm8962->fll_fref = Fref; |
2920 | wm8962->fll_fout = Fout; | 2921 | wm8962->fll_fout = Fout; |
2921 | wm8962->fll_src = source; | 2922 | wm8962->fll_src = source; |
2922 | 2923 | ||
2923 | return ret; | 2924 | return 0; |
2924 | } | 2925 | } |
2925 | 2926 | ||
2926 | static int wm8962_mute(struct snd_soc_dai *dai, int mute) | 2927 | static int wm8962_mute(struct snd_soc_dai *dai, int mute) |