2 * Copyright (C) 2013 Spreadtrum Communications Inc.
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 ************************************************
14 * Automatically generated C config: don't edit *
15 ************************************************
20 #include <linux/types.h>
21 #include <linux/sprd_thm.h>
22 #include <linux/interrupt.h>
24 struct sprd_thermal_zone {
25 struct thermal_zone_device *therm_dev;
27 struct work_struct therm_work;
28 struct delayed_work resume_delay_work;
29 struct delayed_work thm_read_work;
30 struct sprd_thm_platform_data *trip_tab;
31 struct sprd_board_sensor_config *sensor_config;
32 struct thm_handle_ops *ops;
33 struct delayed_work thm_logtime_work;
34 enum thermal_device_mode mode;
36 unsigned long temp_inteval;
37 unsigned long logtime;
39 void __iomem *reg_base;
40 char thermal_zone_name[30];
41 enum thermal_trend trend_val;
43 enum thermal_log_switch{
44 THERMAL_LOG_DISABLED = 0,
47 struct thm_handle_ops{
48 int (*hw_init)(struct sprd_thermal_zone*);
49 int (*get_reg_base)(struct sprd_thermal_zone*,struct resource *regs);
50 unsigned long (*read_temp)(struct sprd_thermal_zone*);
51 int (*get_trend)(struct sprd_thermal_zone*,int, enum thermal_trend *);
52 int (*get_hyst)(struct sprd_thermal_zone*,int,unsigned long *);
53 int (*irq_handle)(struct sprd_thermal_zone*);
54 int (*suspend)(struct sprd_thermal_zone*);
55 int (*resume)(struct sprd_thermal_zone*);
56 int (*reg_debug_set)(struct sprd_thermal_zone*, unsigned int*);
57 int (*reg_debug_get)(struct sprd_thermal_zone*, unsigned int*);
58 int (*trip_debug_set)(struct sprd_thermal_zone*,int );
60 extern int sprd_thm_add(struct thm_handle_ops* ops, char *p,int id);
61 extern void sprd_thm_delete(int id);
62 extern int sci_efuse_thermal_cal_get(int *cal);
63 extern int sprd_boardthm_add(struct thm_handle_ops* ops, char *p,int id);
64 extern void sprd_boardthm_delete(int id);