blob: b3a2c8ed6996724c1c70a97554e100214738d0e1 [file] [log] [blame]
Rama Krishna Phani A82403082018-03-12 17:09:36 +05301/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
Ashok Jammigumpulaa1b7ec12017-11-23 15:37:44 +05302 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#define TSENS_NUM_MTC_ZONES_SUPPORT 3
15#define TSENS_TM_MTC_ZONE0_SW_MASK_ADDR(n) ((n) + 0x140)
16#define TSENS_TM_MTC_ZONE0_LOG(n) ((n) + 0x150)
17#define TSENS_TM_MTC_ZONE0_HISTORY(n) ((n) + 0x160)
Siva Kumar Akkireddiee8aed92018-04-09 17:06:05 +053018#define TSENS_TM_MTC_ZONE0_SW_MASK_ADDR_V14(n) ((n) + 0xC0)
19#define TSENS_TM_MTC_ZONE0_LOG_V14(n) ((n) + 0xD0)
20
Ashok Jammigumpulaa1b7ec12017-11-23 15:37:44 +053021#define TSENS_SN_ADDR_OFFSET 0x4
22#define TSENS_RESET_HISTORY_MASK 0x4
23#define TSENS_ZONEMASK_PARAMS 3
24#define TSENS_MTC_ZONE_LOG_SIZE 6
25#define TSENS_MTC_ZONE_HISTORY_SIZE 3
26
27#define TSENS_TH1_MTC_IN_EFFECT BIT(0)
28#define TSENS_TH2_MTC_IN_EFFECT BIT(1)
29#define TSENS_MTC_IN_EFFECT 0x3
30#define TSENS_MTC_DISABLE 0x0
31
32#define TSENS_LOGS_VALID_MASK 0x40000000
33#define TSENS_LOGS_VALID_SHIFT 30
34#define TSENS_LOGS_LATEST_MASK 0x0000001f
35#define TSENS_LOGS_LOG1_MASK 0x000003e0
36#define TSENS_LOGS_LOG2_MASK 0x00007c00
37#define TSENS_LOGS_LOG3_MASK 0x000f8000
38#define TSENS_LOGS_LOG4_MASK 0x01f00000
39#define TSENS_LOGS_LOG5_MASK 0x3e000000
40#define TSENS_LOGS_LOG1_SHIFT 5
41#define TSENS_LOGS_LOG2_SHIFT 10
42#define TSENS_LOGS_LOG3_SHIFT 15
43#define TSENS_LOGS_LOG4_SHIFT 20
44#define TSENS_LOGS_LOG5_SHIFT 25
45
46#define TSENS_PS_RED_CMD_MASK 0x3ff00000
47#define TSENS_PS_YELLOW_CMD_MASK 0x000ffc00
48#define TSENS_PS_COOL_CMD_MASK 0x000003ff
49#define TSENS_PS_YELLOW_CMD_SHIFT 0xa
50#define TSENS_PS_RED_CMD_SHIFT 0x14
51
52#define TSENS_RESET_HISTORY_SHIFT 2
53
54#define TSENS_ZONEMASK_PARAMS 3
55#define TSENS_MTC_ZONE_LOG_SIZE 6
56#define TSENS_MTC_ZONE_HISTORY_SIZE 3
57
58extern int tsens_get_mtc_zone_history(unsigned int zone, void *zone_hist);
59extern struct tsens_device *tsens_controller_is_present(void);
60extern int tsens_set_mtc_zone_sw_mask(unsigned int zone,
61 unsigned int th1_enable, unsigned int th2_enable);
62extern int tsens_get_mtc_zone_log(unsigned int zone, void *zone_log);
Rama Krishna Phani A82403082018-03-12 17:09:36 +053063extern int tsens_mtc_reset_history_counter(unsigned int zone);