From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 3AEE433C536 for ; Fri, 20 Feb 2026 10:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771584061; cv=none; b=cqNl88Z7Ypfpb4bRYX9hXbb7XOXWjuZoE/9A469jYZINQpaBEiL5DTomhYeqmFeVeGnApBoHYv2pyTTzV+Mryd1nqYHAi0nN4GGoFZtuIzFxGWxySM7Ah7XUAcHvfMtDppu/hR5OxvQ57CW+MkEezuv0WtA0OqzmYFXy3mMTbX0= 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.50 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-f50.google.com with SMTP id a640c23a62f3a-b8fd976e90cso264234766b.0 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=L4R5ZDzrmRyBMR/v4QF51cE/LP79FvQQnQ/pb/+y9c+okXskRdeo+LaTRJCnnzIYGA n5cZovUgYMdAuVJdqljv5az/0mHMAYzafWkSQoqwbWig0k6GtQKavKcF0CKHK+Lsupfl lbtUe15bQ+P40nTpgZYxzRoMgEofl2SbIHSPaOZYQ9kiLRuxO7hpDOcAy+QQcSAE7DTV jM3/AKNPsATAEjM/VBOeFDCciqwglrW/Sb25kPmnvyapGRtHmjtEIXq/tWQYjiq1KHuS mZ2ggT6B11KXcI+M994Kz3PPzPFS5fk+vdBwr5ZTPDSaBPPU/32DKUybJPmtJtSFHVv/ 0dpg== X-Forwarded-Encrypted: i=1; AJvYcCUdR8tJXYSNSVViIPFqeIZF2cFquwrGpv2a03mdyxn+1cKXoIJ2uAo3acO8rOf7gwpj75+kHBgQdtCdioXO@vger.kernel.org X-Gm-Message-State: AOJu0Yxouh0lgmzrno8KpDWIZFAgjxgKUwFx/ocyYiRejmKf6cjGHeFD ROKVQYFaIgTcgY0MYeNOK62v2HgTi5N/2j5i7zP8oQG28TmKNzGusqSEsbTMWcvh2BI= X-Gm-Gg: AZuq6aJL+0Tb18Hozk5PiwErapo2+DUGIh0yjBBOWFYo5W/OI2CUhyM0jEl3iMGXkju kszb3e0l3der7zXHMPwaFtI+9uup7dCZD8T4Tj03udD+QfmWVNNY13DvKy6Y2s70D7Gmdu73ZkN QQ96APwSEfljVuQ0S+IjRITtOxT5TOUrFiHphBxPXX73kTA6y19i0+/xJfO7Mgg6APptcySFFnI LPgrvNAefYqXfwZpBkFXFfC2s5lDEWaHQVzVR+g7O+csfC5Om7l7mCLVgY+D7w7jdGtEdsQOuq0 XDdf3I+B8HKdjdgxcywYat7boF63dd1IDBU0YPTGhMt8zaFb3VDIl4lvKibXzfWygecx5NlFN5n KMYVxtr93kw3GLbi7/LBWdnjN2qYHwBKGUoVB00oSxZILaU8hGg6sKgc9L4safEsIlp4Qlpelj2 pdm3zTkr7wP+uyn5UY8LnmSlJ7lRZXwKrSwDe6qW6ht17xAzHjg7vi67o8WW9a073tWDgg 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-arm-msm@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