Message ID | 20221110190612.1341469-1-detlev.casanova@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp325683wru; Thu, 10 Nov 2022 11:11:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf66554OZMqJ9R9GE2a/OxqReB28oQJRT3QdSMk0ZxKNMo+8Es98Cs3RuLS+5C6/IMGwd79I X-Received: by 2002:a17:902:b194:b0:186:e377:f4e1 with SMTP id s20-20020a170902b19400b00186e377f4e1mr11153122plr.8.1668107510342; Thu, 10 Nov 2022 11:11:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668107510; cv=none; d=google.com; s=arc-20160816; b=fqyAafLBjKILwwFssfU5YBELlbbwVy/S+LGARG/Fc5LiOyVzLUVWy7clAkCULqI0q+ nGRMXM5lCdUIajGGpjpviGBLZ/TlMr/i/9VLIEnW2VyWOoUK1oMtyuF5G6KiO7ixRnvK 4l80RihYbgIGKOQTJ0gjTFQt9HcFoS32eNVze7eNp2OQDGq/CMrbq2UZmjfFVBD+sWEp 9De3P89SsFhPb2XsaOtHDZiuknlN837ATosxLBBU2NTiSX68RhTr53hdJd9agm5TdZAH pGziK5IfR9vKCZ9dDtCxQFGWq7onvPYRZUwM6/v66GNImLDelfoWDH8GQgdvWG0rdrv9 bwZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ARnbs5NH180s39CRaNkWrlslsbzyRg5tt1NyhYSgmrE=; b=0YYC8aJLE/X28KLbMQAVDYD6mDp3B3na72gZwbYOn1JDz7xoOWbsN484lSXijUDNKU xW4aHSr84p0fitYpquZAk6L1isl6mU5K+2fLCUGUfHBOPCSVwLj9qjebb5kI2uMnkPs/ LZRO6G3r5hRb4ENPYG0YzoIDdHz+am61VaHF+slEXrHYCssrX7cnlIcsRYNSFQv3HWpU gM55CSn+AQ2AWYLwQLKBRM9gtfjKqSNTPURZHYlZD285vWYVdZe1llexTIBdq9/xymZY mgNU7FmQBtqnwBPxJl5zWHXFRlYLjCI4063MI/uru0qFUAPgqWS/bhY1Ni7v3h92qmBN I7ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=J7jstCeg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8-20020a17090a2e0800b001fd70129092si350906pjd.15.2022.11.10.11.11.35; Thu, 10 Nov 2022 11:11:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=J7jstCeg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231778AbiKJTIg (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Thu, 10 Nov 2022 14:08:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231262AbiKJTHo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 10 Nov 2022 14:07:44 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05A1B52888 for <linux-kernel@vger.kernel.org>; Thu, 10 Nov 2022 11:06:22 -0800 (PST) Received: from Falcon9.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by madras.collabora.co.uk (Postfix) with ESMTPSA id C6DDB6602A34; Thu, 10 Nov 2022 19:06:19 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1668107181; bh=AWn2hMQjAaWJ1yIP6Ub6bVX80rgEocaexixG2fBvbEc=; h=From:To:Cc:Subject:Date:From; b=J7jstCegJdnMChsGzYEVIeUtXBat6bnIgQ1Be2G+DXquqZv3j1330qoVfyE485Y2p reDS3oHVjfsqMtFOPaynMp3hqvzGp8zVX2rgJFkW7xq5b+Cr+4vL1YSAYS3se1lCvj b3lUyhIpTDwAs6ujL4jz1P+pzWbUX1qlq792H3OnvrGLyi6SoSQGmoF5r1v5wVz3Yl 5j08klmvrfq+adYP7HNXXeSrIUaB0i/eGsjB034BLvzgehdOO34/7plHOX2gkmWdAA Okk53+12zgevZI5L+y7wXFYPpI8hGWfUTtoGqxnT+fT2pSgWkr4rMa0vg0iIb7QgxU 9F2Xt3KDN2/bw== From: Detlev Casanova <detlev.casanova@collabora.com> To: linux-kernel@vger.kernel.org Cc: Fabio Estevam <festevam@gmail.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, alsa-devel@alsa-project.org (moderated list:NXP SGTL5000 DRIVER), Detlev Casanova <detlev.casanova@collabora.com> Subject: [PATCH] ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove Date: Thu, 10 Nov 2022 14:06:12 -0500 Message-Id: <20221110190612.1341469-1-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749137500997958265?= X-GMAIL-MSGID: =?utf-8?q?1749137500997958265?= |
Series |
ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove
|
|
Commit Message
Detlev Casanova
Nov. 10, 2022, 7:06 p.m. UTC
Since commit bf2aebccddef ("ASoC: sgtl5000: Fix noise on shutdown/remove"),
the device power control registers are reset when the driver is
removed/shutdown.
This is an issue when the device is configured to use the PLL clock. The
device will stop responding if it is still configured to use the PLL
clock but the PLL clock is powered down.
When rebooting linux, the probe function will show:
sgtl5000 0-000a: Error reading chip id -11
Make sure that the CHIP_CLK_CTRL is reset to its default value before
powering down the device.
Fixes: bf2aebccddef ("ASoC: sgtl5000: Fix noise on shutdown/remove")
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
---
sound/soc/codecs/sgtl5000.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Thu, Nov 10, 2022 at 4:06 PM Detlev Casanova <detlev.casanova@collabora.com> wrote: > > Since commit bf2aebccddef ("ASoC: sgtl5000: Fix noise on shutdown/remove"), > the device power control registers are reset when the driver is > removed/shutdown. > > This is an issue when the device is configured to use the PLL clock. The > device will stop responding if it is still configured to use the PLL > clock but the PLL clock is powered down. > > When rebooting linux, the probe function will show: > sgtl5000 0-000a: Error reading chip id -11 > > Make sure that the CHIP_CLK_CTRL is reset to its default value before > powering down the device. > > Fixes: bf2aebccddef ("ASoC: sgtl5000: Fix noise on shutdown/remove") > Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
On Thu, 10 Nov 2022 14:06:12 -0500, Detlev Casanova wrote: > Since commit bf2aebccddef ("ASoC: sgtl5000: Fix noise on shutdown/remove"), > the device power control registers are reset when the driver is > removed/shutdown. > > This is an issue when the device is configured to use the PLL clock. The > device will stop responding if it is still configured to use the PLL > clock but the PLL clock is powered down. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: sgtl5000: Reset the CHIP_CLK_CTRL reg on remove commit: 0bb8e9b36b5b7f2e77892981ff6c27ee831d8026 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 4b2135eba74d..a916f4619ea3 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1794,6 +1794,7 @@ static void sgtl5000_i2c_remove(struct i2c_client *client) { struct sgtl5000_priv *sgtl5000 = i2c_get_clientdata(client); + regmap_write(sgtl5000->regmap, SGTL5000_CHIP_CLK_CTRL, SGTL5000_CHIP_CLK_CTRL_DEFAULT); regmap_write(sgtl5000->regmap, SGTL5000_CHIP_DIG_POWER, SGTL5000_DIG_POWER_DEFAULT); regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, SGTL5000_ANA_POWER_DEFAULT);