.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) ST-Ericsson SA 2010 |
---|
3 | 4 | * |
---|
4 | | - * License Terms: GNU General Public License, version 2 |
---|
5 | 5 | * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson |
---|
6 | 6 | */ |
---|
7 | 7 | |
---|
.. | .. |
---|
9 | 9 | #define __LINUX_MFD_STMPE_H |
---|
10 | 10 | |
---|
11 | 11 | #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 |
---|
12 | 26 | |
---|
13 | 27 | struct device; |
---|
14 | 28 | struct regulator; |
---|
.. | .. |
---|
123 | 137 | u8 ier[2]; |
---|
124 | 138 | u8 oldier[2]; |
---|
125 | 139 | 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; |
---|
126 | 146 | }; |
---|
127 | 147 | |
---|
128 | 148 | extern int stmpe_reg_write(struct stmpe *stmpe, u8 reg, u8 data); |
---|
.. | .. |
---|
136 | 156 | enum stmpe_block block); |
---|
137 | 157 | extern int stmpe_enable(struct stmpe *stmpe, unsigned int blocks); |
---|
138 | 158 | extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks); |
---|
| 159 | +extern int stmpe811_adc_common_init(struct stmpe *stmpe); |
---|
139 | 160 | |
---|
140 | 161 | #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0) |
---|
141 | 162 | |
---|