linux/include/linux/clock_cooling.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0-only */
   2/*
   3 *  linux/include/linux/clock_cooling.h
   4 *
   5 *  Copyright (C) 2014 Eduardo Valentin <edubezval@gmail.com>
   6 *
   7 *  Copyright (C) 2013  Texas Instruments Inc.
   8 *  Contact:  Eduardo Valentin <eduardo.valentin@ti.com>
   9 *
  10 *  Highly based on cpu_cooling.c.
  11 *  Copyright (C) 2012  Samsung Electronics Co., Ltd(http://www.samsung.com)
  12 *  Copyright (C) 2012  Amit Daniel <amit.kachhap@linaro.org>
  13 */
  14
  15#ifndef __CPU_COOLING_H__
  16#define __CPU_COOLING_H__
  17
  18#include <linux/of.h>
  19#include <linux/thermal.h>
  20#include <linux/cpumask.h>
  21
  22#ifdef CONFIG_CLOCK_THERMAL
  23/**
  24 * clock_cooling_register - function to create clock cooling device.
  25 * @dev: struct device pointer to the device used as clock cooling device.
  26 * @clock_name: string containing the clock used as cooling mechanism.
  27 */
  28struct thermal_cooling_device *
  29clock_cooling_register(struct device *dev, const char *clock_name);
  30
  31/**
  32 * clock_cooling_unregister - function to remove clock cooling device.
  33 * @cdev: thermal cooling device pointer.
  34 */
  35void clock_cooling_unregister(struct thermal_cooling_device *cdev);
  36
  37unsigned long clock_cooling_get_level(struct thermal_cooling_device *cdev,
  38                                      unsigned long freq);
  39#else /* !CONFIG_CLOCK_THERMAL */
  40static inline struct thermal_cooling_device *
  41clock_cooling_register(struct device *dev, const char *clock_name)
  42{
  43        return NULL;
  44}
  45static inline
  46void clock_cooling_unregister(struct thermal_cooling_device *cdev)
  47{
  48}
  49static inline
  50unsigned long clock_cooling_get_level(struct thermal_cooling_device *cdev,
  51                                      unsigned long freq)
  52{
  53        return THERMAL_CSTATE_INVALID;
  54}
  55#endif  /* CONFIG_CLOCK_THERMAL */
  56
  57#endif /* __CPU_COOLING_H__ */
  58