LCOV - code coverage report
Current view: top level - include/linux - thermal.h (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 3 0.0 %
Date: 2022-03-28 13:20:08 Functions: 0 0 -
Branches: 0 24 0.0 %

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

Generated by: LCOV version 1.14