hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/include/linux/mfd/stmpe.h
....@@ -1,7 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) ST-Ericsson SA 2010
34 *
4
- * License Terms: GNU General Public License, version 2
55 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
66 */
77
....@@ -9,6 +9,20 @@
99 #define __LINUX_MFD_STMPE_H
1010
1111 #include <linux/mutex.h>
12
+
13
+#define STMPE_SAMPLE_TIME(x) ((x & 0xf) << 4)
14
+#define STMPE_MOD_12B(x) ((x & 0x1) << 3)
15
+#define STMPE_REF_SEL(x) ((x & 0x1) << 1)
16
+#define STMPE_ADC_FREQ(x) (x & 0x3)
17
+#define STMPE_AVE_CTRL(x) ((x & 0x3) << 6)
18
+#define STMPE_DET_DELAY(x) ((x & 0x7) << 3)
19
+#define STMPE_SETTLING(x) (x & 0x7)
20
+#define STMPE_FRACTION_Z(x) (x & 0x7)
21
+#define STMPE_I_DRIVE(x) (x & 0x1)
22
+#define STMPE_OP_MODE(x) ((x & 0x7) << 1)
23
+
24
+#define STMPE811_REG_ADC_CTRL1 0x20
25
+#define STMPE811_REG_ADC_CTRL2 0x21
1226
1327 struct device;
1428 struct regulator;
....@@ -123,6 +137,12 @@
123137 u8 ier[2];
124138 u8 oldier[2];
125139 struct stmpe_platform_data *pdata;
140
+
141
+ /* For devices that use an ADC */
142
+ u8 sample_time;
143
+ u8 mod_12b;
144
+ u8 ref_sel;
145
+ u8 adc_freq;
126146 };
127147
128148 extern int stmpe_reg_write(struct stmpe *stmpe, u8 reg, u8 data);
....@@ -136,6 +156,7 @@
136156 enum stmpe_block block);
137157 extern int stmpe_enable(struct stmpe *stmpe, unsigned int blocks);
138158 extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks);
159
+extern int stmpe811_adc_common_init(struct stmpe *stmpe);
139160
140161 #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0)
141162