linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Gruber <clemens.gruber@pqgruber.com>
To: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@kernel.org>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Clemens Gruber <clemens.gruber@pqgruber.com>
Subject: [PATCH] ASoC: sgtl5000: only check VDDD-supply, not revision
Date: Tue, 31 May 2016 21:11:33 +0200	[thread overview]
Message-ID: <20160531191133.8518-1-clemens.gruber@pqgruber.com> (raw)

Instead of checking the SGTL5000 chip revision, we should only check if
the VDDD regulator exists and only call sgtl5000_replace_vddd_with_ldo
if the regulator is missing.
Otherwise, the user reads in the kernel log that the internal LDO is
used, even though he did follow the NXP recommendation to use external
VDDD and also specified VDDD-supply in the devicetree.

Also remove the comment, which incorrectly states that external VDDD is
only supported for SGTL5000 chip revisions < 0x11.
Official NXP documentation recommends using external VDDD and not the
internal LDO due to the SGTL5000 erratum ER1. This also applies to
revisions >= 0x11.

Tested on an i.MX6Q board with SGTL5000 rev 0x11 and external VDDD.

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
---
 sound/soc/codecs/sgtl5000.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 08b4046..fbad4fb 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1286,17 +1286,14 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
 	for (i = 0; i < ARRAY_SIZE(sgtl5000->supplies); i++)
 		sgtl5000->supplies[i].supply = supply_names[i];
 
-	/* External VDDD only works before revision 0x11 */
-	if (sgtl5000->revision < 0x11) {
-		vddd = regulator_get_optional(codec->dev, "VDDD");
-		if (IS_ERR(vddd)) {
-			/* See if it's just not registered yet */
-			if (PTR_ERR(vddd) == -EPROBE_DEFER)
-				return -EPROBE_DEFER;
-		} else {
-			external_vddd = 1;
-			regulator_put(vddd);
-		}
+	vddd = regulator_get_optional(codec->dev, "VDDD");
+	if (IS_ERR(vddd)) {
+		/* See if it's just not registered yet */
+		if (PTR_ERR(vddd) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+	} else {
+		external_vddd = 1;
+		regulator_put(vddd);
 	}
 
 	if (!external_vddd) {
-- 
2.8.3

             reply	other threads:[~2016-05-31 19:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 19:11 Clemens Gruber [this message]
2016-06-02 12:47 [PATCH] ASoC: sgtl5000: only check VDDD-supply, not revision Clemens Gruber
2016-06-02 15:48 ` Fabio Estevam
2016-06-02 16:56   ` Mark Brown
2016-06-03 15:52     ` Clemens Gruber
2016-06-03 16:23   ` Eric Nelson
2016-06-04  5:18     ` Eric Nelson
2016-06-04  9:03       ` Clemens Gruber
2016-06-06 17:55 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160531191133.8518-1-clemens.gruber@pqgruber.com \
    --to=clemens.gruber@pqgruber.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).