community/linux-postmarketos-qcom-sdm670: reduce max speaker volume

Closes #4616

Signed-off-by: Oliver Smith <ollieparanoid@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8764>
This commit is contained in:
Richard Acayan
2026-06-10 18:29:00 +00:00
parent 7b49e35608
commit 39c1eb5f9e
2 changed files with 45 additions and 1 deletions
@@ -0,0 +1,42 @@
From ce500b195fab1c3fb4d2ff04e7f24577a8f56d66 Mon Sep 17 00:00:00 2001
From: Richard Acayan <mailingradian@gmail.com>
Date: Mon, 8 Jun 2026 19:39:46 -0400
Subject: [PATCH] ASoC: codecs: cs35l36: reduce maximum volume to 0dB
The digital volume can be increased to +12dB. This is very loud, but
ALSA userspace still goes under 0dB until 64% logical volume. Cap the
maximum volume at 0dB, so ALSA only sets the hardware volume up to 0dB.
Link: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/work_items/4616
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
---
sound/soc/codecs/cs35l36.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
index 93818d7ec1a7..98992eaadb12 100644
--- a/sound/soc/codecs/cs35l36.c
+++ b/sound/soc/codecs/cs35l36.c
@@ -442,8 +442,8 @@ static bool cs35l36_volatile_reg(struct device *dev, unsigned int reg)
}
}
-static const DECLARE_TLV_DB_RANGE(dig_vol_tlv, 0, 912,
- TLV_DB_MINMAX_ITEM(-10200, 1200));
+static const DECLARE_TLV_DB_RANGE(dig_vol_tlv, 0, 816,
+ TLV_DB_MINMAX_ITEM(-10200, 0));
static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 0, 1, 1);
static const char * const cs35l36_pcm_sftramp_text[] = {
@@ -483,7 +483,7 @@ static int cs35l36_ldm_sel_put(struct snd_kcontrol *kcontrol,
static const struct snd_kcontrol_new cs35l36_aud_controls[] = {
SOC_SINGLE_SX_TLV("Digital PCM Volume", CS35L36_AMP_DIG_VOL_CTRL,
- 3, 0x4D0, 0x390, dig_vol_tlv),
+ 3, 0x4D0, 0x330, dig_vol_tlv),
SOC_SINGLE_TLV("Analog PCM Volume", CS35L36_AMP_GAIN_CTRL, 5, 0x13, 0,
amp_gain_tlv),
SOC_ENUM("PCM Soft Ramp", pcm_sft_ramp),
--
2.54.0
@@ -4,7 +4,7 @@ maintainer="Richard Acayan <mailingradian@gmail.com>"
_flavor="postmarketos-qcom-sdm670"
pkgname=linux-$_flavor
pkgver=7.0.10
pkgrel=1
pkgrel=2
pkgdesc="Mainline Kernel fork for SDM670/SDM710 devices"
arch="aarch64"
_carch="arm64"
@@ -35,6 +35,7 @@ _tag="sdm670-v$pkgver"
# Source
source="
https://gitlab.com/sdm670-mainline/linux/-/archive/$_tag/linux-$_tag.tar.gz
0001-ASoC-codecs-cs35l36-reduce-maximum-volume-to-0dB.patch
$_config
"
builddir="$srcdir/linux-$_tag"
@@ -74,5 +75,6 @@ package() {
sha512sums="
71476207449337685a947a5ab0c3a6af619e0b1322568723ed387792f8252d329d547a491e8ec6a5cb38ad76e52c4beeb76852cd7d2fbf39fd76f9743e2671de linux-sdm670-v7.0.10.tar.gz
3a463e3f02fe55b295d7c41cbdeb0104d62035c56f621d3536adfdd09b6ecbd90b8daabaa15633e40d5a5b4338ede1f6876996177a089718a0000077fe8e84d9 0001-ASoC-codecs-cs35l36-reduce-maximum-volume-to-0dB.patch
af2360a11f7182c68fb81779f13623af82d4ae5b91be31b6dfad2bec60e7d548b9ba4ba049cf5a075c06e2511d2ede720937c20fd49d9fdc6a4f158fbc4ad519 config-postmarketos-qcom-sdm670.aarch64
"