Message ID | 20240117090331.31111-2-johan+linaro@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-28688-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:42cf:b0:101:a8e8:374 with SMTP id q15csp781895dye; Wed, 17 Jan 2024 01:04:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvu0hyMZqYVweExeKgMlY85Z1yGdVGqD7zDs7E6EVOOVAlt91+QU6sQs2bx51+V8bTbb3+ X-Received: by 2002:a17:907:2088:b0:a2e:d24e:8b28 with SMTP id pv8-20020a170907208800b00a2ed24e8b28mr247437ejb.26.1705482293993; Wed, 17 Jan 2024 01:04:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705482293; cv=pass; d=google.com; s=arc-20160816; b=p2nORyIzVxAtS0pLQbQK7cSbSyzJEC4fU7qCjSgRn9ExGN4G0U6L4I1ovog4zm4Gos 0iL1zQB70fie8gFfIxIsxmD5kzFUXlZ9euLZdM5Sc/pEkJKKWEgHVANyvxYf6y7tsTpD o2TR4zb8nzHf0ukDvyB+d4BdEsBEccEdbZ24ATDYDooE0k+d1hFx7MfoVb0D0XN7PRVQ LPry8A4qVYOG3RD6n2jp+Br7or4H1D9t2qt1ssPe40pZygAhIalK9EMvgUhS/X6GLeIl 9GBA79j3oNDgF6jYnrosbDCudc+90hs1oTNyDggnyA/mhR3lbJ5WkDjUnjlxpFwTHcp2 843g== 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=XgyJqgUWNLfQbVnbA9JmMbbY7x+gx5eyPiWYoXjzHvI=; fh=KBIhiGdu1Ygtr3M+FTFcsBcOHAnQgw4Q3/a7frwkCBE=; b=MT6QUKC+o9Yj1UW4nTzH1N/bobUGEUxJkMyBotMhrzvd3W4hfti28ApuirtQt9TB17 JSzIdPk7g67zFzRX7HBoor8eA5BK3TdCx8oyDnH9g8uYenf3bRoxHA0XNZxW1bv+nsut W0mOhshOONMW9KQgNpatebh0Rxzf4alqaruGDjm46Lguom2VGn1nV5PViNquChaY4Vfa AsUjlit5LxsPxC4zwoWHtyf5rwZ6DjW5dweXotsJWSA9lt7MbVXswQ46beL2Gwclhtue QVYcR/IoFjQMTftLzg8sh7xGMnBkWLCJBPMXhck3tEL8s6ZX8pKO1r71RmcNdnEf1usA qjZg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ul+i8Cpz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-28688-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28688-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bx6-20020a170906a1c600b00a2db4d3b894si2726240ejb.787.2024.01.17.01.04.53 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 01:04:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28688-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ul+i8Cpz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-28688-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28688-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 852F61F24F43 for <ouuuleilei@gmail.com>; Wed, 17 Jan 2024 09:04:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 916BE1B96A; Wed, 17 Jan 2024 09:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ul+i8Cpz" 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 D394714003; Wed, 17 Jan 2024 09:03:44 +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=1705482224; cv=none; b=I1x+Cf662Me76NKKCOJGfzH3Z27wmvRifBdb5Xq/oopDx6MG+Uf8RQH818V0MAIuzdsJYUwOV3e5td5ZG09+LdVHp4C4CEZ67Mm16bV4fBjqhbgpHG16Ol1P2wXEVcu8bXlkidrZwWlAKKy3Kl85CMWQ+wSxmQmFsSUB+6ZfyUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705482224; c=relaxed/simple; bh=ubf+Lb9lWCl+Bw/cYPU6tgtajk7KlSOrM82ga/TBaGE=; h=Received:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=RyMcKKTzrRAqR/m2B1K/w+H87CrTe5YOsg/16TEcQe4Z4SZWDfEtb8wZJwsr+2mshCBe8Vo3LOFMP5g7ZOB9kU31wVowpkbnWnqHcUKHvNPG4KIQAsQrvS0sPNBN8dADueM4DscklZjydUPxbmT8YQIOp2JmOKE22hiUHZ6YsOs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ul+i8Cpz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79CFBC433F1; Wed, 17 Jan 2024 09:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705482224; bh=ubf+Lb9lWCl+Bw/cYPU6tgtajk7KlSOrM82ga/TBaGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ul+i8CpzEGX31XDcKOWiMUk/Mx/cPUlWS3k1ZWXNcmO+13+g+43kk7k7zsDou3Jqx 2HCVy13ILqrFrpytfP7xQS4Q+s8uzGzVqomaFETJqYRFKTjMvHusVASImqm9CWLX1N HehEQcPMuOqpl8a/ZtW8lbbHdsU/PTb7d1fzDWjHi1fcOqHQlAJLy7IY1eHnJEGtKc uoQ9nmJxOhlhDfMz1RZZ6inqcS/ExtArgXGmWGG5CEgzHiKxkVos9PSHsNPOYpFjOR CzOuBnP7tlysEahDt+IyNQsbzoAVuEK1jjTUo31B9chHBTTutQzmXUQdXj7Gf0Tigb MMXYGK3cBqq+g== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from <johan+linaro@kernel.org>) id 1rQ1pt-00086U-03; Wed, 17 Jan 2024 10:03:49 +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 v2 1/3] ASoC: qcom: sc8280xp: limit speaker volumes Date: Wed, 17 Jan 2024 10:03:29 +0100 Message-ID: <20240117090331.31111-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240117090331.31111-1-johan+linaro@kernel.org> References: <20240117090331.31111-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: 1788327802198019814 X-GMAIL-MSGID: 1788327802198019814 |
Series |
ASoC: qcom: volume fixes and codec cleanups
|
|
Commit Message
Johan Hovold
Jan. 17, 2024, 9:03 a.m. UTC
The current UCM configuration sets the speaker PA volume to 15 dB when enabling the speakers but this does not prevent the user from increasing the volume further. Limit the PA volume to 15 dB in the machine driver to reduce the risk of speaker damage until we have active speaker protection in place. Note that this will probably need to be generalised using machine-specific limits, but a common limit should do for now. Cc: stable@vger.kernel.org # 6.5 Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> --- sound/soc/qcom/sc8280xp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c index ed4bb551bfbb..aa43903421f5 100644 --- a/sound/soc/qcom/sc8280xp.c +++ b/sound/soc/qcom/sc8280xp.c @@ -32,12 +32,14 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd) case WSA_CODEC_DMA_RX_0: case WSA_CODEC_DMA_RX_1: /* - * set limit of 0dB on Digital Volume for Speakers, - * this can prevent damage of speakers to some extent without - * active speaker protection + * Set limit of 0 dB on Digital Volume and 15 dB on PA Volume + * to reduce the risk of speaker damage until we have active + * speaker protection in place. */ snd_soc_limit_volume(card, "WSA_RX0 Digital Volume", 84); snd_soc_limit_volume(card, "WSA_RX1 Digital Volume", 84); + snd_soc_limit_volume(card, "SpkrLeft PA Volume", 12); + snd_soc_limit_volume(card, "SpkrRight PA Volume", 12); break; default: break;