From patchwork Tue May 31 19:11:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clemens Gruber X-Patchwork-Id: 9145529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 511A060761 for ; Tue, 31 May 2016 19:13:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43C071FE7B for ; Tue, 31 May 2016 19:13:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3537126240; Tue, 31 May 2016 19:13:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40B341FE7B for ; Tue, 31 May 2016 19:13:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0CC5C265DFC; Tue, 31 May 2016 21:13:17 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 479B02657B8; Tue, 31 May 2016 21:13:09 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1DA8E2657B8; Tue, 31 May 2016 21:13:07 +0200 (CEST) Received: from mail.pqgruber.com (mail.pqgruber.com [178.189.19.235]) by alsa0.perex.cz (Postfix) with ESMTP id 917BE2657BE for ; Tue, 31 May 2016 21:12:57 +0200 (CEST) Received: from archie.tuxnet.lan (chello213047168109.15.14.vie.surfer.at [213.47.168.109]) by mail.pqgruber.com (Postfix) with ESMTPSA id A6F4375A42; Tue, 31 May 2016 21:12:52 +0200 (CEST) From: Clemens Gruber To: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Date: Tue, 31 May 2016 21:11:33 +0200 Message-Id: <20160531191133.8518-1-clemens.gruber@pqgruber.com> X-Mailer: git-send-email 2.8.3 Cc: Clemens Gruber , Liam Girdwood , Takashi Iwai , Mark Brown , Fabio Estevam Subject: [alsa-devel] [PATCH] ASoC: sgtl5000: only check VDDD-supply, not revision X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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) {