2011-08-18 20:19:00 +02:00
|
|
|
/*
|
2014-01-13 10:52:52 +01:00
|
|
|
* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
|
2011-08-18 20:19:00 +02: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.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Qualcomm TSENS Header file
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MSM_TSENS_H
|
|
|
|
#define __MSM_TSENS_H
|
|
|
|
|
|
|
|
enum platform_type {
|
|
|
|
MSM_8660 = 0,
|
|
|
|
MSM_8960,
|
2012-03-19 19:19:27 +01:00
|
|
|
MDM_9615,
|
2012-02-08 01:41:38 +01:00
|
|
|
APQ_8064,
|
2011-08-18 20:19:00 +02:00
|
|
|
MSM_TYPE
|
|
|
|
};
|
|
|
|
|
2012-04-06 06:29:54 +02:00
|
|
|
#define TSENS_MAX_SENSORS 11
|
|
|
|
|
2011-08-18 20:19:00 +02:00
|
|
|
struct tsens_platform_data {
|
2012-04-06 06:29:54 +02:00
|
|
|
int slope[TSENS_MAX_SENSORS];
|
2011-08-18 20:19:00 +02:00
|
|
|
int tsens_factor;
|
|
|
|
uint32_t tsens_num_sensor;
|
|
|
|
enum platform_type hw_type;
|
|
|
|
};
|
|
|
|
|
2012-01-21 00:06:40 +01:00
|
|
|
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);
|
2013-04-11 22:59:41 +02:00
|
|
|
|
|
|
|
#if defined(CONFIG_THERMAL_TSENS8974)
|
2014-01-13 10:52:52 +01:00
|
|
|
int tsens_is_ready(void);
|
2013-04-11 22:59:41 +02:00
|
|
|
int __init tsens_tm_init_driver(void);
|
2013-04-12 04:37:41 +02:00
|
|
|
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);
|
2013-04-11 22:59:41 +02:00
|
|
|
#else
|
2014-01-13 10:52:52 +01:00
|
|
|
static inline int tsens_is_ready(void)
|
|
|
|
{ return -ENXIO; }
|
2013-04-11 22:59:41 +02:00
|
|
|
static inline int __init tsens_tm_init_driver(void)
|
|
|
|
{ return -ENXIO; }
|
2013-04-12 04:37:41 +02:00
|
|
|
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; }
|
2013-04-11 22:59:41 +02:00
|
|
|
#endif
|
|
|
|
|
2013-11-21 01:21:40 +01:00
|
|
|
#if defined(CONFIG_THERMAL_TSENS8974)
|
2013-04-05 04:48:17 +02:00
|
|
|
int tsens_get_max_sensor_num(uint32_t *tsens_num_sensors);
|
2013-04-09 19:21:57 +02:00
|
|
|
#else
|
|
|
|
static inline int tsens_get_max_sensor_num(uint32_t *tsens_num_sensors)
|
|
|
|
{ return -ENXIO; }
|
|
|
|
#endif
|
2011-08-18 20:19:00 +02:00
|
|
|
#endif /*MSM_TSENS_H */
|