Merge branches 'thermal-core-fix', 'thermal-soc' and 'thermal-int340x' into next
This commit is contained in:
65
include/linux/clock_cooling.h
Normal file
65
include/linux/clock_cooling.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* linux/include/linux/clock_cooling.h
|
||||
*
|
||||
* Copyright (C) 2014 Eduardo Valentin <edubezval@gmail.com>
|
||||
*
|
||||
* Copyright (C) 2013 Texas Instruments Inc.
|
||||
* Contact: Eduardo Valentin <eduardo.valentin@ti.com>
|
||||
*
|
||||
* Highly based on cpu_cooling.c.
|
||||
* Copyright (C) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
|
||||
* Copyright (C) 2012 Amit Daniel <amit.kachhap@linaro.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef __CPU_COOLING_H__
|
||||
#define __CPU_COOLING_H__
|
||||
|
||||
#include <linux/of.h>
|
||||
#include <linux/thermal.h>
|
||||
#include <linux/cpumask.h>
|
||||
|
||||
#ifdef CONFIG_CLOCK_THERMAL
|
||||
/**
|
||||
* clock_cooling_register - function to create clock cooling device.
|
||||
* @dev: struct device pointer to the device used as clock cooling device.
|
||||
* @clock_name: string containing the clock used as cooling mechanism.
|
||||
*/
|
||||
struct thermal_cooling_device *
|
||||
clock_cooling_register(struct device *dev, const char *clock_name);
|
||||
|
||||
/**
|
||||
* clock_cooling_unregister - function to remove clock cooling device.
|
||||
* @cdev: thermal cooling device pointer.
|
||||
*/
|
||||
void clock_cooling_unregister(struct thermal_cooling_device *cdev);
|
||||
|
||||
unsigned long clock_cooling_get_level(struct thermal_cooling_device *cdev,
|
||||
unsigned long freq);
|
||||
#else /* !CONFIG_CLOCK_THERMAL */
|
||||
static inline struct thermal_cooling_device *
|
||||
clock_cooling_register(struct device *dev, const char *clock_name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline
|
||||
void clock_cooling_unregister(struct thermal_cooling_device *cdev)
|
||||
{
|
||||
}
|
||||
static inline
|
||||
unsigned long clock_cooling_get_level(struct thermal_cooling_device *cdev,
|
||||
unsigned long freq)
|
||||
{
|
||||
return THERMAL_CSTATE_INVALID;
|
||||
}
|
||||
#endif /* CONFIG_CLOCK_THERMAL */
|
||||
|
||||
#endif /* __CPU_COOLING_H__ */
|
@@ -260,19 +260,49 @@ struct thermal_genl_event {
|
||||
enum events event;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct thermal_zone_of_device_ops - scallbacks for handling DT based zones
|
||||
*
|
||||
* Mandatory:
|
||||
* @get_temp: a pointer to a function that reads the sensor temperature.
|
||||
*
|
||||
* Optional:
|
||||
* @get_trend: a pointer to a function that reads the sensor temperature trend.
|
||||
* @set_emul_temp: a pointer to a function that sets sensor emulated
|
||||
* temperature.
|
||||
*/
|
||||
struct thermal_zone_of_device_ops {
|
||||
int (*get_temp)(void *, long *);
|
||||
int (*get_trend)(void *, long *);
|
||||
int (*set_emul_temp)(void *, unsigned long);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct thermal_trip - representation of a point in temperature domain
|
||||
* @np: pointer to struct device_node that this trip point was created from
|
||||
* @temperature: temperature value in miliCelsius
|
||||
* @hysteresis: relative hysteresis in miliCelsius
|
||||
* @type: trip point type
|
||||
*/
|
||||
|
||||
struct thermal_trip {
|
||||
struct device_node *np;
|
||||
unsigned long int temperature;
|
||||
unsigned long int hysteresis;
|
||||
enum thermal_trip_type type;
|
||||
};
|
||||
|
||||
/* Function declarations */
|
||||
#ifdef CONFIG_THERMAL_OF
|
||||
struct thermal_zone_device *
|
||||
thermal_zone_of_sensor_register(struct device *dev, int id,
|
||||
void *data, int (*get_temp)(void *, long *),
|
||||
int (*get_trend)(void *, long *));
|
||||
thermal_zone_of_sensor_register(struct device *dev, int id, void *data,
|
||||
const struct thermal_zone_of_device_ops *ops);
|
||||
void thermal_zone_of_sensor_unregister(struct device *dev,
|
||||
struct thermal_zone_device *tz);
|
||||
#else
|
||||
static inline struct thermal_zone_device *
|
||||
thermal_zone_of_sensor_register(struct device *dev, int id,
|
||||
void *data, int (*get_temp)(void *, long *),
|
||||
int (*get_trend)(void *, long *))
|
||||
thermal_zone_of_sensor_register(struct device *dev, int id, void *data,
|
||||
const struct thermal_zone_of_device_ops *ops)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user