tsens_hw_to_mC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tsens_hw_to_mC(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual entry for tsens_hw_to_mC(9) β€” yes that (9) means it's a kernel function, we're in the big leagues now ✨


πŸŽ€ NAME πŸŽ€

tsens_hw_to_mC β€” returns you a sign-extended temperature in mCelsius πŸ’– (milliCelsius, bestie, we're talking tiny tiny degrees)


✨ SYNOPSIS ✨

int tsens_hw_to_mC (const struct tsens_sensor *s , int temp );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • s β€” pointer to the sensor struct 🫢 like, the whole personality of the sensor lives in here
  • temp β€” the temperature in milliCelsius that's gonna be read from hardware πŸ”₯

🌸 DESCRIPTION 🌸

okay so here's the tea: this function handles the temperature that comes back from the hardware, and depending on the IP version it's giving ADC code or deciCelsius 😭 like it literally adapts, main character energy fr fr

no cap, that's the whole vibe β€” it deals with whichever format your IP version throws at it πŸ’…


πŸ‘‘ RETURN πŸ‘‘

on success you get the temperature in milliCelsius back, slay ✨ and in error cases a negative errno gets returned β€” so if you see a negative number, that's not a cold temperature bestie, that's an error πŸ’€


🌈 SEE ALSO 🌈

like, go read the whole friend group, they're all iconic 🧚


πŸ“ friendly reminder: every single one of those SEE ALSO references is a real function or struct β€” don't skip them, iykyk

and that's a wrap, bestie πŸ’œ this page lives in ./drivers/thermal/qcom, dated October 2026, and it's filed under tsens_hw_to_mC(9) β€” go forth and convert those temperatures, you're gonna ate πŸŽ€β­πŸ‘‘

πŸ“¦ where this page comes from