summaryrefslogtreecommitdiff
path: root/include/linux/generic_adc_thermal.h
blob: f981c982534437101a7faefe8572f2f736e78c95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * include/linux/generic_adc_thermal.h
 *
 * Generic ADC thermal driver
 *
 * Copyright (c) 2013-2014, NVIDIA Corporation. All rights reserved.
 *
 * Author: Jinyoung Park <jinyoungp@nvidia.com>
 *
 * 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.
 *
 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
 * whether express or implied; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 * 02111-1307, USA
 */

#ifndef _LINUX_GENERIC_ADC_THERMAL_H
#define _LINUX_GENERIC_ADC_THERMAL_H

#include <linux/platform_data/thermal_sensors.h>

struct gadc_thermal_platform_data {
	const char *iio_channel_name;
	const char *tz_name;
	int temp_offset; /* mC */
	bool dual_mode;
	int (*adc_to_temp)(struct gadc_thermal_platform_data *pdata, int val,
			   int val2);
	int *adc_temp_lookup;
	unsigned int lookup_table_size;
	int first_index_temp;
	int last_index_temp;

	/* zone parameters */
	int polling_delay;
	struct thermal_zone_params *tzp;

	/* trip info */
	int num_trips;
	struct thermal_trip_info trips[THERMAL_MAX_TRIPS];
};
#endif /* _LINUX_GENERIC_ADC_THERMAL_H */