2012-05-25 23:36:07 +00:00
|
|
|
/*
|
2016-02-03 10:53:58 +00:00
|
|
|
* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
|
2012-05-25 23:36:07 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
|
|
* only version 2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* 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 __MSM_THERMAL_H
|
|
|
|
#define __MSM_THERMAL_H
|
|
|
|
|
2015-01-22 13:07:46 +00:00
|
|
|
#include <linux/thermal.h>
|
|
|
|
|
|
|
|
#define MAX_THRESHOLD 2
|
|
|
|
#define TSENS_NAME_MAX 20
|
|
|
|
#define MONITOR_ALL_TSENS -1
|
msm: thermal: Add support for device manager in KTM
Add support for device manager framework to KTM. Device manager allows
for aggregation of muliple kernel clients request on mitigation
devices. Clients can set and register for device change notifications.
Currently it supports hotplug device and cpuX (X= 0... NR_CPUS - 1)
devices.
Device manager framework exports below 3 APIs for a device for
clients to use.
1. struct device_clnt_data *devmgr_register_mitigation_client(
struct device *dev,
const char *device_name,
void (*callback)(struct device_clnt_data *,
union device_request *, void *))
API to register mitigation device. This API returns handle, which
should be used by clients when placing mitigation request.
It supports to register for device change notification with callback
as an optional parameter to client.
@dev: Client device structure.
@device_name: Mitgation device name which the client is interested
to mitigate.
@callback: Optional callback pointer for device change notification,
otherwise pass NULL.
Returns client handle structure for that device on success, or NULL
with IS_ERR() condition containing error number.
2. int devmgr_client_request_mitigation(struct device_clnt_data *clnt,
enum device_req_type type,
union device_request *req);
API for clients to set valid mitigation for a registered device.
@clnt: Client handle for device.
@type: Type of device request populated above.
@req: Valid mitigation request.
Returns zero on successful mitigation update or
negative error number.
3. void devmgr_unregister_mitigation_client(
struct device *dev,
struct device_clnt_data *clnt)
API for clients to unregister for a device whenever it is done with
device.
@dev: Client device structure.
@clnt: Client handle for device.
Change-Id: Ieda99577a035a32b745df6b004b5487a55ec70ac
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2015-01-27 20:38:22 +00:00
|
|
|
#define HOTPLUG_DEVICE "hotplug"
|
|
|
|
#define CPU0_DEVICE "cpu0"
|
|
|
|
#define CPU1_DEVICE "cpu1"
|
|
|
|
#define CPU2_DEVICE "cpu2"
|
|
|
|
#define CPU3_DEVICE "cpu3"
|
|
|
|
#define CPU4_DEVICE "cpu4"
|
|
|
|
#define CPU5_DEVICE "cpu5"
|
|
|
|
#define CPU6_DEVICE "cpu6"
|
|
|
|
#define CPU7_DEVICE "cpu7"
|
|
|
|
#define CPUFREQ_MAX_NO_MITIGATION UINT_MAX
|
|
|
|
#define CPUFREQ_MIN_NO_MITIGATION 0
|
|
|
|
#define HOTPLUG_NO_MITIGATION(_mask) cpumask_clear(_mask)
|
2015-01-22 13:07:46 +00:00
|
|
|
|
|
|
|
#define IS_HI_THRESHOLD_SET(_val) (_val & 1)
|
|
|
|
#define IS_LOW_THRESHOLD_SET(_val) (_val & 2)
|
|
|
|
|
2012-05-25 23:36:07 +00:00
|
|
|
struct msm_thermal_data {
|
2014-01-30 14:03:56 +00:00
|
|
|
struct platform_device *pdev;
|
2012-05-25 23:36:07 +00:00
|
|
|
uint32_t sensor_id;
|
|
|
|
uint32_t poll_ms;
|
2013-02-21 00:42:17 +00:00
|
|
|
int32_t limit_temp_degC;
|
|
|
|
int32_t temp_hysteresis_degC;
|
2013-09-24 18:25:59 +00:00
|
|
|
uint32_t bootup_freq_step;
|
|
|
|
uint32_t bootup_freq_control_mask;
|
2013-02-21 00:42:17 +00:00
|
|
|
int32_t core_limit_temp_degC;
|
|
|
|
int32_t core_temp_hysteresis_degC;
|
2013-07-30 22:25:46 +00:00
|
|
|
int32_t hotplug_temp_degC;
|
|
|
|
int32_t hotplug_temp_hysteresis_degC;
|
2013-02-21 00:42:17 +00:00
|
|
|
uint32_t core_control_mask;
|
2013-09-24 18:25:59 +00:00
|
|
|
uint32_t freq_mitig_temp_degc;
|
|
|
|
uint32_t freq_mitig_temp_hysteresis_degc;
|
|
|
|
uint32_t freq_mitig_control_mask;
|
|
|
|
uint32_t freq_limit;
|
msm: thermal: Add VDD restriction for low temperature conditions
Restrict voltage for key MSM rails when the temperature falls below
the specified low temperature value. Increasing rail voltage is
necessary for timing closure at lower temperatures. MSMs are generally
characterized for nominal temperatures and to prevent failures in extreme
low temperature conditions, increase the voltage of the rails.
During boot, a polling thread will check the temperature for all temp
sensors, as long as one sensor is below threshold, vdd restriction will
be enabled. If all temp sensors are above threshold hysteresis, vdd
restriction will be disabled.
New device nodes were added as below:
sys/module/msm_thermal/vdd_restriction/enabled
/vdd_dig/level
/value
When enabled is set to 1, it will set the vdd restriction for all
regulators to level 0 by default. vdd_dig represents the key MSM rail
name which is defined in device tree. level can be read or write
while value is read only.
When enabled is set to 0, it will relax the vdd restriction by setting
regulators to the min level defined in device tree. level will return
-1, and value will also return -1.
When regulator failed to get a handle from pmic, level will return -2
, and value will also return -2.
Change-Id: I81caa152b75fc49dbac51ec98c5a51933eedcc69
Signed-off-by: Jennifer Liu <chihning@codeaurora.org>
2013-04-05 22:26:33 +00:00
|
|
|
int32_t vdd_rstr_temp_degC;
|
|
|
|
int32_t vdd_rstr_temp_hyst_degC;
|
2013-12-11 21:20:58 +00:00
|
|
|
int32_t vdd_mx_min;
|
2013-03-26 18:18:00 +00:00
|
|
|
int32_t psm_temp_degC;
|
|
|
|
int32_t psm_temp_hyst_degC;
|
2014-01-30 14:03:56 +00:00
|
|
|
int32_t ocr_temp_degC;
|
|
|
|
int32_t ocr_temp_hyst_degC;
|
|
|
|
uint32_t ocr_sensor_id;
|
2013-12-20 22:16:12 +00:00
|
|
|
int32_t phase_rpm_resource_type;
|
|
|
|
int32_t phase_rpm_resource_id;
|
|
|
|
int32_t gfx_phase_warm_temp_degC;
|
|
|
|
int32_t gfx_phase_warm_temp_hyst_degC;
|
|
|
|
int32_t gfx_phase_hot_temp_degC;
|
|
|
|
int32_t gfx_phase_hot_temp_hyst_degC;
|
|
|
|
int32_t gfx_sensor;
|
|
|
|
int32_t gfx_phase_request_key;
|
|
|
|
int32_t cx_phase_hot_temp_degC;
|
|
|
|
int32_t cx_phase_hot_temp_hyst_degC;
|
|
|
|
int32_t cx_phase_request_key;
|
2013-12-11 21:20:58 +00:00
|
|
|
int32_t vdd_mx_temp_degC;
|
|
|
|
int32_t vdd_mx_temp_hyst_degC;
|
2016-01-28 17:39:30 +00:00
|
|
|
int32_t vdd_mx_sensor_id;
|
2014-01-31 22:59:58 +00:00
|
|
|
int32_t therm_reset_temp_degC;
|
2012-05-25 23:36:07 +00:00
|
|
|
};
|
|
|
|
|
2015-01-22 13:07:46 +00:00
|
|
|
enum sensor_id_type {
|
|
|
|
THERM_ZONE_ID,
|
|
|
|
THERM_TSENS_ID,
|
|
|
|
THERM_ID_MAX_NR,
|
|
|
|
};
|
|
|
|
|
2014-06-04 22:41:08 +00:00
|
|
|
enum msm_therm_progressive_state {
|
|
|
|
MSM_THERM_PROGRESSIVE_SAMPLING,
|
|
|
|
MSM_THERM_PROGRESSIVE_PAUSED,
|
|
|
|
MSM_THERM_PROGRESSIVE_MONITOR,
|
|
|
|
MSM_THERM_PROGRESSIVE_NR,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum msm_therm_monitor_type {
|
|
|
|
MSM_THERM_MONITOR,
|
|
|
|
MSM_THERM_PROGRESSIVE,
|
|
|
|
MSM_THERM_NR,
|
|
|
|
};
|
|
|
|
|
2015-01-22 13:07:46 +00:00
|
|
|
struct threshold_info;
|
|
|
|
struct therm_threshold {
|
2014-06-04 22:41:08 +00:00
|
|
|
int32_t sensor_id;
|
|
|
|
enum sensor_id_type id_type;
|
|
|
|
struct sensor_threshold threshold[MAX_THRESHOLD];
|
|
|
|
int32_t trip_triggered;
|
2015-01-22 13:07:46 +00:00
|
|
|
void (*notify)(struct therm_threshold *);
|
2014-06-04 22:41:08 +00:00
|
|
|
struct threshold_info *parent;
|
|
|
|
enum msm_therm_progressive_state prog_state;
|
|
|
|
bool prog_trip_clear;
|
2016-02-03 10:53:58 +00:00
|
|
|
int32_t cur_state;
|
2015-01-22 13:07:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct threshold_info {
|
2014-06-04 22:41:08 +00:00
|
|
|
uint32_t thresh_ct;
|
|
|
|
bool thresh_triggered;
|
|
|
|
struct list_head list_ptr;
|
|
|
|
enum msm_therm_monitor_type algo_type;
|
|
|
|
struct mutex lock;
|
|
|
|
long curr_max_temp;
|
|
|
|
struct therm_threshold *thresh_list;
|
2015-01-22 13:07:46 +00:00
|
|
|
};
|
|
|
|
|
msm: thermal: Add support for device manager in KTM
Add support for device manager framework to KTM. Device manager allows
for aggregation of muliple kernel clients request on mitigation
devices. Clients can set and register for device change notifications.
Currently it supports hotplug device and cpuX (X= 0... NR_CPUS - 1)
devices.
Device manager framework exports below 3 APIs for a device for
clients to use.
1. struct device_clnt_data *devmgr_register_mitigation_client(
struct device *dev,
const char *device_name,
void (*callback)(struct device_clnt_data *,
union device_request *, void *))
API to register mitigation device. This API returns handle, which
should be used by clients when placing mitigation request.
It supports to register for device change notification with callback
as an optional parameter to client.
@dev: Client device structure.
@device_name: Mitgation device name which the client is interested
to mitigate.
@callback: Optional callback pointer for device change notification,
otherwise pass NULL.
Returns client handle structure for that device on success, or NULL
with IS_ERR() condition containing error number.
2. int devmgr_client_request_mitigation(struct device_clnt_data *clnt,
enum device_req_type type,
union device_request *req);
API for clients to set valid mitigation for a registered device.
@clnt: Client handle for device.
@type: Type of device request populated above.
@req: Valid mitigation request.
Returns zero on successful mitigation update or
negative error number.
3. void devmgr_unregister_mitigation_client(
struct device *dev,
struct device_clnt_data *clnt)
API for clients to unregister for a device whenever it is done with
device.
@dev: Client device structure.
@clnt: Client handle for device.
Change-Id: Ieda99577a035a32b745df6b004b5487a55ec70ac
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2015-01-27 20:38:22 +00:00
|
|
|
enum device_req_type {
|
|
|
|
DEVICE_REQ_NONE = -1,
|
|
|
|
HOTPLUG_MITIGATION_REQ,
|
|
|
|
CPUFREQ_MITIGATION_REQ,
|
|
|
|
DEVICE_REQ_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* For frequency mitigation request, if client is interested
|
|
|
|
* only in one, either max_freq or min_freq, update default
|
|
|
|
* value for other one also for mitigation request.
|
|
|
|
* Default value for request structure variables:
|
|
|
|
* max_freq = UINT_MAX;
|
|
|
|
* min_freq = 0;
|
|
|
|
* offline_mask = CPU_MASK_NONE;
|
|
|
|
*/
|
|
|
|
struct cpufreq_request {
|
|
|
|
uint32_t max_freq;
|
|
|
|
uint32_t min_freq;
|
|
|
|
};
|
|
|
|
|
|
|
|
union device_request {
|
|
|
|
struct cpufreq_request freq;
|
|
|
|
cpumask_t offline_mask;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct device_clnt_data;
|
|
|
|
struct device_manager_data {
|
|
|
|
char device_name[TSENS_NAME_MAX];
|
|
|
|
union device_request active_req;
|
|
|
|
struct list_head client_list;
|
|
|
|
struct list_head dev_ptr;
|
|
|
|
struct mutex clnt_lock;
|
|
|
|
int (*request_validate)(struct device_clnt_data *,
|
|
|
|
union device_request *,
|
|
|
|
enum device_req_type);
|
|
|
|
int (*update)(struct device_manager_data *);
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct device_clnt_data {
|
|
|
|
struct device_manager_data *dev_mgr;
|
|
|
|
bool req_active;
|
|
|
|
union device_request request;
|
|
|
|
struct list_head clnt_ptr;
|
|
|
|
void (*callback)(struct device_clnt_data *,
|
|
|
|
union device_request *req, void *);
|
|
|
|
void *usr_data;
|
|
|
|
};
|
|
|
|
|
2017-04-18 01:29:57 +00:00
|
|
|
extern void sec_debug_set_thermal_upload(void);
|
2012-05-25 23:36:07 +00:00
|
|
|
#ifdef CONFIG_THERMAL_MONITOR
|
|
|
|
extern int msm_thermal_init(struct msm_thermal_data *pdata);
|
2012-07-03 01:28:50 +00:00
|
|
|
extern int msm_thermal_device_init(void);
|
2013-09-24 18:36:50 +00:00
|
|
|
extern int msm_thermal_set_frequency(uint32_t cpu, uint32_t freq,
|
|
|
|
bool is_max);
|
2014-05-05 23:18:21 +00:00
|
|
|
extern int msm_thermal_set_cluster_freq(uint32_t cluster, uint32_t freq,
|
|
|
|
bool is_max);
|
|
|
|
extern int msm_thermal_get_freq_plan_size(uint32_t cluster,
|
|
|
|
unsigned int *table_len);
|
|
|
|
extern int msm_thermal_get_cluster_freq_plan(uint32_t cluster,
|
|
|
|
unsigned int *table_ptr);
|
2014-10-24 00:53:52 +00:00
|
|
|
extern int msm_thermal_get_cluster_voltage_plan(uint32_t cluster,
|
|
|
|
uint32_t *table_ptr);
|
2015-01-22 13:07:46 +00:00
|
|
|
/**
|
|
|
|
* sensor_mgr_init_threshold - Initialize thresholds data structure for
|
|
|
|
* sensor(s) with high and low thresholds and
|
|
|
|
* threshold callback.
|
|
|
|
*
|
2015-02-13 16:11:42 +00:00
|
|
|
* @dev: Client device structure.
|
2015-01-22 13:07:46 +00:00
|
|
|
* @thresh_inp: Client threshold data structure.
|
|
|
|
* @sensor_id: Sensor h/w ID to be monitored. Use MONITOR_ALL_TSENS
|
|
|
|
* to monitor all temperature sensors.
|
|
|
|
*
|
|
|
|
* @high_temp: Trigger threshold value for sensor_id or all sensors.
|
|
|
|
* @low_temp: Clear threshold value for sensor_id or all sensors.
|
|
|
|
* @callback: Callback pointer for threshold notification.
|
|
|
|
*
|
|
|
|
* Returns which threshold is set on success, negative error number
|
|
|
|
* on failure. MACRO IS_HI_THRESHOLD_SET/IS_LOW_THRESHOLD_SET can be used
|
|
|
|
* to decipher which threshold being set.
|
|
|
|
*/
|
2015-02-13 16:11:42 +00:00
|
|
|
extern int sensor_mgr_init_threshold(struct device *dev,
|
|
|
|
struct threshold_info *thresh_inp,
|
2015-01-22 13:07:46 +00:00
|
|
|
int sensor_id, int32_t high_temp,
|
|
|
|
int32_t low_temp,
|
|
|
|
void (*callback)(struct therm_threshold *));
|
|
|
|
/**
|
|
|
|
* sensor_mgr_convert_id_and_set_threshold - It accepts sensor h/w ID, converts
|
|
|
|
* it to sensor zone id and sets
|
|
|
|
* thermal threshold for those
|
|
|
|
* sensors listed in threshold info.
|
|
|
|
*
|
|
|
|
* @thresh_inp: Client threshold data structure.
|
|
|
|
*
|
|
|
|
* Returns zero on success, negative error number on failure.
|
|
|
|
*/
|
|
|
|
extern int sensor_mgr_convert_id_and_set_threshold(
|
|
|
|
struct threshold_info *thresh_inp);
|
|
|
|
/**
|
|
|
|
* sensor_mgr_set_threshold- It sets thermal threshold trips for a sensor.
|
|
|
|
*
|
|
|
|
* @zone_id: Thermal zone ID for the sensor.
|
|
|
|
* @threshold: threshold info for the sensor.
|
|
|
|
*
|
|
|
|
* Returns zero on success, negative error number on failure.
|
|
|
|
*/
|
|
|
|
extern int sensor_mgr_set_threshold(uint32_t zone_id,
|
|
|
|
struct sensor_threshold *threshold);
|
|
|
|
/**
|
|
|
|
* sensor_mgr_remove_threshold- It cancels threshold notification and
|
|
|
|
* removes threshold from sensor manager
|
|
|
|
* threshold list.
|
|
|
|
*
|
2015-02-13 16:11:42 +00:00
|
|
|
* @dev: Client device structure.
|
2015-01-22 13:07:46 +00:00
|
|
|
* @thresh_inp: The threshold info which needs to be removed.
|
|
|
|
*/
|
2015-02-13 16:11:42 +00:00
|
|
|
extern void sensor_mgr_remove_threshold(struct device *dev,
|
|
|
|
struct threshold_info *thresh_inp);
|
msm: thermal: Add support for device manager in KTM
Add support for device manager framework to KTM. Device manager allows
for aggregation of muliple kernel clients request on mitigation
devices. Clients can set and register for device change notifications.
Currently it supports hotplug device and cpuX (X= 0... NR_CPUS - 1)
devices.
Device manager framework exports below 3 APIs for a device for
clients to use.
1. struct device_clnt_data *devmgr_register_mitigation_client(
struct device *dev,
const char *device_name,
void (*callback)(struct device_clnt_data *,
union device_request *, void *))
API to register mitigation device. This API returns handle, which
should be used by clients when placing mitigation request.
It supports to register for device change notification with callback
as an optional parameter to client.
@dev: Client device structure.
@device_name: Mitgation device name which the client is interested
to mitigate.
@callback: Optional callback pointer for device change notification,
otherwise pass NULL.
Returns client handle structure for that device on success, or NULL
with IS_ERR() condition containing error number.
2. int devmgr_client_request_mitigation(struct device_clnt_data *clnt,
enum device_req_type type,
union device_request *req);
API for clients to set valid mitigation for a registered device.
@clnt: Client handle for device.
@type: Type of device request populated above.
@req: Valid mitigation request.
Returns zero on successful mitigation update or
negative error number.
3. void devmgr_unregister_mitigation_client(
struct device *dev,
struct device_clnt_data *clnt)
API for clients to unregister for a device whenever it is done with
device.
@dev: Client device structure.
@clnt: Client handle for device.
Change-Id: Ieda99577a035a32b745df6b004b5487a55ec70ac
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2015-01-27 20:38:22 +00:00
|
|
|
/**
|
|
|
|
* devmgr_register_mitigation_client - Register for a device and
|
|
|
|
* gets a handle for mitigation.
|
|
|
|
* @dev: Client device structure.
|
|
|
|
* @device_name: Mitgation device name which the client is interested
|
|
|
|
* to mitigate.
|
|
|
|
* @callback: Optional callback pointer for device change notification,
|
|
|
|
* otherwise pass NULL.
|
|
|
|
*
|
|
|
|
* Returns client handle structure for that device on success, or NULL
|
|
|
|
* with IS_ERR() condition containing error number.
|
|
|
|
*/
|
|
|
|
extern struct device_clnt_data *devmgr_register_mitigation_client(
|
|
|
|
struct device *dev,
|
|
|
|
const char *device_name,
|
|
|
|
void (*callback)(struct device_clnt_data *,
|
|
|
|
union device_request *, void *));
|
|
|
|
/**
|
|
|
|
* devmgr_client_request_mitigation - Set a valid mitigation for
|
|
|
|
* registered device.
|
|
|
|
* @clnt: Client handle for device.
|
|
|
|
* @type: Type of device request populated above.
|
|
|
|
* @req: Valid mitigation request.
|
|
|
|
*
|
|
|
|
* Returns zero on successful mitigation update, or negative error number.
|
|
|
|
*/
|
|
|
|
extern int devmgr_client_request_mitigation(struct device_clnt_data *clnt,
|
|
|
|
enum device_req_type type,
|
|
|
|
union device_request *req);
|
|
|
|
/**
|
|
|
|
* devmgr_unregister_mitigation_client - Unregister mitigation device
|
|
|
|
* @dev: Client device structure.
|
|
|
|
* @clnt: Client handle for device.
|
|
|
|
*/
|
|
|
|
extern void devmgr_unregister_mitigation_client(
|
|
|
|
struct device *dev,
|
|
|
|
struct device_clnt_data *clnt);
|
2012-05-25 23:36:07 +00:00
|
|
|
#else
|
|
|
|
static inline int msm_thermal_init(struct msm_thermal_data *pdata)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
2012-07-03 01:28:50 +00:00
|
|
|
static inline int msm_thermal_device_init(void)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
2013-09-24 18:36:50 +00:00
|
|
|
static inline int msm_thermal_set_frequency(uint32_t cpu, uint32_t freq,
|
|
|
|
bool is_max)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
2014-05-05 23:18:21 +00:00
|
|
|
static inline int msm_thermal_set_cluster_freq(uint32_t cluster, uint32_t freq,
|
2015-05-28 11:40:29 +00:00
|
|
|
bool is_max)
|
2014-05-05 23:18:21 +00:00
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
static inline int msm_thermal_get_freq_plan_size(uint32_t cluster,
|
2015-05-28 11:40:29 +00:00
|
|
|
unsigned int *table_len)
|
2014-05-05 23:18:21 +00:00
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
static inline int msm_thermal_get_cluster_freq_plan(uint32_t cluster,
|
2015-05-28 11:40:29 +00:00
|
|
|
unsigned int *table_ptr)
|
2014-05-05 23:18:21 +00:00
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
2014-10-24 00:53:52 +00:00
|
|
|
static inline int msm_thermal_get_cluster_voltage_plan(uint32_t cluster,
|
2015-05-28 11:40:29 +00:00
|
|
|
uint32_t *table_ptr)
|
2014-10-24 00:53:52 +00:00
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
2015-02-13 16:11:42 +00:00
|
|
|
static inline int sensor_mgr_init_threshold(struct device *dev,
|
|
|
|
struct threshold_info *thresh_inp,
|
2015-01-22 13:07:46 +00:00
|
|
|
int sensor_id, int32_t high_temp,
|
|
|
|
int32_t low_temp,
|
|
|
|
void (*callback)(struct therm_threshold *))
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
static inline int sensor_mgr_convert_id_and_set_threshold(
|
|
|
|
struct threshold_info *thresh_inp)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
static inline int sensor_mgr_set_threshold(uint32_t zone_id,
|
|
|
|
struct sensor_threshold *threshold)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
2015-02-13 16:11:42 +00:00
|
|
|
static inline void sensor_mgr_remove_threshold(struct device *dev,
|
2015-01-22 13:07:46 +00:00
|
|
|
struct threshold_info *thresh_inp)
|
|
|
|
{
|
|
|
|
}
|
msm: thermal: Add support for device manager in KTM
Add support for device manager framework to KTM. Device manager allows
for aggregation of muliple kernel clients request on mitigation
devices. Clients can set and register for device change notifications.
Currently it supports hotplug device and cpuX (X= 0... NR_CPUS - 1)
devices.
Device manager framework exports below 3 APIs for a device for
clients to use.
1. struct device_clnt_data *devmgr_register_mitigation_client(
struct device *dev,
const char *device_name,
void (*callback)(struct device_clnt_data *,
union device_request *, void *))
API to register mitigation device. This API returns handle, which
should be used by clients when placing mitigation request.
It supports to register for device change notification with callback
as an optional parameter to client.
@dev: Client device structure.
@device_name: Mitgation device name which the client is interested
to mitigate.
@callback: Optional callback pointer for device change notification,
otherwise pass NULL.
Returns client handle structure for that device on success, or NULL
with IS_ERR() condition containing error number.
2. int devmgr_client_request_mitigation(struct device_clnt_data *clnt,
enum device_req_type type,
union device_request *req);
API for clients to set valid mitigation for a registered device.
@clnt: Client handle for device.
@type: Type of device request populated above.
@req: Valid mitigation request.
Returns zero on successful mitigation update or
negative error number.
3. void devmgr_unregister_mitigation_client(
struct device *dev,
struct device_clnt_data *clnt)
API for clients to unregister for a device whenever it is done with
device.
@dev: Client device structure.
@clnt: Client handle for device.
Change-Id: Ieda99577a035a32b745df6b004b5487a55ec70ac
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2015-01-27 20:38:22 +00:00
|
|
|
static inline struct device_clnt_data *devmgr_register_mitigation_client(
|
|
|
|
struct device *dev,
|
|
|
|
const char *device_name,
|
|
|
|
void (*callback)(struct device_clnt_data *,
|
|
|
|
union device_request *, void *))
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
static inline int devmgr_client_request_mitigation(
|
|
|
|
struct device_clnt_data *clnt,
|
|
|
|
enum device_req_type type,
|
|
|
|
union device_request *req)
|
|
|
|
{
|
|
|
|
return -ENOSYS;
|
|
|
|
}
|
|
|
|
static inline void devmgr_unregister_mitigation_client(
|
|
|
|
struct device *dev,
|
|
|
|
struct device_clnt_data *clnt)
|
|
|
|
{
|
|
|
|
}
|
2012-05-25 23:36:07 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /*__MSM_THERMAL_H*/
|