thermal.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * thermal.h ($Revision: 0 $)
  4. *
  5. * Copyright (C) 2008 Intel Corp
  6. * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com>
  7. * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com>
  8. */
  9. #ifndef __THERMAL_H__
  10. #define __THERMAL_H__
  11. #include <linux/of.h>
  12. #include <linux/idr.h>
  13. #include <linux/device.h>
  14. #include <linux/sysfs.h>
  15. #include <linux/workqueue.h>
  16. #include <uapi/linux/thermal.h>
  17. #define THERMAL_TRIPS_NONE -1
  18. #define THERMAL_MAX_TRIPS 12
  19. /* invalid cooling state */
  20. #define THERMAL_CSTATE_INVALID -1UL
  21. /* No upper/lower limit requirement */
  22. #define THERMAL_NO_LIMIT ((u32)~0)
  23. /* Default weight of a bound cooling device */
  24. #define THERMAL_WEIGHT_DEFAULT 0
  25. /* use value, which < 0K, to indicate an invalid/uninitialized temperature */
  26. #define THERMAL_TEMP_INVALID -274000
  27. /* Unit conversion macros */
  28. #define DECI_KELVIN_TO_CELSIUS(t) ({ \
  29. long _t = (t); \
  30. ((_t-2732 >= 0) ? (_t-2732+5)/10 : (_t-2732-5)/10); \
  31. })
  32. #define CELSIUS_TO_DECI_KELVIN(t) ((t)*10+2732)
  33. #define DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, off) (((t) - (off)) * 100)
  34. #define DECI_KELVIN_TO_MILLICELSIUS(t) DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, 2732)
  35. #define MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, off) (((t) / 100) + (off))
  36. #define MILLICELSIUS_TO_DECI_KELVIN(t) MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, 2732)
  37. /* Default Thermal Governor */
  38. #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE)
  39. #define DEFAULT_THERMAL_GOVERNOR "step_wise"
  40. #elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE)
  41. #define DEFAULT_THERMAL_GOVERNOR "fair_share"
  42. #elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE)
  43. #define DEFAULT_THERMAL_GOVERNOR "user_space"
  44. #elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR)
  45. #define DEFAULT_THERMAL_GOVERNOR "power_allocator"
  46. #endif
  47. struct thermal_zone_device;
  48. struct thermal_cooling_device;
  49. struct thermal_instance;
  50. enum thermal_device_mode {
  51. THERMAL_DEVICE_DISABLED = 0,
  52. THERMAL_DEVICE_ENABLED,
  53. };
  54. enum thermal_trip_type {
  55. THERMAL_TRIP_ACTIVE = 0,
  56. THERMAL_TRIP_PASSIVE,
  57. THERMAL_TRIP_HOT,
  58. THERMAL_TRIP_CRITICAL,
  59. };
  60. enum thermal_trend {
  61. THERMAL_TREND_STABLE, /* temperature is stable */
  62. THERMAL_TREND_RAISING, /* temperature is raising */
  63. THERMAL_TREND_DROPPING, /* temperature is dropping */
  64. THERMAL_TREND_RAISE_FULL, /* apply highest cooling action */
  65. THERMAL_TREND_DROP_FULL, /* apply lowest cooling action */
  66. };
  67. /* Thermal notification reason */
  68. enum thermal_notify_event {
  69. THERMAL_EVENT_UNSPECIFIED, /* Unspecified event */
  70. THERMAL_EVENT_TEMP_SAMPLE, /* New Temperature sample */
  71. THERMAL_TRIP_VIOLATED, /* TRIP Point violation */
  72. THERMAL_TRIP_CHANGED, /* TRIP Point temperature changed */
  73. THERMAL_DEVICE_DOWN, /* Thermal device is down */
  74. THERMAL_DEVICE_UP, /* Thermal device is up after a down event */
  75. THERMAL_DEVICE_POWER_CAPABILITY_CHANGED, /* power capability changed */
  76. THERMAL_TABLE_CHANGED, /* Thermal table(s) changed */
  77. };
  78. struct thermal_zone_device_ops {
  79. int (*bind) (struct thermal_zone_device *,
  80. struct thermal_cooling_device *);
  81. int (*unbind) (struct thermal_zone_device *,
  82. struct thermal_cooling_device *);
  83. int (*get_temp) (struct thermal_zone_device *, int *);
  84. int (*set_trips) (struct thermal_zone_device *, int, int);
  85. int (*get_mode) (struct thermal_zone_device *,
  86. enum thermal_device_mode *);
  87. int (*set_mode) (struct thermal_zone_device *,
  88. enum thermal_device_mode);
  89. int (*get_trip_type) (struct thermal_zone_device *, int,
  90. enum thermal_trip_type *);
  91. int (*get_trip_temp) (struct thermal_zone_device *, int, int *);
  92. int (*set_trip_temp) (struct thermal_zone_device *, int, int);
  93. int (*get_trip_hyst) (struct thermal_zone_device *, int, int *);
  94. int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
  95. int (*get_crit_temp) (struct thermal_zone_device *, int *);
  96. int (*set_emul_temp) (struct thermal_zone_device *, int);
  97. int (*get_trend) (struct thermal_zone_device *, int,
  98. enum thermal_trend *);
  99. int (*notify) (struct thermal_zone_device *, int,
  100. enum thermal_trip_type);
  101. };
  102. struct thermal_cooling_device_ops {
  103. int (*get_max_state) (struct thermal_cooling_device *, unsigned long *);
  104. int (*get_cur_state) (struct thermal_cooling_device *, unsigned long *);
  105. int (*set_cur_state) (struct thermal_cooling_device *, unsigned long);
  106. int (*get_requested_power)(struct thermal_cooling_device *,
  107. struct thermal_zone_device *, u32 *);
  108. int (*state2power)(struct thermal_cooling_device *,
  109. struct thermal_zone_device *, unsigned long, u32 *);
  110. int (*power2state)(struct thermal_cooling_device *,
  111. struct thermal_zone_device *, u32, unsigned long *);
  112. };
  113. struct thermal_cooling_device {
  114. int id;
  115. char type[THERMAL_NAME_LENGTH];
  116. struct device device;
  117. struct device_node *np;
  118. void *devdata;
  119. void *stats;
  120. const struct thermal_cooling_device_ops *ops;
  121. bool updated; /* true if the cooling device does not need update */
  122. struct mutex lock; /* protect thermal_instances list */
  123. struct list_head thermal_instances;
  124. struct list_head node;
  125. };
  126. struct thermal_attr {
  127. struct device_attribute attr;
  128. char name[THERMAL_NAME_LENGTH];
  129. };
  130. /**
  131. * struct thermal_zone_device - structure for a thermal zone
  132. * @id: unique id number for each thermal zone
  133. * @type: the thermal zone device type
  134. * @device: &struct device for this thermal zone
  135. * @trip_temp_attrs: attributes for trip points for sysfs: trip temperature
  136. * @trip_type_attrs: attributes for trip points for sysfs: trip type
  137. * @trip_hyst_attrs: attributes for trip points for sysfs: trip hysteresis
  138. * @devdata: private pointer for device private data
  139. * @trips: number of trip points the thermal zone supports
  140. * @trips_disabled; bitmap for disabled trips
  141. * @passive_delay: number of milliseconds to wait between polls when
  142. * performing passive cooling.
  143. * @polling_delay: number of milliseconds to wait between polls when
  144. * checking whether trip points have been crossed (0 for
  145. * interrupt driven systems)
  146. * @temperature: current temperature. This is only for core code,
  147. * drivers should use thermal_zone_get_temp() to get the
  148. * current temperature
  149. * @last_temperature: previous temperature read
  150. * @emul_temperature: emulated temperature when using CONFIG_THERMAL_EMULATION
  151. * @passive: 1 if you've crossed a passive trip point, 0 otherwise.
  152. * @prev_low_trip: the low current temperature if you've crossed a passive
  153. trip point.
  154. * @prev_high_trip: the above current temperature if you've crossed a
  155. passive trip point.
  156. * @forced_passive: If > 0, temperature at which to switch on all ACPI
  157. * processor cooling devices. Currently only used by the
  158. * step-wise governor.
  159. * @need_update: if equals 1, thermal_zone_device_update needs to be invoked.
  160. * @ops: operations this &thermal_zone_device supports
  161. * @tzp: thermal zone parameters
  162. * @governor: pointer to the governor for this thermal zone
  163. * @governor_data: private pointer for governor data
  164. * @thermal_instances: list of &struct thermal_instance of this thermal zone
  165. * @ida: &struct ida to generate unique id for this zone's cooling
  166. * devices
  167. * @lock: lock to protect thermal_instances list
  168. * @node: node in thermal_tz_list (in thermal_core.c)
  169. * @poll_queue: delayed work for polling
  170. * @notify_event: Last notification event
  171. */
  172. struct thermal_zone_device {
  173. int id;
  174. char type[THERMAL_NAME_LENGTH];
  175. struct device device;
  176. struct attribute_group trips_attribute_group;
  177. struct thermal_attr *trip_temp_attrs;
  178. struct thermal_attr *trip_type_attrs;
  179. struct thermal_attr *trip_hyst_attrs;
  180. void *devdata;
  181. int trips;
  182. unsigned long trips_disabled; /* bitmap for disabled trips */
  183. int passive_delay;
  184. int polling_delay;
  185. int temperature;
  186. int last_temperature;
  187. int emul_temperature;
  188. int passive;
  189. int prev_low_trip;
  190. int prev_high_trip;
  191. unsigned int forced_passive;
  192. atomic_t need_update;
  193. struct thermal_zone_device_ops *ops;
  194. struct thermal_zone_params *tzp;
  195. struct thermal_governor *governor;
  196. void *governor_data;
  197. struct list_head thermal_instances;
  198. struct ida ida;
  199. struct mutex lock;
  200. struct list_head node;
  201. struct delayed_work poll_queue;
  202. enum thermal_notify_event notify_event;
  203. };
  204. /**
  205. * struct thermal_governor - structure that holds thermal governor information
  206. * @name: name of the governor
  207. * @bind_to_tz: callback called when binding to a thermal zone. If it
  208. * returns 0, the governor is bound to the thermal zone,
  209. * otherwise it fails.
  210. * @unbind_from_tz: callback called when a governor is unbound from a
  211. * thermal zone.
  212. * @throttle: callback called for every trip point even if temperature is
  213. * below the trip point temperature
  214. * @governor_list: node in thermal_governor_list (in thermal_core.c)
  215. */
  216. struct thermal_governor {
  217. char name[THERMAL_NAME_LENGTH];
  218. int (*bind_to_tz)(struct thermal_zone_device *tz);
  219. void (*unbind_from_tz)(struct thermal_zone_device *tz);
  220. int (*throttle)(struct thermal_zone_device *tz, int trip);
  221. struct list_head governor_list;
  222. };
  223. /* Structure that holds binding parameters for a zone */
  224. struct thermal_bind_params {
  225. struct thermal_cooling_device *cdev;
  226. /*
  227. * This is a measure of 'how effectively these devices can
  228. * cool 'this' thermal zone. It shall be determined by
  229. * platform characterization. This value is relative to the
  230. * rest of the weights so a cooling device whose weight is
  231. * double that of another cooling device is twice as
  232. * effective. See Documentation/thermal/sysfs-api.txt for more
  233. * information.
  234. */
  235. int weight;
  236. /*
  237. * This is a bit mask that gives the binding relation between this
  238. * thermal zone and cdev, for a particular trip point.
  239. * See Documentation/thermal/sysfs-api.txt for more information.
  240. */
  241. int trip_mask;
  242. /*
  243. * This is an array of cooling state limits. Must have exactly
  244. * 2 * thermal_zone.number_of_trip_points. It is an array consisting
  245. * of tuples <lower-state upper-state> of state limits. Each trip
  246. * will be associated with one state limit tuple when binding.
  247. * A NULL pointer means <THERMAL_NO_LIMITS THERMAL_NO_LIMITS>
  248. * on all trips.
  249. */
  250. unsigned long *binding_limits;
  251. int (*match) (struct thermal_zone_device *tz,
  252. struct thermal_cooling_device *cdev);
  253. };
  254. /* Structure to define Thermal Zone parameters */
  255. struct thermal_zone_params {
  256. char governor_name[THERMAL_NAME_LENGTH];
  257. /*
  258. * a boolean to indicate if the thermal to hwmon sysfs interface
  259. * is required. when no_hwmon == false, a hwmon sysfs interface
  260. * will be created. when no_hwmon == true, nothing will be done
  261. */
  262. bool no_hwmon;
  263. int num_tbps; /* Number of tbp entries */
  264. struct thermal_bind_params *tbp;
  265. /*
  266. * Sustainable power (heat) that this thermal zone can dissipate in
  267. * mW
  268. */
  269. u32 sustainable_power;
  270. /*
  271. * Proportional parameter of the PID controller when
  272. * overshooting (i.e., when temperature is below the target)
  273. */
  274. s32 k_po;
  275. /*
  276. * Proportional parameter of the PID controller when
  277. * undershooting
  278. */
  279. s32 k_pu;
  280. /* Integral parameter of the PID controller */
  281. s32 k_i;
  282. /* Derivative parameter of the PID controller */
  283. s32 k_d;
  284. /* threshold below which the error is no longer accumulated */
  285. s32 integral_cutoff;
  286. /*
  287. * @slope: slope of a linear temperature adjustment curve.
  288. * Used by thermal zone drivers.
  289. */
  290. int slope;
  291. /*
  292. * @offset: offset of a linear temperature adjustment curve.
  293. * Used by thermal zone drivers (default 0).
  294. */
  295. int offset;
  296. };
  297. struct thermal_genl_event {
  298. u32 orig;
  299. enum events event;
  300. };
  301. /**
  302. * struct thermal_zone_of_device_ops - scallbacks for handling DT based zones
  303. *
  304. * Mandatory:
  305. * @get_temp: a pointer to a function that reads the sensor temperature.
  306. *
  307. * Optional:
  308. * @get_trend: a pointer to a function that reads the sensor temperature trend.
  309. * @set_trips: a pointer to a function that sets a temperature window. When
  310. * this window is left the driver must inform the thermal core via
  311. * thermal_zone_device_update.
  312. * @set_emul_temp: a pointer to a function that sets sensor emulated
  313. * temperature.
  314. * @set_trip_temp: a pointer to a function that sets the trip temperature on
  315. * hardware.
  316. */
  317. struct thermal_zone_of_device_ops {
  318. int (*get_temp)(void *, int *);
  319. int (*get_trend)(void *, int, enum thermal_trend *);
  320. int (*set_trips)(void *, int, int);
  321. int (*set_emul_temp)(void *, int);
  322. int (*set_trip_temp)(void *, int, int);
  323. };
  324. /**
  325. * struct thermal_trip - representation of a point in temperature domain
  326. * @np: pointer to struct device_node that this trip point was created from
  327. * @temperature: temperature value in miliCelsius
  328. * @hysteresis: relative hysteresis in miliCelsius
  329. * @type: trip point type
  330. */
  331. struct thermal_trip {
  332. struct device_node *np;
  333. int temperature;
  334. int hysteresis;
  335. enum thermal_trip_type type;
  336. };
  337. /* Function declarations */
  338. #ifdef CONFIG_THERMAL_OF
  339. struct thermal_zone_device *
  340. thermal_zone_of_sensor_register(struct device *dev, int id, void *data,
  341. const struct thermal_zone_of_device_ops *ops);
  342. void thermal_zone_of_sensor_unregister(struct device *dev,
  343. struct thermal_zone_device *tz);
  344. struct thermal_zone_device *devm_thermal_zone_of_sensor_register(
  345. struct device *dev, int id, void *data,
  346. const struct thermal_zone_of_device_ops *ops);
  347. void devm_thermal_zone_of_sensor_unregister(struct device *dev,
  348. struct thermal_zone_device *tz);
  349. #else
  350. static inline struct thermal_zone_device *
  351. thermal_zone_of_sensor_register(struct device *dev, int id, void *data,
  352. const struct thermal_zone_of_device_ops *ops)
  353. {
  354. return ERR_PTR(-ENODEV);
  355. }
  356. static inline
  357. void thermal_zone_of_sensor_unregister(struct device *dev,
  358. struct thermal_zone_device *tz)
  359. {
  360. }
  361. static inline struct thermal_zone_device *devm_thermal_zone_of_sensor_register(
  362. struct device *dev, int id, void *data,
  363. const struct thermal_zone_of_device_ops *ops)
  364. {
  365. return ERR_PTR(-ENODEV);
  366. }
  367. static inline
  368. void devm_thermal_zone_of_sensor_unregister(struct device *dev,
  369. struct thermal_zone_device *tz)
  370. {
  371. }
  372. #endif
  373. #if IS_ENABLED(CONFIG_THERMAL)
  374. static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
  375. {
  376. return cdev->ops->get_requested_power && cdev->ops->state2power &&
  377. cdev->ops->power2state;
  378. }
  379. int power_actor_get_max_power(struct thermal_cooling_device *,
  380. struct thermal_zone_device *tz, u32 *max_power);
  381. int power_actor_get_min_power(struct thermal_cooling_device *,
  382. struct thermal_zone_device *tz, u32 *min_power);
  383. int power_actor_set_power(struct thermal_cooling_device *,
  384. struct thermal_instance *, u32);
  385. struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
  386. void *, struct thermal_zone_device_ops *,
  387. struct thermal_zone_params *, int, int);
  388. void thermal_zone_device_unregister(struct thermal_zone_device *);
  389. int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
  390. struct thermal_cooling_device *,
  391. unsigned long, unsigned long,
  392. unsigned int);
  393. int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
  394. struct thermal_cooling_device *);
  395. void thermal_zone_device_update(struct thermal_zone_device *,
  396. enum thermal_notify_event);
  397. void thermal_zone_set_trips(struct thermal_zone_device *);
  398. struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
  399. const struct thermal_cooling_device_ops *);
  400. struct thermal_cooling_device *
  401. thermal_of_cooling_device_register(struct device_node *np, char *, void *,
  402. const struct thermal_cooling_device_ops *);
  403. void thermal_cooling_device_unregister(struct thermal_cooling_device *);
  404. struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
  405. int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
  406. int thermal_zone_get_slope(struct thermal_zone_device *tz);
  407. int thermal_zone_get_offset(struct thermal_zone_device *tz);
  408. int get_tz_trend(struct thermal_zone_device *, int);
  409. struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
  410. struct thermal_cooling_device *, int);
  411. void thermal_cdev_update(struct thermal_cooling_device *);
  412. void thermal_notify_framework(struct thermal_zone_device *, int);
  413. #else
  414. static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
  415. { return false; }
  416. static inline int power_actor_get_max_power(struct thermal_cooling_device *cdev,
  417. struct thermal_zone_device *tz, u32 *max_power)
  418. { return 0; }
  419. static inline int power_actor_get_min_power(struct thermal_cooling_device *cdev,
  420. struct thermal_zone_device *tz,
  421. u32 *min_power)
  422. { return -ENODEV; }
  423. static inline int power_actor_set_power(struct thermal_cooling_device *cdev,
  424. struct thermal_instance *tz, u32 power)
  425. { return 0; }
  426. static inline struct thermal_zone_device *thermal_zone_device_register(
  427. const char *type, int trips, int mask, void *devdata,
  428. struct thermal_zone_device_ops *ops,
  429. struct thermal_zone_params *tzp,
  430. int passive_delay, int polling_delay)
  431. { return ERR_PTR(-ENODEV); }
  432. static inline void thermal_zone_device_unregister(
  433. struct thermal_zone_device *tz)
  434. { }
  435. static inline int thermal_zone_bind_cooling_device(
  436. struct thermal_zone_device *tz, int trip,
  437. struct thermal_cooling_device *cdev,
  438. unsigned long upper, unsigned long lower,
  439. unsigned int weight)
  440. { return -ENODEV; }
  441. static inline int thermal_zone_unbind_cooling_device(
  442. struct thermal_zone_device *tz, int trip,
  443. struct thermal_cooling_device *cdev)
  444. { return -ENODEV; }
  445. static inline void thermal_zone_device_update(struct thermal_zone_device *tz,
  446. enum thermal_notify_event event)
  447. { }
  448. static inline void thermal_zone_set_trips(struct thermal_zone_device *tz)
  449. { }
  450. static inline struct thermal_cooling_device *
  451. thermal_cooling_device_register(char *type, void *devdata,
  452. const struct thermal_cooling_device_ops *ops)
  453. { return ERR_PTR(-ENODEV); }
  454. static inline struct thermal_cooling_device *
  455. thermal_of_cooling_device_register(struct device_node *np,
  456. char *type, void *devdata, const struct thermal_cooling_device_ops *ops)
  457. { return ERR_PTR(-ENODEV); }
  458. static inline void thermal_cooling_device_unregister(
  459. struct thermal_cooling_device *cdev)
  460. { }
  461. static inline struct thermal_zone_device *thermal_zone_get_zone_by_name(
  462. const char *name)
  463. { return ERR_PTR(-ENODEV); }
  464. static inline int thermal_zone_get_temp(
  465. struct thermal_zone_device *tz, int *temp)
  466. { return -ENODEV; }
  467. static inline int thermal_zone_get_slope(
  468. struct thermal_zone_device *tz)
  469. { return -ENODEV; }
  470. static inline int thermal_zone_get_offset(
  471. struct thermal_zone_device *tz)
  472. { return -ENODEV; }
  473. static inline int get_tz_trend(struct thermal_zone_device *tz, int trip)
  474. { return -ENODEV; }
  475. static inline struct thermal_instance *
  476. get_thermal_instance(struct thermal_zone_device *tz,
  477. struct thermal_cooling_device *cdev, int trip)
  478. { return ERR_PTR(-ENODEV); }
  479. static inline void thermal_cdev_update(struct thermal_cooling_device *cdev)
  480. { }
  481. static inline void thermal_notify_framework(struct thermal_zone_device *tz,
  482. int trip)
  483. { }
  484. #endif /* CONFIG_THERMAL */
  485. #if defined(CONFIG_NET) && IS_ENABLED(CONFIG_THERMAL)
  486. extern int thermal_generate_netlink_event(struct thermal_zone_device *tz,
  487. enum events event);
  488. #else
  489. static inline int thermal_generate_netlink_event(struct thermal_zone_device *tz,
  490. enum events event)
  491. {
  492. return 0;
  493. }
  494. #endif
  495. #endif /* __THERMAL_H__ */