From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 2502233F374 for ; Fri, 20 Feb 2026 10:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771584684; cv=none; b=ZuqPCfsePK28JVXKtTaHWEpOvzajI7NpjgZ2HSsjr0QIIunmE5R7aVTOngKJdjZo4Lp5AYcZ/2gVrhnE2476NIzAPtm0jruGYq7FDCNNjHr5ynPk5se0xvNEVmeTR2O3YZWNJLwJSjgbIMR7KG9cgbeaumDWfcW5oUjdAxil+3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771584684; c=relaxed/simple; bh=ks6OJSw/UwvvF2/JUxSnt1Tii4VaTCXNdvHN7i3pd2A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dSL51UELBt0cjriEPqcriAdS8xJzagCaHbrLcsEmtDyQzpEU+NRtjV83gLe3jQBOr/mQgz231jeP9e5tPUbY5DP/TZmZToYgUfMIdaJcL6Sc3PZ3JEUEfiGA2Ag8/8HbLDFKHjqvGWIPl5Euc7igU3vtXrcbJBEViuq995G0oKc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=BueSl0t8; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=TOAoSrj1; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="BueSl0t8"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="TOAoSrj1" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61K5RtfE1805605 for ; Fri, 20 Feb 2026 10:51:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= n8sjIgXFVYbyhkWb9bMVXULx3YRL8NxHkkz55sJrEfA=; b=BueSl0t8sjkgfsHn wC7Y86DW8R4z7S7OJvfXyn63FWvSwGwK7Aw5kaTXqbRl5sKFXMyMsSQjnbxCWTmj rUjY/rIZsGmuO7o1wqw3c4Tg7ZdTlD9bfxLX1mjDVt6igrJywqilZSzEBkveonSZ pPGjO7qbXLMqS3ugXsM8Khq5iBz5CQ6XxJQnIGdnU1nbG6tJhSlTxlDWeAL4k8xn 2uPaXcgiHZxRGsBDjeLKnQ47M6LICWxs9vjuiUFFutKhAvUvfaqE1MhwjaQ0Sv5w Yer1MYHRQdgD8QSJCOA57odnydXR4D9mIlw82J1ENBp7hW+JGkMAvt0ehRHAFrT0 MVO47A== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cedsnsb3p-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 20 Feb 2026 10:51:22 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8cb38a5dc3cso191179285a.3 for ; Fri, 20 Feb 2026 02:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771584680; x=1772189480; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=n8sjIgXFVYbyhkWb9bMVXULx3YRL8NxHkkz55sJrEfA=; b=TOAoSrj1pNkW7zgtDRYPw94vSxGl0hqBTtX6EvM23ImSfc9jflEHE49s0yAvsnyeVf xOJjXJNEX/+g/UGB2pRQvfoCQQr833HuLzGW3kznQ9dfMC2o+WY+O7nENcCZOzLRsHsf iOc2OeDgfCv42QJjcAZufB3piORJ8iF855qphpPvnbK6V95GBqQIz0ctFMMK/8yAGDnf NJeNnE5/MZweEa+JeUzxfpdTb7LNtV5jX5f5+VD+HMCQ5EWv2PfoJ2l4pSJmzM4MS1Am dfwmHXvC9KDSa1chIGbJxslEnh6yW/txijue8KCXqZvyoFhNUr6a1OnRad1DZG3QTCvT q6Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771584680; x=1772189480; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n8sjIgXFVYbyhkWb9bMVXULx3YRL8NxHkkz55sJrEfA=; b=SFWHnuieLQn6YRBgVErzPdKRZgI3wbKPw/bLgmvuvMkNQWK/2vd6IHK1ByhbzGpodq lDKmnWehTr3gVocRaUQOoTpwwPLBzmeFGlM6dau8XfK/XGShqIRycAr4CyDbFk0ZxmeO LHsxo3/Hu+m/4UJAsq4Ot+WUEQUwZIQB16CS6c7rDBs0MHNx0nabQDDxvi9wuTsqyGCa n3OvqE4qlCNVmSKueu8Ns4Xin7W3F3d5lfG4dNvJ0Q53vUvfAdx9b2puF5Jr0PZlia+E dJEk/RS4SYEMoo7nGaqJPLEvmVssU1Ax5vBOPdI0QBGTVp6TDOZTHXNsZa5fiWMjgzpd JRgQ== X-Forwarded-Encrypted: i=1; AJvYcCWInmi/iMXsewjqUEEqIzEkn+nsqGqF+gGq/HepL4A+bybhXXjlBia1Njhvb00oHp7bxS0BOw6nBnHbSJE=@vger.kernel.org X-Gm-Message-State: AOJu0YykFcfLZeRrJXCoeoc8CJYyBorXVsj1FtwAsrMMqdJwnGSEeoGD 7gtQ0HS0nyIM3C865mmBoVf4uMnRRRLybcsrxU7SAXxRQR13WsvqPQykoQzT2M+sKzwlCEyrSk3 i1+Dq/aKKLyWac30of+fiezeqlpv6VMk29+4xCMUU0i2zdQ4IAGc4QaJ3/4u5sIyAmxQ= X-Gm-Gg: AZuq6aKj5h6eVFyK4XPrLYWo17lYdWodnxbhDnySKvNwJuG8hk6sDJheEGU5OwjTQ7s UFpOQgp7wrlg9+M6htICxd1cmpSMMrLlqaJteNu236YIGpJOZnGwDYNU0ezQGvY/cA0W89IcIHM 6svj6qJRTPptaZKNfWk6fs+oQy1GgLHqCNyMps/VpsujmfqdHU1T8TxcpHZEjj6Vi0Evw8bZbs/ WDCbIzFJZvTKfNWkipbYwm2ufZ2vJz3hOo28BQnYM3Up4ZevriD/sXx/wMnV9m3XVmmpYjTaLje vgjxK+EMzR6xLgowtL7+Uoh7WUNDdGKBjw/SSfdA2JxndHxWyzzL6wXAxlODgSD4gf1WTaZX6Nm aTIxICG3hOtEKsBsLVicuvP/YAnj/YhQ3w2ZLAFty7igIihHdGKg5hJEsUEBcV0zdFO8XH+Djrd rs518= X-Received: by 2002:a05:620a:7006:b0:8c7:1b40:d096 with SMTP id af79cd13be357-8cb408e956dmr2404927985a.9.1771584679727; Fri, 20 Feb 2026 02:51:19 -0800 (PST) X-Received: by 2002:a05:620a:7006:b0:8c7:1b40:d096 with SMTP id af79cd13be357-8cb408e956dmr2404925985a.9.1771584679248; Fri, 20 Feb 2026 02:51:19 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8fc7665345sm664435366b.53.2026.02.20.02.51.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Feb 2026 02:51:18 -0800 (PST) Message-ID: Date: Fri, 20 Feb 2026 11:51:15 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/5] arm64: dts: qcom: sm7225-fairphone-fp4: Add battery temperature node To: Luca Weiss , Jonathan Cameron , David Lechner , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Laxman Dewangan , Bjorn Andersson , Konrad Dybcio , Hans de Goede , Jens Reidel , Casey Connolly Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org References: <20260220-bat-temp-adc-v2-0-fe34ed4ea851@fairphone.com> <20260220-bat-temp-adc-v2-5-fe34ed4ea851@fairphone.com> <85ce1f2c-f5cf-4e97-9611-4aed03f69cd7@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIwMDA5NCBTYWx0ZWRfXy7krXVSR4MGD eZ0c2qBSDu8xNtL2wDQgO5rSF7YdhCt7WvxHY18W4wlPIStekN0KRqoELlfsPBrLjPirEfymVKO Bhsw66GBZPTDlz/NAQ7lhEcLZQ4lAGI/iocITp41U4LsA7WmHRNkOBmBUJmdfgNBBFowLGJOFdD O49+rqtW1CGPTowZeQcDkhL2mxSXg+pT07wnhB7hHkZNb3t/o44WanIHtsSCfDvn+eR+JTmrgSO BzF4YwAjbfKIOxd9nBbGQ6iyJBU5JBJYXAduT2h8ozogdiUfB35LbYQ3Ot3Spw/st2TUiwE/FzK eWKJasOezdu8tWE3Rkyo+tk20mpm+/xesiRw4gjFT0M+fvGjN8OzS5EY3pclQpR+l4sT0DqzDD3 tJDMLvzAmJnrcicccwCMEimaFYaGIzIhd0CrBj/5zdhuuZEqo3kiYS6JX/KuTYfeLLnx0shPsiB mzeTZGcIYWNcSpbJjiQ== X-Proofpoint-ORIG-GUID: 4kMJZr128okL3RsbgCocFhu2YbgIb1tj X-Authority-Analysis: v=2.4 cv=JsD8bc4C c=1 sm=1 tr=0 ts=69983caa cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=6H0WHjuAAAAA:8 a=ftgFGzw_iv9xBS2N3wAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 a=Soq9LBFxuPC4vsCAQt-j:22 X-Proofpoint-GUID: 4kMJZr128okL3RsbgCocFhu2YbgIb1tj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-20_01,2026-02-20_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602200094 On 2/20/26 11:40 AM, Luca Weiss wrote: > On Fri Feb 20, 2026 at 11:00 AM CET, Konrad Dybcio wrote: >> On 2/20/26 10:19 AM, Luca Weiss wrote: >>> Add a generic-adc-thermal node to convert the voltage read by the >>> battery temperature ADC into degree Celsius using the provided lookup >>> table. >>> >>> This will later be used as input for the fuel gauge node (QGauge on the >>> PM7250B). >>> >>> Signed-off-by: Luca Weiss >>> --- >>> arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 83 +++++++++++++++++++++++ >>> 1 file changed, 83 insertions(+) >>> >>> diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts >>> index b697051a0aaa..7857003099a6 100644 >>> --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts >>> +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts >>> @@ -108,6 +108,89 @@ rear_cam_sensor: thermal-sensor-rear-cam { >>> io-channel-names = "sensor-channel"; >>> }; >>> >>> + bat_therm_sensor: thermal-sensor-bat-therm { >> >> nit: this should be a little higher > > meh, it's surprisingly easy to miss this sorting stuff. Will fix in v3. > >> >>> + compatible = "generic-adc-thermal"; >>> + #thermal-sensor-cells = <0>; >>> + #io-channel-cells = <0>; >>> + io-channels = <&pm7250b_adc ADC5_BAT_THERM_30K_PU>; >>> + io-channel-names = "sensor-channel"; >>> + /* >>> + * Voltage to temperature table for 10kΩ (B=3435K) NTC with a >>> + * 1.875V reference and 30kΩ pull-up. >>> + */ >> >> I think this looks good. Is this data going to be correct for all/most >> devices (i.e. is there a single battery sku)? > > Yes, from my info there's just a single battery SKU, so that makes it > easy here. > > For Fairphone 3 there's two battery SKUs: > > * (Fuji) F3AC with NTC 100kOhm B=4100, ID resistor 10kOhm > * (Kayo) F3AC1 with NTC 100kOhm B=4050, ID resistor 49.9kOhm > > In reality, one can probably ignore the difference between the LUT for > either B value since it only differs by a marginal amount, but > conceptually I'm not sure how this should really be resolved. > > We could have both battery definitions in the dtb, and then the charging > driver could determine the battery that's actually present in the > system (based on the BATT_ID measurement), but given the design here > now, I'm not sure how this temperature lookup table would be propagated > to the rest of the system... The path of least resistance (pun intended) would probably be to make generic-adc-thermal consume an ID channel and accept a number of LUTs.. That sounds sensible since most battery ID mechanisms are probably also ADC-based and one would hope (tm) that the values output by these ADC channels would then be distinct enough for the driver to have an easy time confidently selecting one of the options (or a fallback) That said, this is just my guesstimates and perhaps the IIO folks could comment on that Konrad