summaryrefslogtreecommitdiff
path: root/drivers/thermal/spacemit
AgeCommit message (Collapse)Author
2026-08-07thermal/drivers/spacemit: Validate clamped trip thresholdssurendra
k1_tsensor_set_trips() checks the requested trip temperatures before converting them to the sensor register representation. Distinct out-of-range temperatures can clamp to the same hardware value, leaving the sensor with an invalid low/high threshold pair. Validate the ordering after conversion and clamping. Fixes: 296a977f2bac ("thermal/drivers/spacemit/k1: Add thermal sensor support") Signed-off-by: surendra <kr494167@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260720103606.93924-1-kr494167@gmail.com
2026-08-07thermal/drivers/spacemit/k1: Add shutdown action and reorder registration orderPei Xiao
Add a devm action to clean hardware interrupts, sampling, and control registers on driver unbind, mirroring what k1_tsensor_init() sets up. Reorder the registration order within probe(): register the thermal zones first, then request the IRQ, and register the shutdown action last. On removal, the hardware interrupt is disabled first, then the IRQ is released, and finally the thermal zones are released. This avoids the IRQ thread accessing an already unregistered thermal zone during devres cleanup. Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Link: https://patch.msgid.link/1967d2bcc8fede6fbd25fc8eee07f2873fb41472.1784184867.git.xiaopei01@kylinos.cn
2026-06-03thermal/drivers/spacemit/k1: Add thermal sensor supportShuwei Wu
The thermal sensor on K1 supports monitoring five temperature zones. The driver registers these sensors with the thermal framework and supports standard operations: - Reading temperature (millidegree Celsius) - Setting high/low thresholds for interrupts Signed-off-by: Shuwei Wu <shuwei.wu@mailbox.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Anand Moon <linux.amoon@gmail.com> Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Reviewed-by: Yao Zi <me@ziyao.cc> Tested-by: Anand Moon <linux.amoon@gmail.com> Tested-by: Vincent Legoll <legoll@online.fr> # OrangePi-RV2 Tested-by: Gong Shuai <gsh517025@gmail.com> Link: https://patch.msgid.link/20260427-k1-thermal-v5-2-df39187480ed@mailbox.org