blob: b5cebf766e02e774f58435116d544471054bb465 [file] [log] [blame]
Thomas Gleixner8e8e69d2019-05-29 07:17:59 -07001/* SPDX-License-Identifier: GPL-2.0-only */
Eduardo Valentinf9df89d2014-01-06 09:04:18 -04002/*
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>
Eduardo Valentinf9df89d2014-01-06 09:04:18 -040013 */
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__ */