power_suppl...esist_simple(9)
๐ NAME ๐
power_supply_temp2resist_simple โ bestie, this is the one that finds your battery's internal resistance percent from the temperature ๐ก๏ธโจ
โจ SYNOPSIS โจ
int power_supply_temp2resist_simple (const struct
power_supply_resistance_temp_table *table , int table_len , int temp );
๐ ARGUMENTS ๐
tableโ a pointer to the battery resistance temperature table, like literally the whole lookup vibe ๐table_lenโ the table length, bestie. how many entries we're working with ๐ซถtempโ the current temperature, that's the moment we're checking ๐ก๏ธ
๐ฆ DESCRIPTION ๐ฆ
Ok so picture this: this helper function is what you call to look up the battery internal resistance percent based on the current temperature value, pulling it out of the resistance temperature table ๐ And here's the thing โ the table must be ordered descending ๐ฅ no cap, that's a hard requirement, don't come at it with an ascending table ๐ญ
Then the actual math goes like this, and it's genuinely iconic:
the actual battery internal resistance = the ideal battery internal resistance * percent / 100 ๐งฎโจ
๐ธ RETURN ๐ธ
It gives you back the battery internal resistance percent. That's it. That's the whole gift ๐๐
๐ SEE ALSO ๐
The kernel file lives right here, go be nosy:
./drivers/power/supply/power_supply_core.c
And the whole friend group of related pages, fr fr:
power_supply_get_by_name(9)power_supply_get_system_batteries(9)power_supply_put_system_batteries(9)power_supply_put(9)power_supply_get_by_reference(9)devm_power_supply_get_by_reference(9)power_supply_vbat2ri(9)power_supply_ocv2cap_simple(9)power_supply_get_property_direct(9)power_supply_set_property_direct(9)power_supply_register(9)devm_power_supply_register(9)power_supply_unregister(9)
Okay that's the whole page, you ate that ๐
โจ This lil gem lives over in ./drivers/power/supply and it's stamped October 2026 โ go forth and calculate those resistance percents, bestie, ily ๐ซถ๐๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms