* [PATCH 0/2] ASoC: da7219: Improve mclk error checking, use of_match_ptr
@ 2015-10-07 10:57 Adam Thomson
2015-10-07 10:57 ` [PATCH 1/2] ASoC: da7219: Use of_match_ptr() when assigning match table Adam Thomson
2015-10-07 10:57 ` [PATCH 2/2] ASoC: da7219: Improve error checking of mclk enable/disable Adam Thomson
0 siblings, 2 replies; 5+ messages in thread
From: Adam Thomson @ 2015-10-07 10:57 UTC (permalink / raw
To: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai
Cc: alsa-devel, linux-kernel, Support Opensource
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] ASoC: da7219: Use of_match_ptr() when assigning match table
2015-10-07 10:57 [PATCH 0/2] ASoC: da7219: Improve mclk error checking, use of_match_ptr Adam Thomson
@ 2015-10-07 10:57 ` Adam Thomson
2015-10-07 11:18 ` Applied "ASoC: da7219: Use of_match_ptr() when assigning match table" to the asoc tree Mark Brown
2015-10-07 10:57 ` [PATCH 2/2] ASoC: da7219: Improve error checking of mclk enable/disable Adam Thomson
1 sibling, 1 reply; 5+ messages in thread
From: Adam Thomson @ 2015-10-07 10:57 UTC (permalink / raw
To: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai
Cc: alsa-devel, linux-kernel, Support Opensource
Use of_match_ptr() to handle non-DT kernel scenario where match
table should be NULL.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
---
sound/soc/codecs/da7219.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index c86a833..adcc079 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1932,7 +1932,7 @@ MODULE_DEVICE_TABLE(i2c, da7219_i2c_id);
static struct i2c_driver da7219_i2c_driver = {
.driver = {
.name = "da7219",
- .of_match_table = da7219_of_match,
+ .of_match_table = of_match_ptr(da7219_of_match),
},
.probe = da7219_i2c_probe,
.remove = da7219_i2c_remove,
--
1.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] ASoC: da7219: Improve error checking of mclk enable/disable
2015-10-07 10:57 [PATCH 0/2] ASoC: da7219: Improve mclk error checking, use of_match_ptr Adam Thomson
2015-10-07 10:57 ` [PATCH 1/2] ASoC: da7219: Use of_match_ptr() when assigning match table Adam Thomson
@ 2015-10-07 10:57 ` Adam Thomson
2015-10-07 11:18 ` Applied "ASoC: da7219: Improve error checking of mclk enable/disable" to the asoc tree Mark Brown
1 sibling, 1 reply; 5+ messages in thread
From: Adam Thomson @ 2015-10-07 10:57 UTC (permalink / raw
To: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai
Cc: alsa-devel, linux-kernel, Support Opensource
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Applied "ASoC: da7219: Improve error checking of mclk enable/disable" to the asoc tree
2015-10-07 10:57 ` [PATCH 2/2] ASoC: da7219: Improve error checking of mclk enable/disable Adam Thomson
@ 2015-10-07 11:18 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2015-10-07 11:18 UTC (permalink / raw
To: Adam Thomson, Mark Brown; +Cc: alsa-devel
The patch
ASoC: da7219: Improve error checking of mclk enable/disable
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From ba856fbd602175d386ab5a4fc0fdd89b912546cb Mon Sep 17 00:00:00 2001
From: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Date: Wed, 7 Oct 2015 11:57:14 +0100
Subject: [PATCH] ASoC: da7219: Improve error checking of mclk enable/disable
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
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;
}
--
2.5.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Applied "ASoC: da7219: Use of_match_ptr() when assigning match table" to the asoc tree
2015-10-07 10:57 ` [PATCH 1/2] ASoC: da7219: Use of_match_ptr() when assigning match table Adam Thomson
@ 2015-10-07 11:18 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2015-10-07 11:18 UTC (permalink / raw
To: Adam Thomson, Mark Brown; +Cc: alsa-devel
The patch
ASoC: da7219: Use of_match_ptr() when assigning match table
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From b7ebd78d1d142e4e47c3547b08faf51218384583 Mon Sep 17 00:00:00 2001
From: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Date: Wed, 7 Oct 2015 11:57:12 +0100
Subject: [PATCH] ASoC: da7219: Use of_match_ptr() when assigning match table
Use of_match_ptr() to handle non-DT kernel scenario where match
table should be NULL.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/codecs/da7219.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index c86a833..adcc079 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1932,7 +1932,7 @@ MODULE_DEVICE_TABLE(i2c, da7219_i2c_id);
static struct i2c_driver da7219_i2c_driver = {
.driver = {
.name = "da7219",
- .of_match_table = da7219_of_match,
+ .of_match_table = of_match_ptr(da7219_of_match),
},
.probe = da7219_i2c_probe,
.remove = da7219_i2c_remove,
--
2.5.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-10-07 11:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-07 10:57 [PATCH 0/2] ASoC: da7219: Improve mclk error checking, use of_match_ptr Adam Thomson
2015-10-07 10:57 ` [PATCH 1/2] ASoC: da7219: Use of_match_ptr() when assigning match table Adam Thomson
2015-10-07 11:18 ` Applied "ASoC: da7219: Use of_match_ptr() when assigning match table" to the asoc tree Mark Brown
2015-10-07 10:57 ` [PATCH 2/2] ASoC: da7219: Improve error checking of mclk enable/disable Adam Thomson
2015-10-07 11:18 ` Applied "ASoC: da7219: Improve error checking of mclk enable/disable" to the asoc tree Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).