From patchwork Thu Mar 21 22:15:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cormier X-Patchwork-Id: 10864437 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 9DBC21390 for ; Thu, 21 Mar 2019 22:20:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B8632A4E8 for ; Thu, 21 Mar 2019 22:20:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FB1B2A530; Thu, 21 Mar 2019 22:20:47 +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 A5D582A4E9 for ; Thu, 21 Mar 2019 22:20:46 +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 DCA3586F; Thu, 21 Mar 2019 23:19:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DCA3586F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1553206844; bh=P2BiquOdWDW61vmA/hg1qTokj4gNh0vU+FqBPCuEQE4=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CtaDy9fVIKF5oT5Xpg9ov5B265IPCtYH6MhEB+h5XPmIT8y8B19jLSdqbNS9QukHn Jz7PptpZ/BBXlOHZbtTkojJbnYSCfLkp5OqP4be3Y2ajObSM88ok6ea/yTPYfiOOGA LyHD/RwDx8bstfX8+P3Y0M/LEYittLvW/Pdy9cYw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1FA6CF89731; Thu, 21 Mar 2019 23:16:15 +0100 (CET) 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 88EF0F8971B; Thu, 21 Mar 2019 23:16:10 +0100 (CET) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (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 AA6B1F89693 for ; Thu, 21 Mar 2019 23:16:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AA6B1F89693 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=criticallink.com header.i=@criticallink.com header.b="Rd/NcxI3" Received: by mail-qt1-x841.google.com with SMTP id h39so465952qte.2 for ; Thu, 21 Mar 2019 15:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=criticallink.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PaAiK0DR2sIQWzoKy9Rm5Q9ewZFtpvbkDJA7a+dgNIQ=; b=Rd/NcxI3SiTqghKLtjSSi1Yv28GGZ5BOQx3mDk4NUx9AFttyl7VoBpY54e/v8KJMWA bk/e25I4k7LbksAsM5o95GzMKquXi14B860qYXdfuQK9Ggp6qR5vGIl0YwXTD6PIXgos WPP4soeT8fF/8qI+GWDRie/n8PRHERwT1ehRO85Zw3SAFx7jVquWlepCwtqF8qMXVa04 yENVJHPLxfVAqv2Nq7rqEb36bg/phHF0SxrWRDCsJf09l2bYG0puJgWn5Ph+CWwC8z4P 7imCkSkCTz+HQrVQDYND4Nsb6A+UZhiFgTK+ExloSKme8FOWbN7ERco0P5Ssi2xj9Sno RNWA== 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:content-transfer-encoding; bh=PaAiK0DR2sIQWzoKy9Rm5Q9ewZFtpvbkDJA7a+dgNIQ=; b=R83guSYpkuQ8jSInGuB3N5XDzM4QQKgj6hwjm7YHm8S//gKTRyhLMIeZntsbMC/en2 FC44Tk+OR6b4YCg9n0JvZeRh/WDhFpydcYX4KRoIk1w2M/uILkebvQyxKgIeByRnl+TJ l7/6E30IYCyqnsUcvDpvomsjaB0YxeSJN3fY59N8OhgNUB5deRcNXMVqucrQFqQxoDum SHbCG1s+aCbAlmIqt57jBSefI6J5OpPNM63c1mXDq7sx4cclJR3bEgBFlwvc8FROLTyB VD6RmSNqWVQY+30TmE5adErLGSJQlib/d9LJi5aiMM0GL2JaNRH2MwxVovBOQuWk/QSb ys3Q== X-Gm-Message-State: APjAAAUUB1/WkXDZjB2ayr9UPq/jse+qkhgKsnmJOUPBcJX/zgqudEze C86veOtnFTs+sYFVnH2HzzOlxjVAJjWQMqrp X-Google-Smtp-Source: APXvYqxW8KY5acPBbd3l0z7nMTSHAl2jEQL/aIeaTfianJL+n6xtWTDQ5tXC94y66IRi+2VRm6PqsA== X-Received: by 2002:ac8:3202:: with SMTP id x2mr5262310qta.56.1553206564811; Thu, 21 Mar 2019 15:16:04 -0700 (PDT) Received: from jcormier-MS-7A93.syr.criticallink.com (static-72-90-70-109.syrcny.fios.verizon.net. [72.90.70.109]) by smtp.gmail.com with ESMTPSA id w37sm3895968qtw.27.2019.03.21.15.16.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 15:16:03 -0700 (PDT) From: "Cormier, Jonathan" To: Liam Girdwood , devicetree@vger.kernel.org Date: Thu, 21 Mar 2019 18:15:48 -0400 Message-Id: <20190321221549.13765-7-jcormier@criticallink.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190321221549.13765-1-jcormier@criticallink.com> References: <20190321221549.13765-1-jcormier@criticallink.com> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Bob Duke , Mark Brown , linux-kernel@vger.kernel.org, Takashi Iwai , Rob Herring , Peter Ujfalusi , Mike Williamson , Jyri Sarha , Greg Gluszek , Misael Lopez Cruz Subject: [alsa-devel] [PATCH v2 6/7] ASoC: tlv320aic26: hw_params was unintentionally clearing AIC26 master mode 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 Commit 5b0959d472c2 ("ASoC: tlv320aic26: Use snd_soc_update_bits()") broke setting AIC26_REG_AUDIO_CTRL3 in master mode when fsref happens to be 48000. The master mode bit was getting cleared. Also fix setting AIC26_REG_DAC_GAIN and AIC26_REG_AUDIO_CTRL2 which was broke by same commit. Fixes 5b0959d472c2 ("ASoC: tlv320aic26: Use snd_soc_update_bits()") Signed-off-by: Cormier, Jonathan --- sound/soc/codecs/tlv320aic26.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index cd1bcb9cbfe1..c6ff4ca29d43 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c @@ -138,11 +138,12 @@ static int aic26_hw_params(struct snd_pcm_substream *substream, snd_soc_component_write(component, AIC26_REG_PLL_PROG2, reg); /* Audio Control 3 (master mode, fsref rate) */ + reg = 0; if (aic26->master) - reg = 0x0800; + reg |= 0x0800; if (fsref == 48000) - reg = 0x2000; - snd_soc_component_update_bits(component, AIC26_REG_AUDIO_CTRL3, 0xf800, reg); + reg |= 0x2000; + snd_soc_component_update_bits(component, AIC26_REG_AUDIO_CTRL3, 0x2800, reg); /* Audio Control 1 (FSref divisor) */ reg = wlen | aic26->datfm | (divisor << 3) | divisor; @@ -167,7 +168,7 @@ static int aic26_mute(struct snd_soc_dai *dai, int mute) reg = 0x8080; else reg = 0; - snd_soc_component_update_bits(component, AIC26_REG_DAC_GAIN, 0x8000, reg); + snd_soc_component_update_bits(component, AIC26_REG_DAC_GAIN, 0x8080, reg); return 0; } @@ -302,7 +303,7 @@ static ssize_t aic26_keyclick_set(struct device *dev, struct aic26 *aic26 = dev_get_drvdata(dev); snd_soc_component_update_bits(aic26->component, AIC26_REG_AUDIO_CTRL2, - 0x8000, 0x800); + 0x8000, 0x8000); return count; }