drm/rockchip: add DRM_RENDER_ALLOW
[firefly-linux-kernel-4.4.55.git] / include / linux / i2c / twl6030-madc.h
1 /*
2  * twl6030_madc.h - Header for TWL6030 MADC
3  *
4  * Copyright (C) 2011 Samsung Telecommunications of America
5  *
6  * Based on twl4030-madc.h
7  * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
8  * J Keerthy <j-keerthy@ti.com>
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * version 2 as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  *
24  */
25
26 #ifndef _TWL6030_MADC_H
27 #define _TWL6030_MADC_H
28
29 #define TWL6030_MADC_MAX_CHANNELS 17
30 /*
31  * twl6030 madc occupies the same offset in the twl6030 map that
32  * twl4030 madc does in the twl4030 map.
33  * likewise the charger
34  */
35 #define TWL6030_MODULE_MADC          TWL4030_MODULE_MADC
36 #define TWL6030_MODULE_MAIN_CHARGE   TWL4030_MODULE_MAIN_CHARGE
37
38 #define TWL6030_MADC_CTRL               0x00
39 #define    TWL6030_MADC_TEMP1_EN        (1 << 0)
40 #define    TWL6030_MADC_TEMP2_EN        (1 << 1)
41 #define    TWL6030_MADC_SCALER_EN_CH2   (1 << 2)
42 #define    TWL6030_MADC_VBAT_SCALER_DIV (1 << 3)
43 #define    TWL6030_MADC_SCALER_EN_CH11  (1 << 4)
44 #define    TWL6030_MADC_TMP1_EN_MONITOR (1 << 5)
45 #define    TWL6030_MADC_TMP2_EN_MONITOR (1 << 6)
46 #define    TWL6030_MADC_ISOURCE_EN      (1 << 7)
47
48 #define TWL6030_MADC_RTSELECT_LSB       0x02
49 #define    TWL6030_MADC_ADCIN0  (1 << 0)
50 #define    TWL6030_MADC_ADCIN1  (1 << 1)
51 #define    TWL6030_MADC_ADCIN2  (1 << 2)
52 #define    TWL6030_MADC_ADCIN3  (1 << 3)
53 #define    TWL6030_MADC_ADCIN4  (1 << 4)
54 #define    TWL6030_MADC_ADCIN5  (1 << 5)
55 #define    TWL6030_MADC_ADCIN6  (1 << 6)
56 #define    TWL6030_MADC_ADCIN7  (1 << 7)
57
58 #define TWL6030_MADC_RTSELECT_ISB       0x03
59 #define    TWL6030_MADC_ADCIN8          (1 << 0)
60 #define    TWL6030_MADC_ADCIN9          (1 << 1)
61 #define    TWL6030_MADC_ADCIN10         (1 << 2)
62 #define    TWL6030_MADC_ADCIN11         (1 << 3)
63 #define    TWL6030_MADC_ADCIN12         (1 << 4)
64 #define    TWL6030_MADC_ADCIN13         (1 << 5)
65 #define    TWL6030_MADC_ADCIN14         (1 << 6)
66 #define    TWL6030_MADC_ADCIN15         (1 << 7)
67
68 #define TWL6030_MADC_RTSELECT_MSB       0x04
69 #define    TWL6030_MADC_ADCIN16         (1 << 0)
70
71 #define TWL6030_MADC_CTRL_P1            0x05
72 #define    TWL6030_MADC_BUSY            (1 << 0)
73 #define    TWL6030_MADC_EOCP1           (1 << 1)
74 #define    TWL6030_MADC_EOCRT           (1 << 2)
75 #define    TWL6030_MADC_SP1             (1 << 3)
76
77 #define TWL6030_MADC_CTRL_P2            0x06
78 #define    TWL6030_MADC_BUSYB           (1 << 0)
79 #define    TWL6030_MADC_EOCP2           (1 << 1)
80 #define    TWL6030_MADC_SP2             (1 << 2)
81
82 #define TWL6030_MADC_RTCH0_LSB          0x07
83 #define TWL6030_MADC_GPCH0_LSB          0x29
84
85 int twl6030_get_madc_conversion(int channel_no);
86 #endif