From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 354E319D07A for ; Fri, 20 Feb 2026 10:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771584061; cv=none; b=J+nK1AVhMwobsnMjYLkKQUGoIGClwPWP1e9t+YIT1/nexCWlkwh+CvEpIyBkxp+ElUjPmSDkCWJJbKJOqsY9XHexy6ijUW/p1v1548xgJh9EJUTt5kUfXcyqg4wjmMyfFG05YjaJ+uGZ3b6KkWomhKCANc97IiT/H96CJb5Ac/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771584061; c=relaxed/simple; bh=lCfjiFCpKJoa+6uB16bTXpWJQyvUj3mvFlbxKEOoSYE=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=Tp1ZyTXSw/i1YgeObuhzIiSWRkEVXBjKkD+NkF1ANMe83zS9BmSFuU/ecF5LLNNhAgOK3C90h96gZFMLP8hWH/Qz2jCeLpTODZ8YEpvMtvWBEWdg2kBuQ4Vhjf2Z/kRUQolVHXkYg1jUv2fASvF7SPQ2e8+ffmgoO15HV+dCS7k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fairphone.com; spf=pass smtp.mailfrom=fairphone.com; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b=Cx5MsgJk; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="Cx5MsgJk" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-b885a18f620so338631466b.3 for ; Fri, 20 Feb 2026 02:41:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1771584058; x=1772188858; darn=vger.kernel.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o4tgaqGFqrzVKKPOb+iFZ3JERZen8Ej1v/LIDxYhK+0=; b=Cx5MsgJkG9oj7APqKUjH43BrcK93sBkvrR9uvqcW3+WgQxYIby7Z70/GQmH/9sMPTB iTFvlnLZUsfREVfIT8h9JEn6ageY55GZFmOSxcGM5gQVDgvZ34b36TuowJfG9vX9O5Th EW9fx1ICNQfmxW94+axh4GugWhJTNY3YcAKmjfRfsokim005XjhelAP3uBdEAD0eGpRo AEAyVVAQW3/TrSGMrt0zQRSkVRrqLeHWs2+XtTHmgUoG3bKEEJi1X1En0Lo3mZenj6lZ XxUABx770Ns1ng8jGfWFnHL0O/Gyan1LIgouu1BMaBxikef9eopFUuQysP3OwuWzM7Bb yxFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771584058; x=1772188858; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=o4tgaqGFqrzVKKPOb+iFZ3JERZen8Ej1v/LIDxYhK+0=; b=nWCQJLfKOvAZBDmRchqEMQYxu+pPlk71zweBrViTwvFFxAPo0gPf4OE/9vSHOuofLy sZF47YTKCervWWb08Mrwo9JUdLIOhDrt9o7Rss+EjHAB8OHie/1WljiFGypLYTNl2UGS BsD3oh1vGRJDB82l54Wtb2Kj7R/L8aPXjVrsh72Wph/W9oK0djjOyTcqJe3PQrk0LZyX FB9XLmMWZyMik4tSfxuuRd63PbIcIWvOQcCrZeRD4Ddbd37eEUvX/LivPYrA4lUkmuVK 4Fy16zb4lbwxULWTEp6Z3Q5MtibruzDSnnA7rkA7dO0Mtz/dtFQUyDEdRMRWyjHHHvcD tM4A== X-Forwarded-Encrypted: i=1; AJvYcCXbvSeDgIN/83PX7Xn8sLvgxaYdIghqGSSg+VPypHEG84jxdKgzaOgkl66UYUQ6E/uBidw0G8hImzTofAQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+ngC9vkGA+lAJ1J+24MOyAWg1VBL4b7MuE42hN47w8SvRWvqY ADbjDOpWdKvprkEaYK8cqXqujafi3zt5wpeCVJI6utUngih31DByewBvrAFNf6GmP1I= X-Gm-Gg: AZuq6aIR636hxHEOuohieX9eGXj3vAhNsYJt+S1tK2az4NPA1Gl1GKj9x0LBv5+amzC qk4ZJQykGUh1urAgZhj1p2On3odV0GZcZNQUTvFxE82jj/bE3x5rk3BW+nVFAx9tH5/pzG4vcke czfqohoWWZNemVu/I1F+lIJUtxYIQ37WJ6XcidvksqK4g/tyjWC7zLrXKAZMg44lUZDYUU3Tra6 CpMGDdQM+VXjNn0FMgjS0LrAVnWtbEcRPUIOZSUk1yirrgDaaPMCqNCg1lNQkOacwg+M6F9gJQd 1qwSvhACvnGXFyieMQS60Ra1dS+lSj1SAihMbd7E5NjShhEJLkDcP8/xY5cB9lmNF+1jb/qR7hV BETNbhJkzURZl3r2nVwd21lSP72oiMEH4jIe349r6DGUYZiWmqb2CYDyQ3VfjayyJsowUDj+Uj8 LzkG/9yS7win53xU6kPtK5BtvXcA1kZgrVARfYbiSZk7vQuy5wqjMYKc4uvhgE7Z0KojGo X-Received: by 2002:a17:907:98d:b0:b90:3436:9f71 with SMTP id a640c23a62f3a-b90731fef13mr72589166b.47.1771584058260; Fri, 20 Feb 2026 02:40:58 -0800 (PST) Received: from localhost (144-178-202-139.static.ef-service.nl. [144.178.202.139]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8fc7385e60sm661232566b.19.2026.02.20.02.40.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Feb 2026 02:40:57 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 20 Feb 2026 11:40:57 +0100 Message-Id: Subject: Re: [PATCH v2 5/5] arm64: dts: qcom: sm7225-fairphone-fp4: Add battery temperature node From: "Luca Weiss" To: "Konrad Dybcio" , "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>, , , , , , X-Mailer: aerc 0.21.0-0-g5549850facc2 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> In-Reply-To: <85ce1f2c-f5cf-4e97-9611-4aed03f69cd7@oss.qualcomm.com> 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. >>=20 >> This will later be used as input for the fuel gauge node (QGauge on the >> PM7250B). >>=20 >> Signed-off-by: Luca Weiss >> --- >> arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 83 ++++++++++++++++= +++++++ >> 1 file changed, 83 insertions(+) >>=20 >> diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/ar= m64/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 =3D "sensor-channel"; >> }; >> =20 >> + 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 =3D "generic-adc-thermal"; >> + #thermal-sensor-cells =3D <0>; >> + #io-channel-cells =3D <0>; >> + io-channels =3D <&pm7250b_adc ADC5_BAT_THERM_30K_PU>; >> + io-channel-names =3D "sensor-channel"; >> + /* >> + * Voltage to temperature table for 10k=CE=A9 (B=3D3435K) NTC with a >> + * 1.875V reference and 30k=CE=A9 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=3D4100, ID resistor 10kOhm * (Kayo) F3AC1 with NTC 100kOhm B=3D4050, 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... Regards Luca