summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2018-12-21 14:46:32 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2020-02-09 22:45:39 +0100
commit128c940f1b337cc012715eda3b9c499c145d194c (patch)
tree68b9153cc5fb22d0ae8cfce01ea51cbba4818638 /include
parent4b5525199c0f5c38279a9a256d0e4736609e26eb (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')
-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)