diff --git a/device/community/linux-postmarketos-qcom-sdm670/0001-thermal-qcom-spmi-adc-tm5-Correct-the-voltage-code-s.patch b/device/community/linux-postmarketos-qcom-sdm670/0001-thermal-qcom-spmi-adc-tm5-Correct-the-voltage-code-s.patch new file mode 100644 index 000000000..44b120e51 --- /dev/null +++ b/device/community/linux-postmarketos-qcom-sdm670/0001-thermal-qcom-spmi-adc-tm5-Correct-the-voltage-code-s.patch @@ -0,0 +1,35 @@ +From adadc2b690bfcb519ebc8b319d2ccc16abc5c153 Mon Sep 17 00:00:00 2001 +From: Richard Acayan +Date: Thu, 27 Feb 2025 17:16:07 -0500 +Subject: [PATCH] thermal: qcom-spmi-adc-tm5: Correct the voltage-code scaling + for HC + +When support was added for the HC variant, the full_scale_code_volt +value was copied from the tm5 variant. From the downstream kernel, the +scaling value is 0x70e4 on PMI632 (tm5 variant), but it is 0x4000 on +PM660 and PM8998 (HC variant). Correct the ADC code to voltage +scaling factor for the HC variant. + +Fixes: f6c83676c6097 ("thermal/drivers/qcom/spmi-adc-tm5: Add support for HC variant") +Parent: dt-bindings: mfd: qcom,spmi-pmic: Allow PMIC4 thermal monitor on pm660 +Signed-off-by: Richard Acayan +--- + drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c +index d7f2e6ca92c2..6ccd02fe0e4c 100644 +--- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c ++++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c +@@ -909,7 +909,7 @@ static const struct adc_tm5_data adc_tm5_data_pmic = { + }; + + static const struct adc_tm5_data adc_tm_hc_data_pmic = { +- .full_scale_code_volt = 0x70e4, ++ .full_scale_code_volt = 0x4000, + .decimation = (unsigned int []) { 256, 512, 1024 }, + .hw_settle = (unsigned int []) { 0, 100, 200, 300, 400, 500, 600, 700, + 1000, 2000, 4000, 6000, 8000, 10000 }, +-- +2.48.1 + diff --git a/device/community/linux-postmarketos-qcom-sdm670/APKBUILD b/device/community/linux-postmarketos-qcom-sdm670/APKBUILD index 149e93058..7cfef1b46 100644 --- a/device/community/linux-postmarketos-qcom-sdm670/APKBUILD +++ b/device/community/linux-postmarketos-qcom-sdm670/APKBUILD @@ -5,7 +5,7 @@ _flavor="postmarketos-qcom-sdm670" pkgname=linux-$_flavor pkgver=6.13.3 -pkgrel=2 +pkgrel=3 pkgdesc="Mainline Kernel fork for SDM670 devices" arch="aarch64" _carch="arm64" @@ -32,6 +32,7 @@ _tag="sdm670-v$pkgver" # Source source=" https://gitlab.com/sdm670-mainline/linux/-/archive/$_tag/linux-$_tag.tar.gz + 0001-thermal-qcom-spmi-adc-tm5-Correct-the-voltage-code-s.patch $_config " builddir="$srcdir/linux-$_tag" @@ -67,5 +68,6 @@ package() { sha512sums=" 9445ec12398f287bb120e5360e5757b28b4a353e948d1d04d2ca9106e9b5b16d8d931284e7a8aad7e8994bb5e4049130d75ba56c1e2886744dee4a43c802e3be linux-sdm670-v6.13.3.tar.gz +a458621296c0efd89e6bd71caa40b7cafbb91bf5fe8f8bed84b77ac383f8a13671e18d1206bd8c4cefa463b75085a5a68bdbf7f76294b67e71e996ebb354f1ef 0001-thermal-qcom-spmi-adc-tm5-Correct-the-voltage-code-s.patch dabde4e290ade089ec2fcf97995975f496e33bd9f5f9ccfeee32fbda2c140ced47455d09a1f6ebedb472497a46fc4f3f816a768b16734b42a7d472b095dead60 config-postmarketos-qcom-sdm670.aarch64 "