€•5Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ0/translations/zh_CN/driver-api/thermal/sysfs-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/zh_TW/driver-api/thermal/sysfs-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/it_IT/driver-api/thermal/sysfs-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ja_JP/driver-api/thermal/sysfs-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ko_KR/driver-api/thermal/sysfs-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/pt_BR/driver-api/thermal/sysfs-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/sp_SP/driver-api/thermal/sysfs-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ#Generic Thermal Sysfs driver How To”h]”hŒ#Generic Thermal Sysfs driver How To”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒJ/var/lib/git/docbuild/linux/Documentation/driver-api/thermal/sysfs-api.rst”h´KubhŒ paragraph”“”)�”}”(hŒSWritten by Sujith Thomas , Zhang Rui ”h]”(hŒWritten by Sujith Thomas <”…”�”}”(hhÍh²hh³Nh´NubhŒ reference”“”)�”}”(hŒsujith.thomas@intel.com”h]”hŒsujith.thomas@intel.com”…”�”}”(hh×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:sujith.thomas@intel.com”uh1hÕhhÍubhŒ>, Zhang Rui <”…”�”}”(hhÍh²hh³Nh´NubhÖ)�”}”(hŒrui.zhang@intel.com”h]”hŒrui.zhang@intel.com”…”�”}”(hhëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:rui.zhang@intel.com”uh1hÕhhÍubhŒ>”…”�”}”(hhÍh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)�”}”(hŒ%Copyright (c) 2008 Intel Corporation”h]”hŒ%Copyright (c) 2008 Intel Corporation”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒ0. Introduction”h]”hŒ0. Introduction”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´K ubhÌ)�”}”(hŒÒThe generic thermal sysfs provides a set of interfaces for thermal zone devices (sensors) and thermal cooling devices (fan, processor...) to register with the thermal management solution and to be a part of it.”h]”hŒÒThe generic thermal sysfs provides a set of interfaces for thermal zone devices (sensors) and thermal cooling devices (fan, processor...) to register with the thermal management solution and to be a part of it.”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hjh²hubhÌ)�”}”(hŒûThis how-to focuses on enabling new thermal zone and cooling devices to participate in thermal management. This solution is platform independent and any type of thermal zone devices and cooling devices should be able to make use of the infrastructure.”h]”hŒûThis how-to focuses on enabling new thermal zone and cooling devices to participate in thermal management. This solution is platform independent and any type of thermal zone devices and cooling devices should be able to make use of the infrastructure.”…”�”}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjh²hubhÌ)�”}”(hXKThe main task of the thermal sysfs driver is to expose thermal zone attributes as well as cooling device attributes to the user space. An intelligent thermal management application can make decisions based on inputs from thermal zone attributes (the current temperature and trip point temperature) and throttle appropriate devices.”h]”hXKThe main task of the thermal sysfs driver is to expose thermal zone attributes as well as cooling device attributes to the user space. An intelligent thermal management application can make decisions based on inputs from thermal zone attributes (the current temperature and trip point temperature) and throttle appropriate devices.”…”�”}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjh²hubhŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒ9`[0-*]` denotes any positive number starting from 0”h]”hÌ)�”}”(hjWh]”(hŒtitle_reference”“”)�”}”(hŒ`[0-*]`”h]”hŒ[0-*]”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j\hjYubhŒ2 denotes any positive number starting from 0”…”�”}”(hjYh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjUubah}”(h]”h ]”h"]”h$]”h&]”uh1jShjPh²hh³hÊh´NubjT)�”}”(hŒ:`[1-*]` denotes any positive number starting from 1 ”h]”hÌ)�”}”(hŒ9`[1-*]` denotes any positive number starting from 1”h]”(j])�”}”(hŒ`[1-*]`”h]”hŒ[1-*]”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j\hj€ubhŒ2 denotes any positive number starting from 1”…”�”}”(hj€h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShjPh²hh³hÊh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jNh³hÊh´Khjh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ0. introduction”ah$]”h&]”uh1hµhh·h²hh³hÊh´K ubh¶)�”}”(hhh]”(h»)�”}”(hŒ+1. thermal sysfs driver interface functions”h]”hŒ+1. thermal sysfs driver interface functions”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj²h²hh³hÊh´K ubh¶)�”}”(hhh]”(h»)�”}”(hŒ!1.1 thermal zone device interface”h]”hŒ!1.1 thermal zone device interface”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÃh²hh³hÊh´K#ubhŒ block_quote”“”)�”}”(hXÎ:: struct thermal_zone_device * thermal_zone_device_register_with_trips(const char *type, const struct thermal_trip *trips, int num_trips, void *devdata, const struct thermal_zone_device_ops *ops, const struct thermal_zone_params *tzp, unsigned int passive_delay, unsigned int polling_delay) This interface function adds a new thermal zone device (sensor) to the /sys/class/thermal folder as `thermal_zone[0-*]`. It tries to bind all the thermal cooling devices registered to it at the same time. type: the thermal zone type. trips: the table of trip points for this thermal zone. devdata: device private data ops: thermal zone device call-backs. .should_bind: check whether or not a given cooling device should be bound to a given trip point in this thermal zone. .get_temp: get the current temperature of the thermal zone. .set_trips: set the trip points window. Whenever the current temperature is updated, the trip points immediately below and above the current temperature are found. .change_mode: change the mode (enabled/disabled) of the thermal zone. .set_trip_temp: set the temperature of a given trip point. .get_crit_temp: get the critical temperature for this thermal zone. .set_emul_temp: set the emulation temperature which helps in debugging different threshold temperature points. .get_trend: get the trend of most recent zone temperature changes. .hot: hot trip point crossing handler. .critical: critical trip point crossing handler. tzp: thermal zone platform parameters. passive_delay: number of milliseconds to wait between polls when performing passive cooling. polling_delay: number of milliseconds to wait between polls when checking whether trip points have been crossed (0 for interrupt driven systems). :: void thermal_zone_device_unregister(struct thermal_zone_device *tz) This interface function removes the thermal zone device. It deletes the corresponding entry from /sys/class/thermal folder and unbinds all the thermal cooling devices it uses. :: struct thermal_zone_device *thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data, const struct thermal_zone_of_device_ops *ops) This interface adds a new sensor to a DT thermal zone. This function will search the list of thermal zones described in device tree and look for the zone that refer to the sensor device pointed by dev->of_node as temperature providers. For the zone pointing to the sensor node, the sensor will be added to the DT thermal zone device. The parameters for this interface are: dev: Device node of sensor containing valid node pointer in dev->of_node. sensor_id: a sensor identifier, in case the sensor IP has more than one sensors data: a private pointer (owned by the caller) that will be passed back, when a temperature reading is needed. ops: `struct thermal_zone_of_device_ops *`. ============== ======================================= get_temp a pointer to a function that reads the sensor temperature. This is mandatory callback provided by sensor driver. set_trips a pointer to a function that sets a temperature window. When this window is left the driver must inform the thermal core via thermal_zone_device_update. get_trend a pointer to a function that reads the sensor temperature trend. set_emul_temp a pointer to a function that sets sensor emulated temperature. ============== ======================================= The thermal zone temperature is provided by the get_temp() function pointer of thermal_zone_of_device_ops. When called, it will have the private pointer @data back. It returns error pointer if fails otherwise valid thermal zone device handle. Caller should check the return handle with IS_ERR() for finding whether success or not. :: void thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tzd) This interface unregisters a sensor from a DT thermal zone which was successfully added by interface thermal_zone_of_sensor_register(). This function removes the sensor callbacks and private data from the thermal zone device registered with thermal_zone_of_sensor_register() interface. It will also silent the zone by remove the .get_temp() and get_trend() thermal zone device callbacks. :: struct thermal_zone_device *devm_thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data, const struct thermal_zone_of_device_ops *ops) This interface is resource managed version of thermal_zone_of_sensor_register(). All details of thermal_zone_of_sensor_register() described in section 1.1.3 is applicable here. The benefit of using this interface to register sensor is that it is not require to explicitly call thermal_zone_of_sensor_unregister() in error path or during driver unbinding as this is done by driver resource manager. :: void devm_thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tzd) This interface is resource managed version of thermal_zone_of_sensor_unregister(). All details of thermal_zone_of_sensor_unregister() described in section 1.1.4 is applicable here. Normally this function will not need to be called and the resource management code will ensure that the resource is freed. :: int thermal_zone_get_slope(struct thermal_zone_device *tz) This interface is used to read the slope attribute value for the thermal zone device, which might be useful for platform drivers for temperature calculations. :: int thermal_zone_get_offset(struct thermal_zone_device *tz) This interface is used to read the offset attribute value for the thermal zone device, which might be useful for platform drivers for temperature calculations. ”h]”(hŒ literal_block”“”)�”}”(hXàstruct thermal_zone_device * thermal_zone_device_register_with_trips(const char *type, const struct thermal_trip *trips, int num_trips, void *devdata, const struct thermal_zone_device_ops *ops, const struct thermal_zone_params *tzp, unsigned int passive_delay, unsigned int polling_delay)”h]”hXàstruct thermal_zone_device * thermal_zone_device_register_with_trips(const char *type, const struct thermal_trip *trips, int num_trips, void *devdata, const struct thermal_zone_device_ops *ops, const struct thermal_zone_params *tzp, unsigned int passive_delay, unsigned int polling_delay)”…”�”}”hjÜsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jÚh³hÊh´K'hjÖubhÌ)�”}”(hŒÌThis interface function adds a new thermal zone device (sensor) to the /sys/class/thermal folder as `thermal_zone[0-*]`. It tries to bind all the thermal cooling devices registered to it at the same time.”h]”(hŒdThis interface function adds a new thermal zone device (sensor) to the /sys/class/thermal folder as ”…”�”}”(hjìh²hh³Nh´Nubj])�”}”(hŒ`thermal_zone[0-*]`”h]”hŒthermal_zone[0-*]”…”�”}”(hjôh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j\hjìubhŒU. It tries to bind all the thermal cooling devices registered to it at the same time.”…”�”}”(hjìh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K0hjÖubhŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hŒtype: the thermal zone type.”h]”(hŒterm”“”)�”}”(hŒtype:”h]”hŒtype:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K4hjubhŒ definition”“”)�”}”(hhh]”hÌ)�”}”(hŒthe thermal zone type.”h]”hŒthe thermal zone type.”…”�”}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K5hj)ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K4hjubj)�”}”(hŒ6trips: the table of trip points for this thermal zone.”h]”(j)�”}”(hŒtrips:”h]”hŒtrips:”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K6hjFubj()�”}”(hhh]”hÌ)�”}”(hŒ/the table of trip points for this thermal zone.”h]”hŒ/the table of trip points for this thermal zone.”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K7hjXubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjFubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K6hjubj)�”}”(hŒdevdata: device private data”h]”(j)�”}”(hŒdevdata:”h]”hŒdevdata:”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K8hjuubj()�”}”(hhh]”hÌ)�”}”(hŒdevice private data”h]”hŒdevice private data”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K9hj‡ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjuubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K8hjubj)�”}”(hXºops: thermal zone device call-backs. .should_bind: check whether or not a given cooling device should be bound to a given trip point in this thermal zone. .get_temp: get the current temperature of the thermal zone. .set_trips: set the trip points window. Whenever the current temperature is updated, the trip points immediately below and above the current temperature are found. .change_mode: change the mode (enabled/disabled) of the thermal zone. .set_trip_temp: set the temperature of a given trip point. .get_crit_temp: get the critical temperature for this thermal zone. .set_emul_temp: set the emulation temperature which helps in debugging different threshold temperature points. .get_trend: get the trend of most recent zone temperature changes. .hot: hot trip point crossing handler. .critical: critical trip point crossing handler.”h]”(j)�”}”(hŒops:”h]”hŒops:”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KShj¤ubj()�”}”(hhh]”(hÌ)�”}”(hŒthermal zone device call-backs.”h]”hŒthermal zone device call-backs.”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K;hj¶ubj )�”}”(hhh]”(j)�”}”(hŒu.should_bind: check whether or not a given cooling device should be bound to a given trip point in this thermal zone.”h]”(j)�”}”(hŒ .should_bind:”h]”hŒ .should_bind:”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K>hjÊubj()�”}”(hhh]”hÌ)�”}”(hŒgcheck whether or not a given cooling device should be bound to a given trip point in this thermal zone.”h]”hŒgcheck whether or not a given cooling device should be bound to a given trip point in this thermal zone.”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K>hjÜubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjÊubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K>hjÇubj)�”}”(hŒ;.get_temp: get the current temperature of the thermal zone.”h]”(j)�”}”(hŒ .get_temp:”h]”hŒ .get_temp:”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K@hjùubj()�”}”(hhh]”hÌ)�”}”(hŒ0get the current temperature of the thermal zone.”h]”hŒ0get the current temperature of the thermal zone.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KAhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjùubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K@hjÇubj)�”}”(hŒ£.set_trips: set the trip points window. Whenever the current temperature is updated, the trip points immediately below and above the current temperature are found.”h]”(j)�”}”(hŒ .set_trips:”h]”hŒ .set_trips:”…”�”}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KDhj(ubj()�”}”(hhh]”hÌ)�”}”(hŒ—set the trip points window. Whenever the current temperature is updated, the trip points immediately below and above the current temperature are found.”h]”hŒ—set the trip points window. Whenever the current temperature is updated, the trip points immediately below and above the current temperature are found.”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KChj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hj(ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KDhjÇubj)�”}”(hŒE.change_mode: change the mode (enabled/disabled) of the thermal zone.”h]”(j)�”}”(hŒ .change_mode:”h]”hŒ .change_mode:”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KFhjWubj()�”}”(hhh]”hÌ)�”}”(hŒ7change the mode (enabled/disabled) of the thermal zone.”h]”hŒ7change the mode (enabled/disabled) of the thermal zone.”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KGhjiubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjWubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KFhjÇubj)�”}”(hŒ:.set_trip_temp: set the temperature of a given trip point.”h]”(j)�”}”(hŒ.set_trip_temp:”h]”hŒ.set_trip_temp:”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KHhj†ubj()�”}”(hhh]”hÌ)�”}”(hŒ*set the temperature of a given trip point.”h]”hŒ*set the temperature of a given trip point.”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KIhj˜ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hj†ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KHhjÇubj)�”}”(hŒC.get_crit_temp: get the critical temperature for this thermal zone.”h]”(j)�”}”(hŒ.get_crit_temp:”h]”hŒ.get_crit_temp:”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KJhjµubj()�”}”(hhh]”hÌ)�”}”(hŒ3get the critical temperature for this thermal zone.”h]”hŒ3get the critical temperature for this thermal zone.”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KKhjÇubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjµubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KJhjÇubj)�”}”(hŒn.set_emul_temp: set the emulation temperature which helps in debugging different threshold temperature points.”h]”(j)�”}”(hŒ.set_emul_temp:”h]”hŒ.set_emul_temp:”…”�”}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KMhjäubj()�”}”(hhh]”hÌ)�”}”(hŒ^set the emulation temperature which helps in debugging different threshold temperature points.”h]”hŒ^set the emulation temperature which helps in debugging different threshold temperature points.”…”�”}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KMhjöubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjäubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KMhjÇubj)�”}”(hŒB.get_trend: get the trend of most recent zone temperature changes.”h]”(j)�”}”(hŒ .get_trend:”h]”hŒ .get_trend:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KOhjubj()�”}”(hhh]”hÌ)�”}”(hŒ6get the trend of most recent zone temperature changes.”h]”hŒ6get the trend of most recent zone temperature changes.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KPhj%ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KOhjÇubj)�”}”(hŒ&.hot: hot trip point crossing handler.”h]”(j)�”}”(hŒ.hot:”h]”hŒ.hot:”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KQhjBubj()�”}”(hhh]”hÌ)�”}”(hŒ hot trip point crossing handler.”h]”hŒ hot trip point crossing handler.”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KRhjTubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjBubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KQhjÇubj)�”}”(hŒ0.critical: critical trip point crossing handler.”h]”(j)�”}”(hŒ .critical:”h]”hŒ .critical:”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KShjqubj()�”}”(hhh]”hÌ)�”}”(hŒ%critical trip point crossing handler.”h]”hŒ%critical trip point crossing handler.”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KThjƒubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjqubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KShjÇubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hj¶ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'hj¤ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KShjubj)�”}”(hŒ&tzp: thermal zone platform parameters.”h]”(j)�”}”(hŒtzp:”h]”hŒtzp:”…”�”}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KUhj²ubj()�”}”(hhh]”hÌ)�”}”(hŒ!thermal zone platform parameters.”h]”hŒ!thermal zone platform parameters.”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KVhjÄubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hj²ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KUhjubj)�”}”(hŒ\passive_delay: number of milliseconds to wait between polls when performing passive cooling.”h]”(j)�”}”(hŒpassive_delay:”h]”hŒpassive_delay:”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KXhjáubj()�”}”(hhh]”hÌ)�”}”(hŒMnumber of milliseconds to wait between polls when performing passive cooling.”h]”hŒMnumber of milliseconds to wait between polls when performing passive cooling.”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KXhjóubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjáubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KXhjubj)�”}”(hŒ’polling_delay: number of milliseconds to wait between polls when checking whether trip points have been crossed (0 for interrupt driven systems). ”h]”(j)�”}”(hŒpolling_delay:”h]”hŒpolling_delay:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K\hjubj()�”}”(hhh]”hÌ)�”}”(hŒ‚number of milliseconds to wait between polls when checking whether trip points have been crossed (0 for interrupt driven systems).”h]”hŒ‚number of milliseconds to wait between polls when checking whether trip points have been crossed (0 for interrupt driven systems).”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K[hj"ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K\hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjÖubjÛ)�”}”(hŒCvoid thermal_zone_device_unregister(struct thermal_zone_device *tz)”h]”hŒCvoid thermal_zone_device_unregister(struct thermal_zone_device *tz)”…”�”}”hjEsbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´K`hjÖubhÌ)�”}”(hŒ¯This interface function removes the thermal zone device. It deletes the corresponding entry from /sys/class/thermal folder and unbinds all the thermal cooling devices it uses.”h]”hŒ¯This interface function removes the thermal zone device. It deletes the corresponding entry from /sys/class/thermal folder and unbinds all the thermal cooling devices it uses.”…”�”}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KbhjÖubjÕ)�”}”(hXå:: struct thermal_zone_device *thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data, const struct thermal_zone_of_device_ops *ops) This interface adds a new sensor to a DT thermal zone. This function will search the list of thermal zones described in device tree and look for the zone that refer to the sensor device pointed by dev->of_node as temperature providers. For the zone pointing to the sensor node, the sensor will be added to the DT thermal zone device. The parameters for this interface are: dev: Device node of sensor containing valid node pointer in dev->of_node. sensor_id: a sensor identifier, in case the sensor IP has more than one sensors data: a private pointer (owned by the caller) that will be passed back, when a temperature reading is needed. ops: `struct thermal_zone_of_device_ops *`. ============== ======================================= get_temp a pointer to a function that reads the sensor temperature. This is mandatory callback provided by sensor driver. set_trips a pointer to a function that sets a temperature window. When this window is left the driver must inform the thermal core via thermal_zone_device_update. get_trend a pointer to a function that reads the sensor temperature trend. set_emul_temp a pointer to a function that sets sensor emulated temperature. ============== ======================================= The thermal zone temperature is provided by the get_temp() function pointer of thermal_zone_of_device_ops. When called, it will have the private pointer @data back. It returns error pointer if fails otherwise valid thermal zone device handle. Caller should check the return handle with IS_ERR() for finding whether success or not. :: void thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tzd) This interface unregisters a sensor from a DT thermal zone which was successfully added by interface thermal_zone_of_sensor_register(). This function removes the sensor callbacks and private data from the thermal zone device registered with thermal_zone_of_sensor_register() interface. It will also silent the zone by remove the .get_temp() and get_trend() thermal zone device callbacks. :: struct thermal_zone_device *devm_thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data, const struct thermal_zone_of_device_ops *ops) This interface is resource managed version of thermal_zone_of_sensor_register(). All details of thermal_zone_of_sensor_register() described in section 1.1.3 is applicable here. The benefit of using this interface to register sensor is that it is not require to explicitly call thermal_zone_of_sensor_unregister() in error path or during driver unbinding as this is done by driver resource manager. :: void devm_thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tzd) This interface is resource managed version of thermal_zone_of_sensor_unregister(). All details of thermal_zone_of_sensor_unregister() described in section 1.1.4 is applicable here. Normally this function will not need to be called and the resource management code will ensure that the resource is freed. :: int thermal_zone_get_slope(struct thermal_zone_device *tz) This interface is used to read the slope attribute value for the thermal zone device, which might be useful for platform drivers for temperature calculations. :: int thermal_zone_get_offset(struct thermal_zone_device *tz) This interface is used to read the offset attribute value for the thermal zone device, which might be useful for platform drivers for temperature calculations. ”h]”(jÛ)�”}”(hŒÂstruct thermal_zone_device *thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data, const struct thermal_zone_of_device_ops *ops)”h]”hŒÂstruct thermal_zone_device *thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data, const struct thermal_zone_of_device_ops *ops)”…”�”}”hjesbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´KhhjaubhÌ)�”}”(hXMThis interface adds a new sensor to a DT thermal zone. This function will search the list of thermal zones described in device tree and look for the zone that refer to the sensor device pointed by dev->of_node as temperature providers. For the zone pointing to the sensor node, the sensor will be added to the DT thermal zone device.”h]”hXMThis interface adds a new sensor to a DT thermal zone. This function will search the list of thermal zones described in device tree and look for the zone that refer to the sensor device pointed by dev->of_node as temperature providers. For the zone pointing to the sensor node, the sensor will be added to the DT thermal zone device.”…”�”}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KmhjaubhÌ)�”}”(hŒ&The parameters for this interface are:”h]”hŒ&The parameters for this interface are:”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kthjaubj )�”}”(hhh]”(j)�”}”(hŒIdev: Device node of sensor containing valid node pointer in dev->of_node.”h]”(j)�”}”(hŒdev:”h]”hŒdev:”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kwhj’ubj()�”}”(hhh]”hÌ)�”}”(hŒDDevice node of sensor containing valid node pointer in dev->of_node.”h]”hŒDDevice node of sensor containing valid node pointer in dev->of_node.”…”�”}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kwhj¤ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hj’ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kwhj�ubj)�”}”(hŒOsensor_id: a sensor identifier, in case the sensor IP has more than one sensors”h]”(j)�”}”(hŒ sensor_id:”h]”hŒ sensor_id:”…”�”}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KzhjÁubj()�”}”(hhh]”hÌ)�”}”(hŒDa sensor identifier, in case the sensor IP has more than one sensors”h]”hŒDa sensor identifier, in case the sensor IP has more than one sensors”…”�”}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KzhjÓubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjÁubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kzhj�ubj)�”}”(hŒmdata: a private pointer (owned by the caller) that will be passed back, when a temperature reading is needed.”h]”(j)�”}”(hŒdata:”h]”hŒdata:”…”�”}”(hjôh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K}hjðubj()�”}”(hhh]”hÌ)�”}”(hŒga private pointer (owned by the caller) that will be passed back, when a temperature reading is needed.”h]”hŒga private pointer (owned by the caller) that will be passed back, when a temperature reading is needed.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K}hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjðubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K}hj�ubj)�”}”(hX×ops: `struct thermal_zone_of_device_ops *`. ============== ======================================= get_temp a pointer to a function that reads the sensor temperature. This is mandatory callback provided by sensor driver. set_trips a pointer to a function that sets a temperature window. When this window is left the driver must inform the thermal core via thermal_zone_device_update. get_trend a pointer to a function that reads the sensor temperature trend. set_emul_temp a pointer to a function that sets sensor emulated temperature. ============== ======================================= ”h]”(j)�”}”(hŒops:”h]”hŒops:”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KŽhjubj()�”}”(hhh]”(hÌ)�”}”(hŒ&`struct thermal_zone_of_device_ops *`.”h]”(j])�”}”(hŒ%`struct thermal_zone_of_device_ops *`”h]”hŒ#struct thermal_zone_of_device_ops *”…”�”}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j\hj4ubhŒ.”…”�”}”(hj4h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K€hj1ubhŒtable”“”)�”}”(hhh]”hŒtgroup”“”)�”}”(hhh]”(hŒcolspec”“”)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jZhjWubj[)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K'uh1jZhjWubhŒtbody”“”)�”}”(hhh]”(hŒrow”“”)�”}”(hhh]”(hŒentry”“”)�”}”(hhh]”hÌ)�”}”(hŒget_temp”h]”hŒget_temp”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kƒhj|ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjwubj{)�”}”(hhh]”hÌ)�”}”(hŒpa pointer to a function that reads the sensor temperature. This is mandatory callback provided by sensor driver.”h]”hŒpa pointer to a function that reads the sensor temperature. This is mandatory callback provided by sensor driver.”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kƒhj“ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjwubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjrubjv)�”}”(hhh]”(j{)�”}”(hhh]”hÌ)�”}”(hŒ set_trips”h]”hŒ set_trips”…”�”}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K†hj³ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj°ubj{)�”}”(hhh]”hÌ)�”}”(hŒ˜a pointer to a function that sets a temperature window. When this window is left the driver must inform the thermal core via thermal_zone_device_update.”h]”hŒ˜a pointer to a function that sets a temperature window. When this window is left the driver must inform the thermal core via thermal_zone_device_update.”…”�”}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K†hjÊubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj°ubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjrubjv)�”}”(hhh]”(j{)�”}”(hhh]”hÌ)�”}”(hŒ get_trend”h]”hŒ get_trend”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŠhjêubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjçubj{)�”}”(hhh]”hÌ)�”}”(hŒ@a pointer to a function that reads the sensor temperature trend.”h]”hŒ@a pointer to a function that reads the sensor temperature trend.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŠhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjçubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjrubjv)�”}”(hhh]”(j{)�”}”(hhh]”hÌ)�”}”(hŒ set_emul_temp”h]”hŒ set_emul_temp”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŒhj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjubj{)�”}”(hhh]”hÌ)�”}”(hŒ>a pointer to a function that sets sensor emulated temperature.”h]”hŒ>a pointer to a function that sets sensor emulated temperature.”…”�”}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŒhj8ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjrubeh}”(h]”h ]”h"]”h$]”h&]”uh1jphjWubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1jUhjRubah}”(h]”h ]”h"]”h$]”h&]”uh1jPhj1ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KŽhj�ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjaubhÌ)�”}”(hŒ¤The thermal zone temperature is provided by the get_temp() function pointer of thermal_zone_of_device_ops. When called, it will have the private pointer @data back.”h]”hŒ¤The thermal zone temperature is provided by the get_temp() function pointer of thermal_zone_of_device_ops. When called, it will have the private pointer @data back.”…”�”}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K�hjaubhÌ)�”}”(hŒ¥It returns error pointer if fails otherwise valid thermal zone device handle. Caller should check the return handle with IS_ERR() for finding whether success or not.”h]”hŒ¥It returns error pointer if fails otherwise valid thermal zone device handle. Caller should check the return handle with IS_ERR() for finding whether success or not.”…”�”}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K”hjaubjÛ)�”}”(hŒ‚void thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tzd)”h]”hŒ‚void thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tzd)”…”�”}”hj–sbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´KšhjaubhÌ)�”}”(hXƒThis interface unregisters a sensor from a DT thermal zone which was successfully added by interface thermal_zone_of_sensor_register(). This function removes the sensor callbacks and private data from the thermal zone device registered with thermal_zone_of_sensor_register() interface. It will also silent the zone by remove the .get_temp() and get_trend() thermal zone device callbacks.”h]”hXƒThis interface unregisters a sensor from a DT thermal zone which was successfully added by interface thermal_zone_of_sensor_register(). This function removes the sensor callbacks and private data from the thermal zone device registered with thermal_zone_of_sensor_register() interface. It will also silent the zone by remove the .get_temp() and get_trend() thermal zone device callbacks.”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K�hjaubjÛ)�”}”(hŒßstruct thermal_zone_device *devm_thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data, const struct thermal_zone_of_device_ops *ops)”h]”hŒßstruct thermal_zone_device *devm_thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data, const struct thermal_zone_of_device_ops *ops)”…”�”}”hj²sbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´K¦hjaubhÌ)�”}”(hŒPThis interface is resource managed version of thermal_zone_of_sensor_register().”h]”hŒPThis interface is resource managed version of thermal_zone_of_sensor_register().”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¬hjaubhÌ)�”}”(hŒ_All details of thermal_zone_of_sensor_register() described in section 1.1.3 is applicable here.”h]”hŒ_All details of thermal_zone_of_sensor_register() described in section 1.1.3 is applicable here.”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¯hjaubhÌ)�”}”(hŒÜThe benefit of using this interface to register sensor is that it is not require to explicitly call thermal_zone_of_sensor_unregister() in error path or during driver unbinding as this is done by driver resource manager.”h]”hŒÜThe benefit of using this interface to register sensor is that it is not require to explicitly call thermal_zone_of_sensor_unregister() in error path or during driver unbinding as this is done by driver resource manager.”…”�”}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K²hjaubjÛ)�”}”(hŒ€void devm_thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tzd)”h]”hŒ€void devm_thermal_zone_of_sensor_unregister(struct device *dev, struct thermal_zone_device *tzd)”…”�”}”hjêsbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´K¹hjaubhÌ)�”}”(hX/This interface is resource managed version of thermal_zone_of_sensor_unregister(). All details of thermal_zone_of_sensor_unregister() described in section 1.1.4 is applicable here. Normally this function will not need to be called and the resource management code will ensure that the resource is freed.”h]”hX/This interface is resource managed version of thermal_zone_of_sensor_unregister(). All details of thermal_zone_of_sensor_unregister() described in section 1.1.4 is applicable here. Normally this function will not need to be called and the resource management code will ensure that the resource is freed.”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¼hjaubjÛ)�”}”(hŒ:int thermal_zone_get_slope(struct thermal_zone_device *tz)”h]”hŒ:int thermal_zone_get_slope(struct thermal_zone_device *tz)”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´KÅhjaubhÌ)�”}”(hŒžThis interface is used to read the slope attribute value for the thermal zone device, which might be useful for platform drivers for temperature calculations.”h]”hŒžThis interface is used to read the slope attribute value for the thermal zone device, which might be useful for platform drivers for temperature calculations.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÇhjaubjÛ)�”}”(hŒ;int thermal_zone_get_offset(struct thermal_zone_device *tz)”h]”hŒ;int thermal_zone_get_offset(struct thermal_zone_device *tz)”…”�”}”hj"sbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´KÍhjaubhÌ)�”}”(hŒŸThis interface is used to read the offset attribute value for the thermal zone device, which might be useful for platform drivers for temperature calculations.”h]”hŒŸThis interface is used to read the offset attribute value for the thermal zone device, which might be useful for platform drivers for temperature calculations.”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÏhjaubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´KfhjÖubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´K%hjÃh²hubeh}”(h]”Œthermal-zone-device-interface”ah ]”h"]”Œ!1.1 thermal zone device interface”ah$]”h&]”uh1hµhj²h²hh³hÊh´K#ubh¶)�”}”(hhh]”(h»)�”}”(hŒ$1.2 thermal cooling device interface”h]”hŒ$1.2 thermal cooling device interface”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjRh²hh³hÊh´KÔubjÕ)�”}”(hX:: struct thermal_cooling_device *thermal_cooling_device_register(char *name, void *devdata, struct thermal_cooling_device_ops *) This interface function adds a new thermal cooling device (fan/processor/...) to /sys/class/thermal/ folder as `cooling_device[0-*]`. It tries to bind itself to all the thermal zone devices registered at the same time. name: the cooling device name. devdata: device private data. ops: thermal cooling devices call-backs. .get_max_state: get the Maximum throttle state of the cooling device. .get_cur_state: get the Currently requested throttle state of the cooling device. .set_cur_state: set the Current throttle state of the cooling device. :: void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev) This interface function removes the thermal cooling device. It deletes the corresponding entry from /sys/class/thermal folder and unbinds itself from all the thermal zone devices using it. ”h]”(jÛ)�”}”(hŒŽstruct thermal_cooling_device *thermal_cooling_device_register(char *name, void *devdata, struct thermal_cooling_device_ops *)”h]”hŒŽstruct thermal_cooling_device *thermal_cooling_device_register(char *name, void *devdata, struct thermal_cooling_device_ops *)”…”�”}”hjgsbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´KÙhjcubhÌ)�”}”(hŒÚThis interface function adds a new thermal cooling device (fan/processor/...) to /sys/class/thermal/ folder as `cooling_device[0-*]`. It tries to bind itself to all the thermal zone devices registered at the same time.”h]”(hŒoThis interface function adds a new thermal cooling device (fan/processor/...) to /sys/class/thermal/ folder as ”…”�”}”(hjuh²hh³Nh´Nubj])�”}”(hŒ`cooling_device[0-*]`”h]”hŒcooling_device[0-*]”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j\hjuubhŒV. It tries to bind itself to all the thermal zone devices registered at the same time.”…”�”}”(hjuh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÝhjcubj )�”}”(hhh]”(j)�”}”(hŒname: the cooling device name.”h]”(j)�”}”(hŒname:”h]”hŒname:”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Káhj˜ubj()�”}”(hhh]”hÌ)�”}”(hŒthe cooling device name.”h]”hŒthe cooling device name.”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kâhjªubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hj˜ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Káhj•ubj)�”}”(hŒdevdata: device private data.”h]”(j)�”}”(hŒdevdata:”h]”hŒdevdata:”…”�”}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KãhjÇubj()�”}”(hhh]”hÌ)�”}”(hŒdevice private data.”h]”hŒdevice private data.”…”�”}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KähjÙubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjÇubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kãhj•ubj)�”}”(hX(ops: thermal cooling devices call-backs. .get_max_state: get the Maximum throttle state of the cooling device. .get_cur_state: get the Currently requested throttle state of the cooling device. .set_cur_state: set the Current throttle state of the cooling device. ”h]”(j)�”}”(hŒops:”h]”hŒops:”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kîhjöubj()�”}”(hhh]”(hÌ)�”}”(hŒ#thermal cooling devices call-backs.”h]”hŒ#thermal cooling devices call-backs.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kæhj ubj )�”}”(hhh]”(j)�”}”(hŒE.get_max_state: get the Maximum throttle state of the cooling device.”h]”(j)�”}”(hŒ.get_max_state:”h]”hŒ.get_max_state:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kèhj ubj()�”}”(hhh]”hÌ)�”}”(hŒ5get the Maximum throttle state of the cooling device.”h]”hŒ5get the Maximum throttle state of the cooling device.”…”�”}”(hj1 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kéhj. ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kèhj ubj)�”}”(hŒQ.get_cur_state: get the Currently requested throttle state of the cooling device.”h]”(j)�”}”(hŒ.get_cur_state:”h]”hŒ.get_cur_state:”…”�”}”(hjO h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KëhjK ubj()�”}”(hhh]”hÌ)�”}”(hŒAget the Currently requested throttle state of the cooling device.”h]”hŒAget the Currently requested throttle state of the cooling device.”…”�”}”(hj` h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Këhj] ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjK ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Këhj ubj)�”}”(hŒF.set_cur_state: set the Current throttle state of the cooling device. ”h]”(j)�”}”(hŒ.set_cur_state:”h]”hŒ.set_cur_state:”…”�”}”(hj~ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kîhjz ubj()�”}”(hhh]”hÌ)�”}”(hŒ5set the Current throttle state of the cooling device.”h]”hŒ5set the Current throttle state of the cooling device.”…”�”}”(hj� h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KîhjŒ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjz ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kîhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j'hjöubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kîhj•ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjcubjÛ)�”}”(hŒKvoid thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)”h]”hŒKvoid thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)”…”�”}”hjÁ sbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´KòhjcubhÌ)�”}”(hŒ¼This interface function removes the thermal cooling device. It deletes the corresponding entry from /sys/class/thermal folder and unbinds itself from all the thermal zone devices using it.”h]”hŒ¼This interface function removes the thermal cooling device. It deletes the corresponding entry from /sys/class/thermal folder and unbinds itself from all the thermal zone devices using it.”…”�”}”(hjÏ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kôhjcubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´K×hjRh²hubeh}”(h]”Œ thermal-cooling-device-interface”ah ]”h"]”Œ$1.2 thermal cooling device interface”ah$]”h&]”uh1hµhj²h²hh³hÊh´KÔubh¶)�”}”(hhh]”(h»)�”}”(hŒ1.4 Thermal Zone Parameters”h]”hŒ1.4 Thermal Zone Parameters”…”�”}”(hjî h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjë h²hh³hÊh´KùubjÕ)�”}”(hX»:: struct thermal_zone_params This structure defines the platform level parameters for a thermal zone. This data, for each thermal zone should come from the platform layer. This is an optional feature where some platforms can choose not to provide this data. .governor_name: Name of the thermal governor used for this zone .no_hwmon: a boolean to indicate if the thermal to hwmon sysfs interface is required. when no_hwmon == false, a hwmon sysfs interface will be created. when no_hwmon == true, nothing will be done. In case the thermal_zone_params is NULL, the hwmon interface will be created (for backward compatibility). ”h]”(jÛ)�”}”(hŒstruct thermal_zone_params”h]”hŒstruct thermal_zone_params”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´Kýhjü ubhÌ)�”}”(hŒäThis structure defines the platform level parameters for a thermal zone. This data, for each thermal zone should come from the platform layer. This is an optional feature where some platforms can choose not to provide this data.”h]”hŒäThis structure defines the platform level parameters for a thermal zone. This data, for each thermal zone should come from the platform layer. This is an optional feature where some platforms can choose not to provide this data.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kÿhjü ubj )�”}”(hhh]”(j)�”}”(hŒ?.governor_name: Name of the thermal governor used for this zone”h]”(j)�”}”(hŒ.governor_name:”h]”hŒ.governor_name:”…”�”}”(hj# h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mhj ubj()�”}”(hhh]”hÌ)�”}”(hŒ/Name of the thermal governor used for this zone”h]”hŒ/Name of the thermal governor used for this zone”…”�”}”(hj4 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj1 ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mhj ubj)�”}”(hX/.no_hwmon: a boolean to indicate if the thermal to hwmon sysfs interface is required. when no_hwmon == false, a hwmon sysfs interface will be created. when no_hwmon == true, nothing will be done. In case the thermal_zone_params is NULL, the hwmon interface will be created (for backward compatibility). ”h]”(j)�”}”(hŒ .no_hwmon:”h]”hŒ .no_hwmon:”…”�”}”(hjR h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M hjN ubj()�”}”(hhh]”hÌ)�”}”(hX#a boolean to indicate if the thermal to hwmon sysfs interface is required. when no_hwmon == false, a hwmon sysfs interface will be created. when no_hwmon == true, nothing will be done. In case the thermal_zone_params is NULL, the hwmon interface will be created (for backward compatibility).”h]”hX#a boolean to indicate if the thermal to hwmon sysfs interface is required. when no_hwmon == false, a hwmon sysfs interface will be created. when no_hwmon == true, nothing will be done. In case the thermal_zone_params is NULL, the hwmon interface will be created (for backward compatibility).”…”�”}”(hjc h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj` ubah}”(h]”h ]”h"]”h$]”h&]”uh1j'hjN ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjü ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÔh³hÊh´Kûhjë h²hubeh}”(h]”Œthermal-zone-parameters”ah ]”h"]”Œ1.4 thermal zone parameters”ah$]”h&]”uh1hµhj²h²hh³hÊh´Kùubeh}”(h]”Œ(thermal-sysfs-driver-interface-functions”ah ]”h"]”Œ+1. thermal sysfs driver interface functions”ah$]”h&]”uh1hµhh·h²hh³hÊh´K ubh¶)�”}”(hhh]”(h»)�”}”(hŒ2. sysfs attributes structure”h]”hŒ2. sysfs attributes structure”…”�”}”(hjœ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj™ h²hh³hÊh´MubjQ)�”}”(hhh]”jV)�”}”(hhh]”(j[)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jZhj­ ubj[)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”Kuh1jZhj­ ubjq)�”}”(hhh]”(jv)�”}”(hhh]”(j{)�”}”(hhh]”hÌ)�”}”(hŒRO”h]”hŒRO”…”�”}”(hjÍ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjÊ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjÇ ubj{)�”}”(hhh]”hÌ)�”}”(hŒread only value”h]”hŒread only value”…”�”}”(hjä h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhjá ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjÇ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjÄ ubjv)�”}”(hhh]”(j{)�”}”(hhh]”hÌ)�”}”(hŒWO”h]”hŒWO”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjþ ubj{)�”}”(hhh]”hÌ)�”}”(hŒwrite only value”h]”hŒwrite only value”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhjþ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjÄ ubjv)�”}”(hhh]”(j{)�”}”(hhh]”hÌ)�”}”(hŒRW”h]”hŒRW”…”�”}”(hj; h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj8 ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj5 ubj{)�”}”(hhh]”hÌ)�”}”(hŒread/write value”h]”hŒread/write value”…”�”}”(hjR h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MhjO ubah}”(h]”h ]”h"]”h$]”h&]”uh1jzhj5 ubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjÄ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jphj­ ubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1jUhjª ubah}”(h]”h ]”h"]”h$]”h&]”uh1jPhj™ h²hh³hÊh´NubhÌ)�”}”(hŒ·Thermal sysfs attributes will be represented under /sys/class/thermal. Hwmon sysfs I/F extension is also available under /sys/class/hwmon if hwmon is compiled in or built as a module.”h]”hŒ·Thermal sysfs attributes will be represented under /sys/class/thermal. Hwmon sysfs I/F extension is also available under /sys/class/hwmon if hwmon is compiled in or built as a module.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mhj™ h²hubhÌ)�”}”(hŒ;Thermal zone device sys I/F, created once it's registered::”h]”hŒThermal cooling device sys I/F, created once it's registered::”h]”hŒ?Thermal cooling device sys I/F, created once it’s registered:”…”�”}”(hj© h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M/hj™ h²hubjÛ)�”}”(hXp/sys/class/thermal/cooling_device[0-*]: |---type: Type of the cooling device(processor/fan/...) |---max_state: Maximum cooling state of the cooling device |---cur_state: Current cooling state of the cooling device |---stats: Directory containing cooling device's statistics |---stats/reset: Writing any value resets the statistics |---stats/time_in_state_ms: Time (msec) spent in various cooling states |---stats/total_trans: Total number of times cooling state is changed |---stats/trans_table: Cooling state transition table”h]”hXp/sys/class/thermal/cooling_device[0-*]: |---type: Type of the cooling device(processor/fan/...) |---max_state: Maximum cooling state of the cooling device |---cur_state: Current cooling state of the cooling device |---stats: Directory containing cooling device's statistics |---stats/reset: Writing any value resets the statistics |---stats/time_in_state_ms: Time (msec) spent in various cooling states |---stats/total_trans: Total number of times cooling state is changed |---stats/trans_table: Cooling state transition table”…”�”}”hj· sbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´M1hj™ h²hubhÌ)�”}”(hŒ˜Then next two dynamic attributes are created/removed in pairs. They represent the relationship between a thermal zone and its associated cooling device.”h]”hŒ˜Then next two dynamic attributes are created/removed in pairs. They represent the relationship between a thermal zone and its associated cooling device.”…”�”}”(hjÅ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M<hj™ h²hubjÛ)�”}”(hX./sys/class/thermal/thermal_zone[0-*]: |---cdev[0-*]: [0-*]th cooling device in current thermal zone |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with |---cdev[0-*]_weight: Influence of the cooling device in this thermal zone”h]”hX./sys/class/thermal/thermal_zone[0-*]: |---cdev[0-*]: [0-*]th cooling device in current thermal zone |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with |---cdev[0-*]_weight: Influence of the cooling device in this thermal zone”…”�”}”hjÓ sbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´MAhj™ h²hubhÌ)�”}”(hX>Besides the thermal zone device sysfs I/F and cooling device sysfs I/F, the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of thermal zone device. E.g. the generic thermal driver registers one hwmon class device and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones.”h]”hX>Besides the thermal zone device sysfs I/F and cooling device sysfs I/F, the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of thermal zone device. E.g. the generic thermal driver registers one hwmon class device and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones.”…”�”}”(hjá h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MGhj™ h²hubhÌ)�”}”(hŒpPlease read Documentation/ABI/testing/sysfs-class-thermal for thermal zone and cooling device attribute details.”h]”hŒpPlease read Documentation/ABI/testing/sysfs-class-thermal for thermal zone and cooling device attribute details.”…”�”}”(hjï h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MMhj™ h²hubjÛ)�”}”(hŒ÷/sys/class/hwmon/hwmon[0-*]: |---name: The type of the thermal zone devices |---temp[1-*]_input: The current temperature of thermal zone [1-*] |---temp[1-*]_critical: The critical trip point of thermal zone [1-*]”h]”hŒ÷/sys/class/hwmon/hwmon[0-*]: |---name: The type of the thermal zone devices |---temp[1-*]_input: The current temperature of thermal zone [1-*] |---temp[1-*]_critical: The critical trip point of thermal zone [1-*]”…”�”}”hjý sbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´MRhj™ h²hubhÌ)�”}”(hŒOPlease read Documentation/hwmon/sysfs-interface.rst for additional information.”h]”hŒOPlease read Documentation/hwmon/sysfs-interface.rst for additional information.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´MWhj™ h²hubeh}”(h]”Œsysfs-attributes-structure”ah ]”h"]”Œ2. sysfs attributes structure”ah$]”h&]”uh1hµhh·h²hh³hÊh´Mubh¶)�”}”(hhh]”(h»)�”}”(hŒ3. A simple implementation”h]”hŒ3. A simple implementation”…”�”}”(hj$ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj! h²hh³hÊh´MZubhÌ)�”}”(hX·ACPI thermal zone may support multiple trip points like critical, hot, passive, active. If an ACPI thermal zone supports critical, passive, active[0] and active[1] at the same time, it may register itself as a thermal_zone_device (thermal_zone1) with 4 trip points in all. It has one processor and one fan, which are both registered as thermal_cooling_device. Both are considered to have the same effectiveness in cooling the thermal zone.”h]”hX·ACPI thermal zone may support multiple trip points like critical, hot, passive, active. If an ACPI thermal zone supports critical, passive, active[0] and active[1] at the same time, it may register itself as a thermal_zone_device (thermal_zone1) with 4 trip points in all. It has one processor and one fan, which are both registered as thermal_cooling_device. Both are considered to have the same effectiveness in cooling the thermal zone.”…”�”}”(hj2 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M\hj! h²hubhÌ)�”}”(hŒ€If the processor is listed in _PSL method, and the fan is listed in _AL0 method, the sys I/F structure will be built like this::”h]”hŒIf the processor is listed in _PSL method, and the fan is listed in _AL0 method, the sys I/F structure will be built like this:”…”�”•B$}”(hj@ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mdhj! h²hubjÛ)�”}”(hX/sys/class/thermal: |thermal_zone1: |---type: acpitz |---temp: 37000 |---mode: enabled |---policy: step_wise |---available_policies: step_wise fair_share |---trip_point_0_temp: 100000 |---trip_point_0_type: critical |---trip_point_1_temp: 80000 |---trip_point_1_type: passive |---trip_point_2_temp: 70000 |---trip_point_2_type: active0 |---trip_point_3_temp: 60000 |---trip_point_3_type: active1 |---cdev0: --->/sys/class/thermal/cooling_device0 |---cdev0_trip_point: 1 /* cdev0 can be used for passive */ |---cdev0_weight: 1024 |---cdev1: --->/sys/class/thermal/cooling_device3 |---cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/ |---cdev1_weight: 1024 |cooling_device0: |---type: Processor |---max_state: 8 |---cur_state: 0 |cooling_device3: |---type: Fan |---max_state: 2 |---cur_state: 0 /sys/class/hwmon: |hwmon0: |---name: acpitz |---temp1_input: 37000 |---temp1_crit: 100000”h]”hX/sys/class/thermal: |thermal_zone1: |---type: acpitz |---temp: 37000 |---mode: enabled |---policy: step_wise |---available_policies: step_wise fair_share |---trip_point_0_temp: 100000 |---trip_point_0_type: critical |---trip_point_1_temp: 80000 |---trip_point_1_type: passive |---trip_point_2_temp: 70000 |---trip_point_2_type: active0 |---trip_point_3_temp: 60000 |---trip_point_3_type: active1 |---cdev0: --->/sys/class/thermal/cooling_device0 |---cdev0_trip_point: 1 /* cdev0 can be used for passive */ |---cdev0_weight: 1024 |---cdev1: --->/sys/class/thermal/cooling_device3 |---cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/ |---cdev1_weight: 1024 |cooling_device0: |---type: Processor |---max_state: 8 |---cur_state: 0 |cooling_device3: |---type: Fan |---max_state: 2 |---cur_state: 0 /sys/class/hwmon: |hwmon0: |---name: acpitz |---temp1_input: 37000 |---temp1_crit: 100000”…”�”}”hjN sbah}”(h]”h ]”h"]”h$]”h&]”jêjëuh1jÚh³hÊh´Mghj! h²hubeh}”(h]”Œa-simple-implementation”ah ]”h"]”Œ3. a simple implementation”ah$]”h&]”uh1hµhh·h²hh³hÊh´MZubh¶)�”}”(hhh]”(h»)�”}”(hŒ4. Export Symbol APIs”h]”hŒ4. Export Symbol APIs”…”�”}”(hjg h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjd h²hh³hÊh´MŽubh¶)�”}”(hhh]”(h»)�”}”(hŒ4.1. get_tz_trend”h]”hŒ4.1. get_tz_trend”…”�”}”(hjx h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhju h²hh³hÊh´M‘ubhÌ)�”}”(hX1This function returns the trend of a thermal zone, i.e the rate of change of temperature of the thermal zone. Ideally, the thermal sensor drivers are supposed to implement the callback. If they don't, the thermal framework calculated the trend by comparing the previous and the current temperature values.”h]”hX3This function returns the trend of a thermal zone, i.e the rate of change of temperature of the thermal zone. Ideally, the thermal sensor drivers are supposed to implement the callback. If they don’t, the thermal framework calculated the trend by comparing the previous and the current temperature values.”…”�”}”(hj† h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M“hju h²hubeh}”(h]”Œ get-tz-trend”ah ]”h"]”Œ4.1. get_tz_trend”ah$]”h&]”uh1hµhjd h²hh³hÊh´M‘ubh¶)�”}”(hhh]”(h»)�”}”(hŒ4.2. thermal_cdev_update”h]”hŒ4.2. thermal_cdev_update”…”�”}”(hjŸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjœ h²hh³hÊh´MšubhÌ)�”}”(hŒ�This function serves as an arbitrator to set the state of a cooling device. It sets the cooling device to the deepest cooling state if possible.”h]”hŒ�This function serves as an arbitrator to set the state of a cooling device. It sets the cooling device to the deepest cooling state if possible.”…”�”}”(hj­ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Mœhjœ h²hubeh}”(h]”Œthermal-cdev-update”ah ]”h"]”Œ4.2. thermal_cdev_update”ah$]”h&]”uh1hµhjd h²hh³hÊh´Mšubeh}”(h]”Œexport-symbol-apis”ah ]”h"]”Œ4. export symbol apis”ah$]”h&]”uh1hµhh·h²hh³hÊh´MŽubh¶)�”}”(hhh]”(h»)�”}”(hŒ5. Critical Events”h]”hŒ5. Critical Events”…”�”}”(hjÎ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjË h²hh³hÊh´M¡ubhÌ)�”}”(hŒ§On an event of critical trip temperature crossing, the thermal framework will trigger a hardware protection power-off (shutdown) or reboot, depending on configuration.”h]”hŒ§On an event of critical trip temperature crossing, the thermal framework will trigger a hardware protection power-off (shutdown) or reboot, depending on configuration.”…”�”}”(hjÜ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M£hjË h²hubhÌ)�”}”(hŒáAt first, the kernel will attempt an orderly power-off or reboot, but accepts a delay after which it proceeds to do a forced power-off or reboot, respectively. If this fails, ``emergency_restart()`` is invoked as last resort.”h]”(hŒ¯At first, the kernel will attempt an orderly power-off or reboot, but accepts a delay after which it proceeds to do a forced power-off or reboot, respectively. If this fails, ”…”�”}”(hjê h²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``emergency_restart()``”h]”hŒemergency_restart()”…”�”}”(hjô h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jò hjê ubhŒ is invoked as last resort.”…”�”}”(hjê h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M§hjË h²hubhÌ)�”}”(hŒcThe delay should be carefully profiled so as to give adequate time for orderly power-off or reboot.”h]”hŒcThe delay should be carefully profiled so as to give adequate time for orderly power-off or reboot.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M¬hjË h²hubhÌ)�”}”(hŒ©If the delay is set to 0, the emergency action will not be supported. So a carefully profiled non-zero positive value is a must for the emergency action to be triggered.”h]”hŒ©If the delay is set to 0, the emergency action will not be supported. So a carefully profiled non-zero positive value is a must for the emergency action to be triggered.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´M¯hjË h²hubeh}”(h]”Œcritical-events”ah ]”h"]”Œ5. critical events”ah$]”h&]”uh1hµhh·h²hh³hÊh´M¡ubeh}”(h]”Œ#generic-thermal-sysfs-driver-how-to”ah ]”h"]”Œ#generic thermal sysfs driver how to”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”jzŒfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jZ Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j5 j2 j¯j¬j– j“ jOjLjè jå jŽ j‹ j j ja j^ jÈ jÅ j™ j– jÀ j½ j- j* uŒ nametypes”}”(j5 ‰j¯‰j– ‰jO‰jè ‰jŽ ‰j ‰ja ‰jÈ ‰j™ ‰jÀ ‰j- ‰uh}”(j2 h·j¬jj“ j²jLjÃjå jRj‹ jë j j™ j^ j! jÅ jd j– ju j½ jœ j* jË uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.