drivers: power: report battery voltage in AOSP compatible format
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / mach / mtk_thermal_ext_control.h
CommitLineData
6fa3eb70
S
1/*
2 * Copyright (c) 2009 Travis Geiselbrecht
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24#ifndef _MTK_THERMAL_EXT_CONTROL_H
25#define _MTK_THERMAL_EXT_CONTROL_H
26
27#define THERMAL_MD32_IPI_MSG_BASE 0x1F00
28#define THERMAL_AP_IPI_MSG_BASE 0x2F00
29
30typedef enum {
31 THERMAL_AP_IPI_MSG_SET_TZ_THRESHOLD = THERMAL_AP_IPI_MSG_BASE,
32 THERMAL_AP_IPI_MSG_MD32_START,
33
34 THERMAL_MD32_IPI_MSG_READY = THERMAL_MD32_IPI_MSG_BASE,
35 THERMAL_MD32_IPI_MSG_MD32_START_ACK,
36 THERMAL_MD32_IPI_MSG_REACH_THRESHOLD,
37} thermal_ipi_msg_id;
38
39typedef enum {
40/* MTK_THERMAL_EXT_SENSOR_CPU = 0, */
41 MTK_THERMAL_EXT_SENSOR_ABB = 0,
42 MTK_THERMAL_EXT_SENSOR_PMIC,
43 MTK_THERMAL_EXT_SENSOR_BATTERY,
44 MTK_THERMAL_EXT_SENSOR_COUNT
45} MTK_THERMAL_EXT_SENSOR_ID;
46
47typedef struct {
48 int id; /* id of this tz */
49 int polling_delay; /* polling delay of this tz */
50 long high_trip_point; /* high threshold of this tz */
51 long low_trip_point; /* low threshold of this tz */
52} thermal_zone_data;
53
54typedef struct {
55 int id; /* id of this tz */
56 long high_trip_point; /* high threshold of this tz */
57 long low_trip_point; /* low threshold of this tz */
58 long temperature; /* Current temperature gotten from TS */
59} thermal_zone_status;
60
61typedef struct {
62 short id;
63 union {
64 thermal_zone_data tz;
65 thermal_zone_status tz_status;
66 } data;
67} thermal_ipi_msg;
68
69#endif /* _MTK_THERMAL_EXT_CONTROL_H */