From mboxrd@z Thu Jan 1 00:00:00 1970 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 BBF8B12B8D; Tue, 16 Jan 2024 09:39:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RKmoRJkw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F772C43390; Tue, 16 Jan 2024 09:39:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705397981; bh=nvWSTvevOskToEZpfEU2EEaPDtMjqucztV5vWpemT2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RKmoRJkwvYt5VDdESK9KIx/LDj4F0E7M/8n1WuR0soKQjN424GIFu75fnOUmyxpvL zDStNl/RrkH00uMgg5wKY62Qycvcq9zeb7YceufvII03mCUVQJX1Zle4gPbYaJaMxZ xf6RVMgkxEBnYUsTIXVeyvj6RX2L/9bp1n3TUwVE/0fz6T/lTKpTyaFLR835+MnfJW 9IbXMLS+JW4uMHe+h+t/VKyq3RxgyupwdfJtSK3orD0H46iJurVPSqIhNP8Np/IOTX KkrwvpT9FVjeMRrMrUDT+0wA3sZ0vXdjal0qWQrj+QRgOGN3DZpfsuN+OkgfVCoQoo W6g9qL1HrlqAw== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1rPfv6-00053R-0a; Tue, 16 Jan 2024 10:39:44 +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 1/7] ASoC: qcom: sc8280xp: limit speaker volumes Date: Tue, 16 Jan 2024 10:38:57 +0100 Message-ID: <20240116093903.19403-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240116093903.19403-1-johan+linaro@kernel.org> References: <20240116093903.19403-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 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