Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1241358 > unrolled thread
| Started by | Adam Thomson <Adam.Thomson.Opensource@diasemi.com> |
|---|---|
| First post | 2015-10-07 13:00 +0200 |
| Last post | 2015-10-07 13:00 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/2] ASoC: da7219: Improve mclk error checking, use of_match_ptr Adam Thomson <Adam.Thomson.Opensource@diasemi.com> - 2015-10-07 13:00 +0200
[PATCH 2/2] ASoC: da7219: Improve error checking of mclk enable/disable Adam Thomson <Adam.Thomson.Opensource@diasemi.com> - 2015-10-07 13:00 +0200
| From | Adam Thomson <Adam.Thomson.Opensource@diasemi.com> |
|---|---|
| Date | 2015-10-07 13:00 +0200 |
| Subject | [PATCH 0/2] ASoC: da7219: Improve mclk error checking, use of_match_ptr |
| Message-ID | <qgUBY-2xr-19@gated-at.bofh.it> |
This patch set contains a couple of small updates/fixes: - Use of of_match_ptr() for assigning match table to driver structure - Only enable/disable mclk if it has been provided to the driver. - Add error checking of clk_prepare_enable. Patch set is based on changes introduced under patch: 'ASoC: da7219: Improve error handling for regulator supplies' (Commit 4e929134eb8271abc9c52c371e056debfea6898b , kernel/git/broonie/sound.git) Adam Thomson (2): ASoC: da7219: Use of_match_ptr() when assigning match table ASoC: da7219: Improve error checking of mclk enable/disable sound/soc/codecs/da7219.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Adam Thomson <Adam.Thomson.Opensource@diasemi.com> |
|---|---|
| Date | 2015-10-07 13:00 +0200 |
| Subject | [PATCH 2/2] ASoC: da7219: Improve error checking of mclk enable/disable |
| Message-ID | <qgUBZ-2xr-25@gated-at.bofh.it> |
| In reply to | #1241358 |
Should only try to enable/disable the provided mclk, during bias
level changes, if it's not NULL. Also return value of
clk_prepare_enable() should be checked and dealt with accordingly.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
---
sound/soc/codecs/da7219.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index adcc079..abba4b3 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1494,6 +1494,7 @@ static int da7219_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
{
struct da7219_priv *da7219 = snd_soc_codec_get_drvdata(codec);
+ int ret;
switch (level) {
case SND_SOC_BIAS_ON:
@@ -1502,7 +1503,14 @@ static int da7219_set_bias_level(struct snd_soc_codec *codec,
case SND_SOC_BIAS_STANDBY:
if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) {
/* MCLK */
- clk_prepare_enable(da7219->mclk);
+ if (da7219->mclk) {
+ ret = clk_prepare_enable(da7219->mclk);
+ if (ret) {
+ dev_err(codec->dev,
+ "Failed to enable mclk\n");
+ return ret;
+ }
+ }
/* Master bias */
snd_soc_update_bits(codec, DA7219_REFERENCES,
@@ -1528,7 +1536,8 @@ static int da7219_set_bias_level(struct snd_soc_codec *codec,
}
/* MCLK */
- clk_disable_unprepare(da7219->mclk);
+ if (da7219->mclk)
+ clk_disable_unprepare(da7219->mclk);
break;
}
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web