alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate
@ 2016-11-16 13:08 Axel Lin
  2016-11-16 13:08 ` [PATCH 2/2] ASoC: rt5665: Use devm_gpio_request_one() Axel Lin
  2016-11-18 12:01 ` Applied "ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate" " Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2016-11-16 13:08 UTC (permalink / raw)
  To: Mark Brown
  Cc: Oder Chiou, alsa-devel, Axel Lin, Liam Girdwood, Julia Lawall,
	Bard Liao

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 sound/soc/codecs/rt5665.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c
index 34254fd..7dfaaf1 100644
--- a/sound/soc/codecs/rt5665.c
+++ b/sound/soc/codecs/rt5665.c
@@ -4587,7 +4587,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665)
 			pr_err("HP Calibration Failure\n");
 			regmap_write(rt5665->regmap, RT5665_RESET, 0);
 			regcache_cache_bypass(rt5665->regmap, false);
-			return;
+			goto out_unlock;
 		}
 
 		count++;
@@ -4606,7 +4606,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665)
 			pr_err("MONO Calibration Failure\n");
 			regmap_write(rt5665->regmap, RT5665_RESET, 0);
 			regcache_cache_bypass(rt5665->regmap, false);
-			return;
+			goto out_unlock;
 		}
 
 		count++;
@@ -4621,6 +4621,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665)
 	regmap_write(rt5665->regmap, RT5665_BIAS_CUR_CTRL_8, 0xa602);
 	regmap_write(rt5665->regmap, RT5665_ASRC_8, 0x0120);
 
+out_unlock:
 	mutex_unlock(&rt5665->calibrate_mutex);
 }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ASoC: rt5665: Use devm_gpio_request_one()
  2016-11-16 13:08 [PATCH 1/2] ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate Axel Lin
@ 2016-11-16 13:08 ` Axel Lin
  2016-11-18 12:01   ` Applied "ASoC: rt5665: Use devm_gpio_request_one()" to the asoc tree Mark Brown
  2016-11-18 12:01 ` Applied "ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate" " Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Axel Lin @ 2016-11-16 13:08 UTC (permalink / raw)
  To: Mark Brown
  Cc: Oder Chiou, alsa-devel, Axel Lin, Liam Girdwood, Julia Lawall,
	Bard Liao

Simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 sound/soc/codecs/rt5665.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c
index 7dfaaf1..324461e 100644
--- a/sound/soc/codecs/rt5665.c
+++ b/sound/soc/codecs/rt5665.c
@@ -4677,11 +4677,9 @@ static int rt5665_i2c_probe(struct i2c_client *i2c,
 	}
 
 	if (gpio_is_valid(rt5665->pdata.ldo1_en)) {
-		if (devm_gpio_request(&i2c->dev, rt5665->pdata.ldo1_en,
-			"rt5665"))
+		if (devm_gpio_request_one(&i2c->dev, rt5665->pdata.ldo1_en,
+					  GPIOF_OUT_INIT_HIGH, "rt5665"))
 			dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n");
-		else if (gpio_direction_output(rt5665->pdata.ldo1_en, 1))
-			dev_err(&i2c->dev, "Fail gpio_direction gpio_ldo\n");
 	}
 
 	/* Sleep for 300 ms miniumum */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Applied "ASoC: rt5665: Use devm_gpio_request_one()" to the asoc tree
  2016-11-16 13:08 ` [PATCH 2/2] ASoC: rt5665: Use devm_gpio_request_one() Axel Lin
@ 2016-11-18 12:01   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2016-11-18 12:01 UTC (permalink / raw)
  To: Axel Lin
  Cc: Oder Chiou, alsa-devel, Liam Girdwood, Julia Lawall, Mark Brown,
	Bard Liao

The patch

   ASoC: rt5665: Use devm_gpio_request_one()

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 f2826c1fe5d071fa437d337c41df979b60f0fc32 Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Wed, 16 Nov 2016 21:08:42 +0800
Subject: [PATCH] ASoC: rt5665: Use devm_gpio_request_one()

Simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5665.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c
index 7dfaaf1c2d14..324461e985b3 100644
--- a/sound/soc/codecs/rt5665.c
+++ b/sound/soc/codecs/rt5665.c
@@ -4677,11 +4677,9 @@ static int rt5665_i2c_probe(struct i2c_client *i2c,
 	}
 
 	if (gpio_is_valid(rt5665->pdata.ldo1_en)) {
-		if (devm_gpio_request(&i2c->dev, rt5665->pdata.ldo1_en,
-			"rt5665"))
+		if (devm_gpio_request_one(&i2c->dev, rt5665->pdata.ldo1_en,
+					  GPIOF_OUT_INIT_HIGH, "rt5665"))
 			dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n");
-		else if (gpio_direction_output(rt5665->pdata.ldo1_en, 1))
-			dev_err(&i2c->dev, "Fail gpio_direction gpio_ldo\n");
 	}
 
 	/* Sleep for 300 ms miniumum */
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Applied "ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate" to the asoc tree
  2016-11-16 13:08 [PATCH 1/2] ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate Axel Lin
  2016-11-16 13:08 ` [PATCH 2/2] ASoC: rt5665: Use devm_gpio_request_one() Axel Lin
@ 2016-11-18 12:01 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2016-11-18 12:01 UTC (permalink / raw)
  To: Axel Lin
  Cc: Oder Chiou, alsa-devel, Liam Girdwood, Julia Lawall, Mark Brown,
	Bard Liao

The patch

   ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate

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 0c95666f0d7364e364ab53e068f7891c98e90012 Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Wed, 16 Nov 2016 21:08:41 +0800
Subject: [PATCH] ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5665.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c
index 34254fd47efe..7dfaaf1c2d14 100644
--- a/sound/soc/codecs/rt5665.c
+++ b/sound/soc/codecs/rt5665.c
@@ -4587,7 +4587,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665)
 			pr_err("HP Calibration Failure\n");
 			regmap_write(rt5665->regmap, RT5665_RESET, 0);
 			regcache_cache_bypass(rt5665->regmap, false);
-			return;
+			goto out_unlock;
 		}
 
 		count++;
@@ -4606,7 +4606,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665)
 			pr_err("MONO Calibration Failure\n");
 			regmap_write(rt5665->regmap, RT5665_RESET, 0);
 			regcache_cache_bypass(rt5665->regmap, false);
-			return;
+			goto out_unlock;
 		}
 
 		count++;
@@ -4621,6 +4621,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665)
 	regmap_write(rt5665->regmap, RT5665_BIAS_CUR_CTRL_8, 0xa602);
 	regmap_write(rt5665->regmap, RT5665_ASRC_8, 0x0120);
 
+out_unlock:
 	mutex_unlock(&rt5665->calibrate_mutex);
 }
 
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-18 12:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-16 13:08 [PATCH 1/2] ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate Axel Lin
2016-11-16 13:08 ` [PATCH 2/2] ASoC: rt5665: Use devm_gpio_request_one() Axel Lin
2016-11-18 12:01   ` Applied "ASoC: rt5665: Use devm_gpio_request_one()" to the asoc tree Mark Brown
2016-11-18 12:01 ` Applied "ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate" " 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 NNTP newsgroup(s).