From patchwork Thu Feb 26 22:54:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 5896591 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 39FC39F373 for ; Thu, 26 Feb 2015 22:57:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65E9C20382 for ; Thu, 26 Feb 2015 22:57:42 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 26F6E2034B for ; Thu, 26 Feb 2015 22:57:41 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 37285265050; Thu, 26 Feb 2015 23:57:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id DFF4E264EAA; Thu, 26 Feb 2015 23:55:33 +0100 (CET) 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 7FFAC265087; Thu, 26 Feb 2015 23:55:32 +0100 (CET) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by alsa0.perex.cz (Postfix) with ESMTP id 0968126149E for ; Thu, 26 Feb 2015 23:54:54 +0100 (CET) Received: by pabrd3 with SMTP id rd3so17591403pab.1 for ; Thu, 26 Feb 2015 14:54:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AH5q4PnU2CE1BnryRVONiyBQIaWv5YD21euqoY5Kexw=; b=aspUK4SBPvOYHabXEHo9g/vhugYgaLqUZ/8cZ/pugNaURJoJVPLD6BWqmikgUVNFzR EaTlGIAaSjqbxBtF7RwfRC0SqIxDavQfn+dcL65lt+CYUxa7IWwZsa9Ia7kFUTIyMS5T t7OYTPqaSEHQ6jxkDl/Dqc9VKUtinOpMegWfKNMIvWkukD9sA+tsEHsiu2eYpglfRXwy C1erOEOnD9qbUdQVdE0xRVMky6/TA7TS7/Sny0VuPWcAT1rfppI86wDhA1Yu/wtvV8Cj YTUQkXTNZ5FIf+G4gKizRhC+0AhVJME9UkMf7mxxSjWeIjcsbJ67vtZ4Zo5jWvNcftZi Zvdg== X-Gm-Message-State: ALoCoQmC2KPlLtG1uwnlsF1ORLupFqDnH50sXMl4xJDaAOUXCVGPonYRjPQ0FroV9vVWzkMBxN2l X-Received: by 10.66.235.1 with SMTP id ui1mr18709288pac.80.1424991290929; Thu, 26 Feb 2015 14:54:50 -0800 (PST) Received: from ericsam.boundarydevices.com (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by mx.google.com with ESMTPSA id i7sm1915431pbq.92.2015.02.26.14.54.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Feb 2015 14:54:49 -0800 (PST) From: Eric Nelson To: alsa-devel@alsa-project.org Date: Thu, 26 Feb 2015 15:54:32 -0700 Message-Id: <1424991273-10081-6-git-send-email-eric.nelson@boundarydevices.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424991273-10081-1-git-send-email-eric.nelson@boundarydevices.com> References: <1424991273-10081-1-git-send-email-eric.nelson@boundarydevices.com> Cc: fabio.estevam@freescale.com, lars@metafoo.de, tiwai@suse.de, Eric Nelson , lgirdwood@gmail.com, broonie@kernel.org, rmk+kernel@arm.linux.org.uk, jean-michel.hautbois@vodalys.com, troy.kisky@boundarydevices.com Subject: [alsa-devel] [RFC PATCH 5/6] ASoC: sgtl5000: disable internal PLL early 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 To handle the soft reboot case, the internal PLL must be disabled in SGTL5000_CHIP_CLK_CTRL before clearing bits SGTL5000_VCOAMP_POWERUP and SGTL5000_PLL_POWERUP in register SGTL5000_CHIP_ANA_POWER. Signed-off-by: Eric Nelson --- sound/soc/codecs/sgtl5000.c | 9 ++++++++- sound/soc/codecs/sgtl5000.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index c373991..5f7dd5d 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -38,7 +38,6 @@ /* default value of sgtl5000 registers */ static const struct reg_default sgtl5000_reg_defaults[] = { { SGTL5000_CHIP_DIG_POWER, 0x0000 }, - { SGTL5000_CHIP_CLK_CTRL, 0x0008 }, { SGTL5000_CHIP_I2S_CTRL, 0x0010 }, { SGTL5000_CHIP_SSS_CTRL, 0x0010 }, { SGTL5000_CHIP_ADCDAC_CTRL, 0x020c }, @@ -1248,6 +1247,14 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, dev_info(&client->dev, "sgtl5000 revision 0x%x\n", rev); sgtl5000->revision = rev; + /* reconfigure the clocks in case we're using the PLL */ + ret = regmap_write(sgtl5000->regmap, + SGTL5000_CHIP_CLK_CTRL, + SGTL5000_CHIP_CLK_CTRL_DEFAULT); + if (ret) + dev_err(&client->dev, + "Error %d initializing CHIP_CLK_CTRL\n", ret); + /* Follow section 2.2.1.1 of AN3663 */ ana_pwr = SGTL5000_ANA_POWER_DEFAULT; if (sgtl5000->num_supplies <= VDDD) { diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h index 6fdc589..a97e3f4 100644 --- a/sound/soc/codecs/sgtl5000.h +++ b/sound/soc/codecs/sgtl5000.h @@ -92,6 +92,7 @@ /* * SGTL5000_CHIP_CLK_CTRL */ +#define SGTL5000_CHIP_CLK_CTRL_DEFAULT 0x0008 #define SGTL5000_RATE_MODE_MASK 0x0030 #define SGTL5000_RATE_MODE_SHIFT 4 #define SGTL5000_RATE_MODE_WIDTH 2