From patchwork Tue May 21 10:36:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 10953375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A112C76 for ; Tue, 21 May 2019 10:40:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FF5A28714 for ; Tue, 21 May 2019 10:40:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8278F28990; Tue, 21 May 2019 10:40:30 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C5F9C28714 for ; Tue, 21 May 2019 10:40:29 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 06EE4167F; Tue, 21 May 2019 12:39:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 06EE4167F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1558435228; bh=QIXoo3JuxZSdgOyDDAcWhaeEzNYB8OpWzYGH9fl5FQg=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NkHSnbl0BlAzVMx6f72dnArD/tB+tYUIpHeRI3YrvcyaZtv0X33qdZquj9UahvFwF BJ36VKNHeS62A7GMcZ3TdlrM0XUswavzdAw4Go+hfzjM2X2hOrqmygk0VSh7kIUD3E 7yUUf088HvT3uS5u3HGRlLEOPmM7H8z5rZLXJHgk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 594F7F89733; Tue, 21 May 2019 12:36:50 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 779C7F8972A; Tue, 21 May 2019 12:36:44 +0200 (CEST) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1AD56F89715 for ; Tue, 21 May 2019 12:36:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1AD56F89715 Received: by mail-ed1-f67.google.com with SMTP id w11so28617079edl.5 for ; Tue, 21 May 2019 03:36:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=8RfPufMa3HqwhdEyx05OxfiupMkKyekwoF0H9MJSyDg=; b=RwUwA7ntDFMODq5VXYvIgNQBnl8zOdgHsyjpt7229XsTw8oJGHyjEtNVqXoJYgwpr2 AHO9U3Hsk0su0ADXC9qUMIEcYzeJBgyCCmXiUTnWYySL/JCY37mjn+ldm/OkOcV0kEC4 uNlvVpGAeRh3jKu9IIJBpvLGapy9k8qpSIKHN+rThR/+SJNIU4BhFWJYYEiTBbHLBkvt V56kNY71jDYpGX39tPreAInnbwn8WLnkbtCpSCVRqUR4oAc/8OvaI//ZU8lTcAparCie qFWmw1dVRFDXgqjRRSKOU/dtiiINpQidFEIi+xCWrW6Sa8QWqhm29vbsVXyOxqAwjOeT 2aiA== X-Gm-Message-State: APjAAAW5dqxh3ZnHTYxpyaY/17OHtGtNOpYNAlu52Lc9A/q77PJ8fSxA XP7c1KJwgvMJBg/mrzX5PoMInLNvqoIb3bCeBWZnwRUT1O/B/ucJAvbkF4rq7kQVu3Kze6Xu7Mi RLfGofgkBIUiMgx8= X-Google-Smtp-Source: APXvYqzvSL/hShohKCzVE7yqXSTyYlRnEwlsVmuEB6NTByIayC3kwlFUvM+IPASXPZk8yT2yog7+ag== X-Received: by 2002:a17:906:eca3:: with SMTP id qh3mr31146094ejb.139.1558434999212; Tue, 21 May 2019 03:36:39 -0700 (PDT) Received: from localhost ([194.105.145.90]) by smtp.gmail.com with ESMTPSA id g11sm6207876eda.42.2019.05.21.03.36.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 03:36:38 -0700 (PDT) From: Oleksandr Suvorov To: Fabio Estevam Date: Tue, 21 May 2019 13:36:17 +0300 Message-Id: <20190521103619.4707-5-oleksandr.suvorov@toradex.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190521103619.4707-1-oleksandr.suvorov@toradex.com> References: <20190521103619.4707-1-oleksandr.suvorov@toradex.com> MIME-Version: 1.0 Cc: Marcel Ziswiler , Igor Opaniuk , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Oleksandr Suvorov Subject: [alsa-devel] [PATCH v1 4/6] ASoC: sgtl5000: Fix charge pump source assignment X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP If VDDA != VDDIO and any of them is greater than 3.1V, charge pump source can be assigned automatically. Signed-off-by: Oleksandr Suvorov Reviewed-by: Marcel Ziswiler --- sound/soc/codecs/sgtl5000.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git sound/soc/codecs/sgtl5000.c sound/soc/codecs/sgtl5000.c index e813a37910af..ee1e4bf61322 100644 --- sound/soc/codecs/sgtl5000.c +++ sound/soc/codecs/sgtl5000.c @@ -1174,12 +1174,16 @@ static int sgtl5000_set_power_regs(struct snd_soc_component *component) SGTL5000_INT_OSC_EN); /* Enable VDDC charge pump */ ana_pwr |= SGTL5000_VDDC_CHRGPMP_POWERUP; - } else if (vddio >= 3100 && vdda >= 3100) { + } else { ana_pwr &= ~SGTL5000_VDDC_CHRGPMP_POWERUP; - /* VDDC use VDDIO rail */ - lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD; - lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO << - SGTL5000_VDDC_MAN_ASSN_SHIFT; + /* if vddio == vdda the source of charge pump should be + * assigned manually to VDDIO + */ + if (vddio == vdda) { + lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD; + lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO << + SGTL5000_VDDC_MAN_ASSN_SHIFT; + } } snd_soc_component_write(component, SGTL5000_CHIP_LINREG_CTRL, lreg_ctrl);