thermal.h 19 KB

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