Re: [PATCH 4/8] platform: arm64: qcom-hamoa-ec: Add fan RPM query and LUT calibration
Konrad Dybcio <[email protected]> Wed, 29 Jul 2026 13:07:21 +0200
| Newsgroups | org.kernel.vger.platform-driver-x86,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 7/28/26 7:44 PM, Anvesh Jain P wrote: > Add the EC command definitions and handler functions for querying fan > RPM and programming per-fan LUTs (lookup tables mapping SoC > temperature to target RPM), and introduce a raw i2c_transfer()-based > transport for the two commands, since their variable-length, > sub-command-addressed payloads don't fit the smbus block-data model > used by the existing commands. > > Fan LUT geometry and temperature breakpoints vary by board, so encode > them in per-compatible qcom_ec_lut_config data selected via > device_get_match_data(). Add configs for the Hamoa CRD, Hamoa/Purwa > IOT EVK, and Glymur CRD ECs; IOT EVK boards share the Hamoa LUT > geometry but are bring-up platforms without a calibrated fan curve, > so skip_lut_set suppresses the LUT-set command on those boards. So are we expecting every single laptop/device that utilizes a compatible EC to require modifications to the driver here? > Since the LUT values depend on each fan's maximum RPM, which varies > per board assembly, calibrate it at runtime: drive the fan to full > PWM, wait for it to spin up, and read back the achieved RPM via the > new query command. Run calibration in a work item at probe time and > after EC reset recovery, and make it abortable via a completion so > suspend can cut it short. Track calibration completion state so the > LUT is programmed once calibration finishes and again on every > subsequent power-supply-driven profile switch. I don't want my laptop to become a jetplane on every bootup. I doubt anyone does. Konrad