android_kernel_samsung_msm8976/include/linux/msm_tsens.h
Rama Krishna Phani A 125c1672f3 thermal: tsens: Add MTC support for sensors
Multi-Zone Temperature Control (MTC) provides an interface to
clients to enable or disable thresholds for supported zone of sensors
and to get log of recent commands.

Change-Id: Idb4d2725241f5b95a93bbe9c6969067f68a6bc6d
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
2015-02-24 10:54:34 +05:30

82 lines
2.3 KiB
C

/*
* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
*
* 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.
*/
/*
* Qualcomm TSENS Header file
*
*/
#ifndef __MSM_TSENS_H
#define __MSM_TSENS_H
enum platform_type {
MSM_8660 = 0,
MSM_8960,
MDM_9615,
APQ_8064,
MSM_TYPE
};
#define TSENS_MAX_SENSORS 11
#define TSENS_MTC_ZONE_LOG_SIZE 6
#define TSENS_NUM_MTC_ZONES_SUPPORT 3
struct tsens_platform_data {
int slope[TSENS_MAX_SENSORS];
int tsens_factor;
uint32_t tsens_num_sensor;
enum platform_type hw_type;
};
struct tsens_device {
uint32_t sensor_num;
};
int32_t tsens_get_temp(struct tsens_device *dev, unsigned long *temp);
int msm_tsens_early_init(struct tsens_platform_data *pdata);
#if defined(CONFIG_THERMAL_TSENS8974)
int tsens_is_ready(void);
int __init tsens_tm_init_driver(void);
int tsens_get_sw_id_mapping(int sensor_num, int *sensor_sw_idx);
int tsens_get_hw_id_mapping(int sensor_sw_id, int *sensor_hw_num);
int tsens_set_mtc_zone_sw_mask(unsigned int zone , unsigned int th1_enable,
unsigned int th2_enable);
int tsens_get_mtc_zone_log(unsigned int zone , void *zone_log);
#else
static inline int tsens_is_ready(void)
{ return -ENXIO; }
static inline int __init tsens_tm_init_driver(void)
{ return -ENXIO; }
static inline int tsens_get_sw_id_mapping(
int sensor_num, int *sensor_sw_idx)
{ return -ENXIO; }
static inline int tsens_get_hw_id_mapping(
int sensor_sw_id, int *sensor_hw_num)
{ return -ENXIO; }
static inline int tsens_set_mtc_zone_sw_mask(unsigned int zone ,
unsigned int th1_enable ,
unsigned int th2_enable)
{ return -ENXIO; }
static inline int tsens_get_mtc_zone_log(unsigned int zone , void *zone_log)
{ return -ENXIO; }
#endif
#if defined(CONFIG_THERMAL_TSENS8974)
int tsens_get_max_sensor_num(uint32_t *tsens_num_sensors);
#else
static inline int tsens_get_max_sensor_num(uint32_t *tsens_num_sensors)
{ return -ENXIO; }
#endif
#endif /*MSM_TSENS_H */