Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp271328rdb; Wed, 17 Jan 2024 01:04:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHT/2NF7HI6hIwJT0cr739YbtTLWX1f50iI34nix1FZp2M97u1GuljhW+H1gRMCzmhNWIud X-Received: by 2002:a05:6214:1ccc:b0:681:55c2:38cd with SMTP id g12-20020a0562141ccc00b0068155c238cdmr8817701qvd.30.1705482259102; Wed, 17 Jan 2024 01:04:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705482259; cv=pass; d=google.com; s=arc-20160816; b=ysEQV0gyALmSz3mCdFdr1EGXxUGbraouHvyRAA2cGIemfJ8un8U5T1DdJQGixB3w5Z A1Ws6wckrRQGGdPSQwu2CZJdy2QyFlgKS6tQIN60K4e4r6AJCK5XKwKQFzQRafVOM8JK U8MC8dtRssoQJtL3Xk+daesgZ0QEs7hvpWU9Ek0zP9wkC59HNnUiYzGGtBC69aNIxWBF r2gNZK7fVyC3jgXWf3Sztz9z6qoHWlHNjfbvjLtJfdwwjtq6KcpnJ3hcpAfhPITiUEaK 0nfVI3lf0EC32OsGiyYUxNAMQNWI4bUBCX1qvqzT24uYykDEE71tyttZn8T3KVig5059 bOxg== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28688-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y6-20020a0cc546000000b0067f80b3353bsi11100983qvi.247.2024.01.17.01.04.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 01:04:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28688-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28688-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D84051C24B1F for ; Wed, 17 Jan 2024 09:04:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBC4014281; Wed, 17 Jan 2024 09:03:45 +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 ) id 1rQ1pt-00086U-03; Wed, 17 Jan 2024 10:03:49 +0100 From: Johan Hovold To: Mark Brown Cc: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Johan Hovold --- 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; -- 2.41.0