History

thermal: Move internal IPA functions

The exported IPA functions are used by the IPA. It is pointless to declare the functions in the thermal.h file. For better self-encapsulation and less impact for the compilation if a change is made on it. Move the code in the thermal core internal header file. As the users depends on THERMAL then it is pointless to have the stub, remove them. Take also the opportunity to fix checkpatch warnings/errors when moving the code around.

Daniel Lezcano committed 6 years ago

Commit 33a88af1 parent c68df442 files · +13 −24Browse files

Unified · Split

2 files
  1. drivers/thermal/thermal_core.h +13 −0
  2. include/linux/thermal.h +0 −24
drivers/thermal/thermal_core.h+13−0
@@ -46,6 +46,19 @@ struct thermal_attr { · 45 unmodified lines
46 char name[THERMAL_NAME_LENGTH];46 char name[THERMAL_NAME_LENGTH];
47};47};
48 48
49static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
50{
51 return cdev->ops->get_requested_power && cdev->ops->state2power &&
52 cdev->ops->power2state;
53}
54
55int power_actor_get_max_power(struct thermal_cooling_device *cdev,
56 struct thermal_zone_device *tz, u32 *max_power);
57int power_actor_get_min_power(struct thermal_cooling_device *cdev,
58 struct thermal_zone_device *tz, u32 *min_power);
59int power_actor_set_power(struct thermal_cooling_device *cdev,
60 struct thermal_instance *ti, u32 power);
61
49/*62/*
50 * This structure is used to describe the behavior of63 * This structure is used to describe the behavior of
51 * a certain cooling device on a certain trip point64 * a certain cooling device on a certain trip point
include/linux/thermal.h+0−24
@@ -399,18 +399,6 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev, · 398 unmodified lines
399#endif399#endif
400 400
401#if IS_ENABLED(CONFIG_THERMAL)401#if IS_ENABLED(CONFIG_THERMAL)
402static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
403{
404 return cdev->ops->get_requested_power && cdev->ops->state2power &&
405 cdev->ops->power2state;
406}
407
408int power_actor_get_max_power(struct thermal_cooling_device *,
409 struct thermal_zone_device *tz, u32 *max_power);
410int power_actor_get_min_power(struct thermal_cooling_device *,
411 struct thermal_zone_device *tz, u32 *min_power);
412int power_actor_set_power(struct thermal_cooling_device *,
413 struct thermal_instance *, u32);
414struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,402struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
415 void *, struct thermal_zone_device_ops *,403 void *, struct thermal_zone_device_ops *,
416 struct thermal_zone_params *, int, int);404 struct thermal_zone_params *, int, int);
@@ -447,18 +435,6 @@ struct thermal_instance *get_thermal_instance(struct thermal_zone_device *, · 30 unmodified lines
447void thermal_cdev_update(struct thermal_cooling_device *);435void thermal_cdev_update(struct thermal_cooling_device *);
448void thermal_notify_framework(struct thermal_zone_device *, int);436void thermal_notify_framework(struct thermal_zone_device *, int);
449#else437#else
450static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
451{ return false; }
452static inline int power_actor_get_max_power(struct thermal_cooling_device *cdev,
453 struct thermal_zone_device *tz, u32 *max_power)
454{ return 0; }
455static inline int power_actor_get_min_power(struct thermal_cooling_device *cdev,
456 struct thermal_zone_device *tz,
457 u32 *min_power)
458{ return -ENODEV; }
459static inline int power_actor_set_power(struct thermal_cooling_device *cdev,
460 struct thermal_instance *tz, u32 power)
461{ return 0; }
462static inline struct thermal_zone_device *thermal_zone_device_register(438static inline struct thermal_zone_device *thermal_zone_device_register(
463 const char *type, int trips, int mask, void *devdata,439 const char *type, int trips, int mask, void *devdata,
464 struct thermal_zone_device_ops *ops,440 struct thermal_zone_device_ops *ops,