summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2018-12-21 14:46:32 +0100
committerPhilippe Schenker <philippe.schenker@toradex.com>2019-05-24 11:34:18 +0200
commitb4761c57853fa5685f8ef6b600cdd10a1ec3d4d3 (patch)
tree5e03abf768955918536a2fd4c1c51ec1a48def06 /include/linux
parent923e413f930ba2a9f95e1c505d3e4ca5fbd5cff4 (diff)
mfd: stmpe: Preparations for STMPE ADC driver
This prepares the MFD for the STMPE ADC driver. This commit introduces devicetree settings that are used by the ADC and adds an init function. Common ADC settings that are shared with the touchscreen driver can now reside in the overlying MFD. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> (cherry picked from commit 6377cfa3b857ced301f2079ac97de6c19057ab65)
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mfd/stmpe.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
index c0353f6431f9..07f55aac9390 100644
--- a/include/linux/mfd/stmpe.h
+++ b/include/linux/mfd/stmpe.h
@@ -21,6 +21,9 @@
#define STMPE_I_DRIVE(x) (x & 0x1)
#define STMPE_OP_MODE(x) ((x & 0x7) << 1)
+#define STMPE811_REG_ADC_CTRL1 0x20
+#define STMPE811_REG_ADC_CTRL2 0x21
+
struct device;
struct regulator;
@@ -134,6 +137,12 @@ struct stmpe {
u8 ier[2];
u8 oldier[2];
struct stmpe_platform_data *pdata;
+
+ /* For devices that use an ADC */
+ u8 sample_time;
+ u8 mod_12b;
+ u8 ref_sel;
+ u8 adc_freq;
};
extern int stmpe_reg_write(struct stmpe *stmpe, u8 reg, u8 data);
@@ -147,6 +156,7 @@ extern int stmpe_set_altfunc(struct stmpe *stmpe, u32 pins,
enum stmpe_block block);
extern int stmpe_enable(struct stmpe *stmpe, unsigned int blocks);
extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks);
+extern int stmpe811_adc_common_init(struct stmpe *stmpe);
#define STMPE_GPIO_NOREQ_811_TOUCH (0xf0)