Message ID | 20240118165811.13672-3-johan+linaro@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-30384-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp478422dyb; Thu, 18 Jan 2024 08:59:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/Mv2i6JMAf5YFGv9fVkqd06M+Sg9BsNC9iKuX3X1vDhSmAR/6LiuQ51sSxj8g/18S6jJu X-Received: by 2002:a17:903:8cb:b0:1d0:711b:c2d2 with SMTP id lk11-20020a17090308cb00b001d0711bc2d2mr1355212plb.13.1705597187623; Thu, 18 Jan 2024 08:59:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705597187; cv=pass; d=google.com; s=arc-20160816; b=0fGqyud0JWJYb6PXmqWuZthZKnbr4YY/K4aXH5NTVqin7unq3dm/DuxxVC3xy8OfUb jKKYGE84ujmAM2zXcmX28kLJecZpBiUopaPjPirajiAdel8h/fkoGaQTFZNWCz47iMz0 fW28j91vtUNIk1wTXHIHAhKpqdY8PV0FYEkl91TlM9aY2LJcHVNcTQE1FFwDBg63najn xmiT4qUkGe9gm1xgfDykDf/INGUEC6rBPrlWWSMzBaXXMgdnWSulZLDKg/kVEdBXQY7v MGA/t/QjbILNZ1zTdx0mNfznJ0v+crd0jOZo6+q1JQZNN54B9GmeQYA1tsksL4He2/ro OCuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/OB58/0SEKgUfAGWrHefb87LXiXRz/jLwFA02dUicV4=; fh=KBIhiGdu1Ygtr3M+FTFcsBcOHAnQgw4Q3/a7frwkCBE=; b=VqG7pg4YxlX1Z7TLp6+LioPOebt7nRmx2WrpfCfphoF2qgdOgmHpE0eVr8O+xc96Oo 0SMChTOSEaaUxMtEuv1me62bLsmdimr75MjnzY8rz1C4qAkv3ghNnG+cAWUJc97djaU2 aBj/RjLtBVF3vSF/ODeNRXisou3aY8UYbdKNnOOHUjUnOUw8u9GiwXmjy3rcqodzKQPn ilZJIyf7eIVmEcePbdxPxI4Qd190myhJiwVIyPs/mrQlG6P3bBXsU3JnPclm4oSWvOi8 D2X74C3/fkIsfVBtvIhL25nGMM+Q2QR7xHKuyc1sekd00gwcECY4ZLlQZZwUVWQrLcaJ IPSQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iwI2G4Ac; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30384-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30384-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q7-20020a170902b10700b001d704c26edbsi1524037plr.560.2024.01.18.08.59.47 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 08:59:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30384-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iwI2G4Ac; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30384-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30384-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6313528124F for <ouuuleilei@gmail.com>; Thu, 18 Jan 2024 16:59:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B7BE42D637; Thu, 18 Jan 2024 16:58:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iwI2G4Ac" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F15712C6AB; Thu, 18 Jan 2024 16:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705597106; cv=none; b=sN5KMbQ7AuKgzEUpQubfKWCmUiHhaObDVWmj67gOus2TOS6nM/n/JyJSEbDfrUUA5t7VyshvTsWynMaEiAqgiaFcGG4WIVphUyEjvW9l+2X5On+zLtpW65VmydqngtZmAl3ijEbiHuMMX9Ro438IbkkUYn1EtMSzSpQonj+U7vo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705597106; c=relaxed/simple; bh=Khc6okNYonivQKkrXDtCP9RflkoszTHGolHQDW410oI=; h=Received:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=uyFmnGHW76LhQ3ZHEGtIjTJhnBtaFUnf7zaK/49U/DTrIUYDY9z6T8XKpGEz3ziOVnWPVfRgGi5boZF2kAejAYz46HHWOm3STGyCzfK6oSKcvOQqT2+/2ULMqT633YeBN4rmxDzirCp5gJT0rx7zLmZqhh0+R6lsF8P8rvr3llo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iwI2G4Ac; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A1BEC433F1; Thu, 18 Jan 2024 16:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705597105; bh=Khc6okNYonivQKkrXDtCP9RflkoszTHGolHQDW410oI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iwI2G4Ac0q+adLKeZDRND0ELSZSYkr4695P1BsUaED08JEU/WUFI/hIAv0RlqRE+4 RIEV9YWns7dy2v8f2DARuK1sfC/jM7wY/94WdIkuuMp6XWfsBLiewShKii0bc+I2k+ fgQ6puoW1ZxdHvK2sRWURd3XCAWE6v7/RnB1Mlop8rVj+704L6NwJiz1tP857vPtgj UgFFNJ34WP4ASZL50RjMY2j8/fbSLG8Om6Z85hfhLvFuSGjiP4UQL2mupu3hAhMzP1 LrbsjZ+cbFRW0Acx/xqq+8By/4oO0pidYVS5oR3Hp1Y9VIzU1gzZ5humi8rixjHK5a XhhVmkfYz6/zg== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from <johan+linaro@kernel.org>) id 1rQVir-0003Z0-29; Thu, 18 Jan 2024 17:58:33 +0100 From: Johan Hovold <johan+linaro@kernel.org> To: Mark Brown <broonie@kernel.org> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Banajit Goswami <bgoswami@quicinc.com>, Liam Girdwood <lgirdwood@gmail.com>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold <johan+linaro@kernel.org>, stable@vger.kernel.org Subject: [PATCH v3 2/5] ASoC: codecs: wsa883x: lower default PA gain Date: Thu, 18 Jan 2024 17:58:08 +0100 Message-ID: <20240118165811.13672-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240118165811.13672-1-johan+linaro@kernel.org> References: <20240118165811.13672-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788448277050749614 X-GMAIL-MSGID: 1788448277050749614 |
Series |
ASoC: qcom: volume fixes and codec cleanups
|
|
Commit Message
Johan Hovold
Jan. 18, 2024, 4:58 p.m. UTC
The default PA gain is set to a pretty high level of 15 dB. Initialise
the register to the minimum -3 dB level instead.
This is specifically needed to allow machine drivers to use the lowest
level as a volume limit.
Cc: stable@vger.kernel.org # 6.5
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
sound/soc/codecs/wsa883x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Jan 18, 2024 at 05:58:08PM +0100, Johan Hovold wrote: > The default PA gain is set to a pretty high level of 15 dB. Initialise > the register to the minimum -3 dB level instead. > > This is specifically needed to allow machine drivers to use the lowest > level as a volume limit. > @@ -722,7 +722,7 @@ static struct reg_default wsa883x_defaults[] = { > { WSA883X_WAVG_PER_6_7, 0x88 }, > { WSA883X_WAVG_STA, 0x00 }, > { WSA883X_DRE_CTL_0, 0x70 }, > - { WSA883X_DRE_CTL_1, 0x08 }, > + { WSA883X_DRE_CTL_1, 0x1e }, This is broken, the register defaults provided to regmap need to correspond to whatever the hardware default is since for example a register cache sync will not write back any default values (as they should already be there in the hardware). Anything like this would need to be done by writes during init.
On 18/01/2024 16:58, Johan Hovold wrote: > The default PA gain is set to a pretty high level of 15 dB. Initialise > the register to the minimum -3 dB level instead. > > This is specifically needed to allow machine drivers to use the lowest > level as a volume limit. > > Cc: stable@vger.kernel.org # 6.5 > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > --- > sound/soc/codecs/wsa883x.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c > index 32983ca9afba..8942c88dee09 100644 > --- a/sound/soc/codecs/wsa883x.c > +++ b/sound/soc/codecs/wsa883x.c > @@ -722,7 +722,7 @@ static struct reg_default wsa883x_defaults[] = { > { WSA883X_WAVG_PER_6_7, 0x88 }, > { WSA883X_WAVG_STA, 0x00 }, > { WSA883X_DRE_CTL_0, 0x70 }, > - { WSA883X_DRE_CTL_1, 0x08 }, this is hw default value. > + { WSA883X_DRE_CTL_1, 0x1e }, > { WSA883X_DRE_IDLE_DET_CTL, 0x1F }, > { WSA883X_CLSH_CTL_0, 0x37 }, > { WSA883X_CLSH_CTL_1, 0x81 },
On Thu, Jan 18, 2024 at 05:21:48PM +0000, Mark Brown wrote: > On Thu, Jan 18, 2024 at 05:58:08PM +0100, Johan Hovold wrote: > > The default PA gain is set to a pretty high level of 15 dB. Initialise > > the register to the minimum -3 dB level instead. > > > > This is specifically needed to allow machine drivers to use the lowest > > level as a volume limit. > > > @@ -722,7 +722,7 @@ static struct reg_default wsa883x_defaults[] = { > > { WSA883X_WAVG_PER_6_7, 0x88 }, > > { WSA883X_WAVG_STA, 0x00 }, > > { WSA883X_DRE_CTL_0, 0x70 }, > > - { WSA883X_DRE_CTL_1, 0x08 }, > > + { WSA883X_DRE_CTL_1, 0x1e }, > > This is broken, the register defaults provided to regmap need to > correspond to whatever the hardware default is since for example a > register cache sync will not write back any default values (as they > should already be there in the hardware). Anything like this would need > to be done by writes during init. Bah, thanks for catching that. For some reason this was enough to have the driver initialise the register at boot at least. I'll set it explicitly at probe instead. Johan
On Fri, Jan 19, 2024 at 07:15:33AM +0000, Srinivas Kandagatla wrote: > > > On 18/01/2024 16:58, Johan Hovold wrote: > > The default PA gain is set to a pretty high level of 15 dB. Initialise > > the register to the minimum -3 dB level instead. > > > > This is specifically needed to allow machine drivers to use the lowest > > level as a volume limit. > > > > Cc: stable@vger.kernel.org # 6.5 > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > > --- > > sound/soc/codecs/wsa883x.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c > > index 32983ca9afba..8942c88dee09 100644 > > --- a/sound/soc/codecs/wsa883x.c > > +++ b/sound/soc/codecs/wsa883x.c > > @@ -722,7 +722,7 @@ static struct reg_default wsa883x_defaults[] = { > > { WSA883X_WAVG_PER_6_7, 0x88 }, > > { WSA883X_WAVG_STA, 0x00 }, > > { WSA883X_DRE_CTL_0, 0x70 }, > > - { WSA883X_DRE_CTL_1, 0x08 }, > > this is hw default value. Indeed. This was a last minute change when I noticed I could actually set the lowest limit in the machine driver after I offset it, but then the reset value was never updated. Didn't think this through. > > + { WSA883X_DRE_CTL_1, 0x1e }, > > { WSA883X_DRE_IDLE_DET_CTL, 0x1F }, > > { WSA883X_CLSH_CTL_0, 0x37 }, > > { WSA883X_CLSH_CTL_1, 0x81 }, Johan
diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c index 32983ca9afba..8942c88dee09 100644 --- a/sound/soc/codecs/wsa883x.c +++ b/sound/soc/codecs/wsa883x.c @@ -722,7 +722,7 @@ static struct reg_default wsa883x_defaults[] = { { WSA883X_WAVG_PER_6_7, 0x88 }, { WSA883X_WAVG_STA, 0x00 }, { WSA883X_DRE_CTL_0, 0x70 }, - { WSA883X_DRE_CTL_1, 0x08 }, + { WSA883X_DRE_CTL_1, 0x1e }, { WSA883X_DRE_IDLE_DET_CTL, 0x1F }, { WSA883X_CLSH_CTL_0, 0x37 }, { WSA883X_CLSH_CTL_1, 0x81 },