xref: /linux/include/uapi/linux/thermal.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2af6c9f16SFlorian Fainelli #ifndef _UAPI_LINUX_THERMAL_H
3af6c9f16SFlorian Fainelli #define _UAPI_LINUX_THERMAL_H
4af6c9f16SFlorian Fainelli 
5af6c9f16SFlorian Fainelli #define THERMAL_NAME_LENGTH	20
6af6c9f16SFlorian Fainelli 
71ce50e7dSDaniel Lezcano enum thermal_device_mode {
81ce50e7dSDaniel Lezcano 	THERMAL_DEVICE_DISABLED = 0,
91ce50e7dSDaniel Lezcano 	THERMAL_DEVICE_ENABLED,
10af6c9f16SFlorian Fainelli };
11af6c9f16SFlorian Fainelli 
121ce50e7dSDaniel Lezcano enum thermal_trip_type {
131ce50e7dSDaniel Lezcano 	THERMAL_TRIP_ACTIVE = 0,
141ce50e7dSDaniel Lezcano 	THERMAL_TRIP_PASSIVE,
151ce50e7dSDaniel Lezcano 	THERMAL_TRIP_HOT,
161ce50e7dSDaniel Lezcano 	THERMAL_TRIP_CRITICAL,
171ce50e7dSDaniel Lezcano };
181ce50e7dSDaniel Lezcano 
191ce50e7dSDaniel Lezcano /* Adding event notification support elements */
201ce50e7dSDaniel Lezcano #define THERMAL_GENL_FAMILY_NAME		"thermal"
211ce50e7dSDaniel Lezcano #define THERMAL_GENL_VERSION			0x01
221ce50e7dSDaniel Lezcano #define THERMAL_GENL_SAMPLING_GROUP_NAME	"sampling"
231ce50e7dSDaniel Lezcano #define THERMAL_GENL_EVENT_GROUP_NAME		"event"
241ce50e7dSDaniel Lezcano 
251ce50e7dSDaniel Lezcano /* Attributes of thermal_genl_family */
261ce50e7dSDaniel Lezcano enum thermal_genl_attr {
27af6c9f16SFlorian Fainelli 	THERMAL_GENL_ATTR_UNSPEC,
281ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ,
291ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_ID,
301ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_TEMP,
311ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_TRIP,
321ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_TRIP_ID,
331ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_TRIP_TYPE,
341ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_TRIP_TEMP,
351ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_TRIP_HYST,
361ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_MODE,
371ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_NAME,
381ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_CDEV_WEIGHT,
391ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_GOV,
401ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_TZ_GOV_NAME,
411ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_CDEV,
421ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_CDEV_ID,
431ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_CDEV_CUR_STATE,
441ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_CDEV_MAX_STATE,
451ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_CDEV_NAME,
461ce50e7dSDaniel Lezcano 	THERMAL_GENL_ATTR_GOV_NAME,
47*e4b1eb24SSrinivas Pandruvada 	THERMAL_GENL_ATTR_CPU_CAPABILITY,
48*e4b1eb24SSrinivas Pandruvada 	THERMAL_GENL_ATTR_CPU_CAPABILITY_ID,
49*e4b1eb24SSrinivas Pandruvada 	THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE,
50*e4b1eb24SSrinivas Pandruvada 	THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY,
51af6c9f16SFlorian Fainelli 	__THERMAL_GENL_ATTR_MAX,
52af6c9f16SFlorian Fainelli };
53af6c9f16SFlorian Fainelli #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
54af6c9f16SFlorian Fainelli 
551ce50e7dSDaniel Lezcano enum thermal_genl_sampling {
561ce50e7dSDaniel Lezcano 	THERMAL_GENL_SAMPLING_TEMP,
571ce50e7dSDaniel Lezcano 	__THERMAL_GENL_SAMPLING_MAX,
581ce50e7dSDaniel Lezcano };
591ce50e7dSDaniel Lezcano #define THERMAL_GENL_SAMPLING_MAX (__THERMAL_GENL_SAMPLING_MAX - 1)
601ce50e7dSDaniel Lezcano 
611ce50e7dSDaniel Lezcano /* Events of thermal_genl_family */
621ce50e7dSDaniel Lezcano enum thermal_genl_event {
631ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_UNSPEC,
641ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_TZ_CREATE,		/* Thermal zone creation */
651ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_TZ_DELETE,		/* Thermal zone deletion */
66312e3f8aSColin Ian King 	THERMAL_GENL_EVENT_TZ_DISABLE,		/* Thermal zone disabled */
671ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_TZ_ENABLE,		/* Thermal zone enabled */
681ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_TZ_TRIP_UP,		/* Trip point crossed the way up */
691ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_TZ_TRIP_DOWN,	/* Trip point crossed the way down */
701ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_TZ_TRIP_CHANGE,	/* Trip point changed */
711ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_TZ_TRIP_ADD,		/* Trip point added */
721ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_TZ_TRIP_DELETE,	/* Trip point deleted */
731ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_CDEV_ADD,		/* Cdev bound to the thermal zone */
741ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_CDEV_DELETE,		/* Cdev unbound */
751ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_CDEV_STATE_UPDATE,	/* Cdev state updated */
761ce50e7dSDaniel Lezcano 	THERMAL_GENL_EVENT_TZ_GOV_CHANGE,	/* Governor policy changed  */
77*e4b1eb24SSrinivas Pandruvada 	THERMAL_GENL_EVENT_CPU_CAPABILITY_CHANGE,	/* CPU capability changed */
781ce50e7dSDaniel Lezcano 	__THERMAL_GENL_EVENT_MAX,
791ce50e7dSDaniel Lezcano };
801ce50e7dSDaniel Lezcano #define THERMAL_GENL_EVENT_MAX (__THERMAL_GENL_EVENT_MAX - 1)
811ce50e7dSDaniel Lezcano 
821ce50e7dSDaniel Lezcano /* Commands supported by the thermal_genl_family */
831ce50e7dSDaniel Lezcano enum thermal_genl_cmd {
84af6c9f16SFlorian Fainelli 	THERMAL_GENL_CMD_UNSPEC,
851ce50e7dSDaniel Lezcano 	THERMAL_GENL_CMD_TZ_GET_ID,	/* List of thermal zones id */
861ce50e7dSDaniel Lezcano 	THERMAL_GENL_CMD_TZ_GET_TRIP,	/* List of thermal trips */
871ce50e7dSDaniel Lezcano 	THERMAL_GENL_CMD_TZ_GET_TEMP,	/* Get the thermal zone temperature */
881ce50e7dSDaniel Lezcano 	THERMAL_GENL_CMD_TZ_GET_GOV,	/* Get the thermal zone governor */
891ce50e7dSDaniel Lezcano 	THERMAL_GENL_CMD_TZ_GET_MODE,	/* Get the thermal zone mode */
901ce50e7dSDaniel Lezcano 	THERMAL_GENL_CMD_CDEV_GET,	/* List of cdev id */
91af6c9f16SFlorian Fainelli 	__THERMAL_GENL_CMD_MAX,
92af6c9f16SFlorian Fainelli };
93af6c9f16SFlorian Fainelli #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
94af6c9f16SFlorian Fainelli 
95af6c9f16SFlorian Fainelli #endif /* _UAPI_LINUX_THERMAL_H */
96