From 39c1eb5f9e8200e636bb776d173d549230923a61 Mon Sep 17 00:00:00 2001 From: Richard Acayan Date: Mon, 8 Jun 2026 20:27:32 -0400 Subject: [PATCH] community/linux-postmarketos-qcom-sdm670: reduce max speaker volume Closes #4616 Signed-off-by: Oliver Smith Part-of: --- ...cs35l36-reduce-maximum-volume-to-0dB.patch | 42 +++++++++++++++++++ .../linux-postmarketos-qcom-sdm670/APKBUILD | 4 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 device/community/linux-postmarketos-qcom-sdm670/0001-ASoC-codecs-cs35l36-reduce-maximum-volume-to-0dB.patch diff --git a/device/community/linux-postmarketos-qcom-sdm670/0001-ASoC-codecs-cs35l36-reduce-maximum-volume-to-0dB.patch b/device/community/linux-postmarketos-qcom-sdm670/0001-ASoC-codecs-cs35l36-reduce-maximum-volume-to-0dB.patch new file mode 100644 index 000000000..eb2de32f3 --- /dev/null +++ b/device/community/linux-postmarketos-qcom-sdm670/0001-ASoC-codecs-cs35l36-reduce-maximum-volume-to-0dB.patch @@ -0,0 +1,42 @@ +From ce500b195fab1c3fb4d2ff04e7f24577a8f56d66 Mon Sep 17 00:00:00 2001 +From: Richard Acayan +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 +--- + 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 + diff --git a/device/community/linux-postmarketos-qcom-sdm670/APKBUILD b/device/community/linux-postmarketos-qcom-sdm670/APKBUILD index 11eae244f..e464f7b54 100644 --- a/device/community/linux-postmarketos-qcom-sdm670/APKBUILD +++ b/device/community/linux-postmarketos-qcom-sdm670/APKBUILD @@ -4,7 +4,7 @@ maintainer="Richard Acayan " _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 "