forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hwmon: drivetemp: support to be a platform driver for thermal_of
Support thermal zone so that we can just rely on dts to describe a thermal zone and do the cooling operations. You can define a comptible string "drivetemp,hdd-sensors" to enable this, such as sata_port0: sata-port@0 { compatible = "drivetemp,hdd-sensors"; #thermal-sensor-cells = <0>; } Then define a thermal with this sensor to get it work. hdd_thermal: hdd-thermal { thermal-sensors = <&sata_port0>; } In most of the SoC systems, using dts to handle cooling is common. This can eliminate the usage of user space application to check the value exported in hwmon and then through sysfs to cooling. Signed-off-by: phinex <phinex@realtek.com>
- Loading branch information
1 parent
5c88c44
commit 1c53b68
Showing
2 changed files
with
133 additions
and
4 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
Documentation/devicetree/bindings/hwmon/drivetemp,hdd-sensors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) | ||
%YAML 1.2 | ||
--- | ||
$id: http://devicetree.org/schemas/hwmon/drivetemp,hdd-sensors.yaml# | ||
$schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
||
title: Drivetemp Temperature Monitor | ||
|
||
maintainers: | ||
- Phinex <phinex@realtek.com> | ||
|
||
description: | | ||
Drivetemp Temperature Monitor that support a single thermal zone | ||
This single thermal zone can support multiple hard drives, | ||
it uses maximal temperature of these hard drivers as its temp value. | ||
properties: | ||
compatible: | ||
enum: | ||
- drivetemp,hdd-sensors | ||
|
||
'#thermal-sensor-cells': | ||
const: 0 | ||
|
||
required: | ||
- compatible | ||
|
||
additionalProperties: false | ||
|
||
examples: | ||
- | | ||
sata_port0: sata-port@0 { | ||
ompatible = "drivetemp,hdd-sensors"; | ||
#thermal-sensor-cells = <0>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters