Re: [PATCH v2 0/5] Battery temperature ADC plumbing on Qualcomm platforms

Hans de Goede
2026-02-20T11:58:23Z

Hi All,

On 20-Feb-26 10:19, Luca Weiss wrote:
> This implements a solution to get battery temperature readings working
> on (for example) smartphones with Qualcomm SoCs.
>
> The solution chosen in downstream Qualcomm kernels is exposing
> ADC_BAT_THERM_PU* in the ADC driver as temperature channels with the
> lookup table ("struct vadc_map_pt") for the specific NTC found in a
> device's battery patched to adjust the lookup table. Patching a kernel
> per-device is obviously nothing we can put upstream.
>
> The high level solution proposed here:
> * ADC driver provides temperature channel in (milli)volt as IIO channel
> * generic-adc-thermal driver converts voltage to temperature based on
> provided lookup table from DT (driver has one IIO channel input, one
> IIO channel output)
> * The fuel gauge driver can use that temperature IIO channel to expose
> battery temperature via the power supply device

Nice, I agree that this seems the best way forward, especially
taking into account that the generic-adc-thermal driver now
already supports the IIO -> IIO path case.

Regards,

Hans