aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c
diff options
context:
space:
mode:
authorGraeme Gregory <gg@slimlogic.co.uk>2011-10-17 15:19:55 +0100
committerDan Murphy <dmurphy@ti.com>2012-02-01 08:50:08 -0600
commitf654122b207bfaa6be71578a12676c2c44c77ecd (patch)
treefbb020a15aa2125a77f35193d253fe8ee66a2c5f /include/linux/i2c
parent2ff66065f12c60893078a0179f6b3f18898511bb (diff)
downloadkernel_samsung_espresso10-f654122b207bfaa6be71578a12676c2c44c77ecd.zip
kernel_samsung_espresso10-f654122b207bfaa6be71578a12676c2c44c77ecd.tar.gz
kernel_samsung_espresso10-f654122b207bfaa6be71578a12676c2c44c77ecd.tar.bz2
MFD: TWL6030-gpadc update for TWL6032
The TWL6032 chip has a different but similar GPADC. The resolution has been increased to 12bits and there are more channels. The method correction values are stored in EPROM is also changed. Change-Id: Iec060638ebecab50fb6562b0fae592f807554a42 Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
Diffstat (limited to 'include/linux/i2c')
-rw-r--r--include/linux/i2c/twl.h1
-rw-r--r--include/linux/i2c/twl6030-gpadc.h29
2 files changed, 28 insertions, 2 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 6eeac8e..65ac0e0 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -653,6 +653,7 @@ struct twl4030_gpio_platform_data {
struct twl4030_madc_platform_data {
int irq_line;
+ int features;
};
/* Boards have unique mappings of {row, col} --> keycode.
diff --git a/include/linux/i2c/twl6030-gpadc.h b/include/linux/i2c/twl6030-gpadc.h
index 97fe7e1..5b9c1a7 100644
--- a/include/linux/i2c/twl6030-gpadc.h
+++ b/include/linux/i2c/twl6030-gpadc.h
@@ -37,6 +37,9 @@ struct twl6030_gpadc_conversion_method {
};
#define TWL6030_GPADC_MAX_CHANNELS 17
+#define TWL6032_GPADC_MAX_CHANNELS 19
+/* Define this as the biggest of all chips using this driver */
+#define GPADC_MAX_CHANNELS TWL6032_GPADC_MAX_CHANNELS
/*
* raw_code - raw adc value
@@ -56,14 +59,15 @@ struct twl6030_gpadc_request {
u16 type;
int active;
int result_pending;
- int rbuf[TWL6030_GPADC_MAX_CHANNELS];
+ int rbuf[TWL6032_GPADC_MAX_CHANNELS];
void (*func_cb)(int len, int channels, int *buf);
- struct twl6030_value buf[TWL6030_GPADC_MAX_CHANNELS];
+ struct twl6030_value buf[TWL6032_GPADC_MAX_CHANNELS];
};
enum conversion_methods {
TWL6030_GPADC_RT,
TWL6030_GPADC_SW2,
+ TWL6032_GPADC_SW2,
TWL6030_GPADC_NUM_METHODS
};
@@ -74,13 +78,29 @@ enum sample_type {
};
#define TWL6030_GPADC_CTRL 0x00 /* 0x2e */
+#define TWL6030_GPADC_CTRL2 0x01 /* 0x2f */
#define TWL6030_GPADC_RTSELECT_LSB 0x02 /* 0x30 */
#define TWL6030_GPADC_RTSELECT_ISB 0x03
#define TWL6030_GPADC_RTSELECT_MSB 0x04
+#define TWL6032_GPADC_RTSELECT_LSB 0x04 /* 0x32 */
+#define TWL6032_GPADC_RTSELECT_ISB 0x05
+#define TWL6032_GPADC_RTSELECT_MSB 0x06
+
#define TWL6030_GPADC_CTRL_P1 0x05
#define TWL6030_GPADC_CTRL_P2 0x06
+
+#define TWL6032_GPADC_GPSELECT_ISB 0x07
+#define TWL6032_GPADC_CTRL_P1 0x08
+
+#define TWL6032_RTCH0_LSB 0x09
+#define TWL6032_RTCH0_MSB 0x0a
+#define TWL6032_RTCH1_LSB 0x0b
+#define TWL6032_RTCH1_MSB 0x0c
+#define TWL6032_GPCH0_LSB 0x0d
+#define TWL6032_GPCH0_MSB 0x0e
+
#define TWL6030_GPADC_CTRL_P1_SP1 (1 << 3)
#define TWL6030_GPADC_CTRL_P1_EOCRT (1 << 2)
#define TWL6030_GPADC_CTRL_P1_EOCP1 (1 << 1)
@@ -106,6 +126,11 @@ enum sample_type {
#define TWL6030_GPADC_CTRL_TEMP2_EN_MONITOR (1 << 6)
#define TWL6030_GPADC_CTRL_ISOURCE_EN (1 << 7)
+#define TWL6030_GPADC_CTRL2_REMSENSE_0 (1 << 0)
+#define TWL6030_GPADC_CTRL2_REMSENSE_1 (1 << 1)
+#define TWL6030_GPADC_CTRL2_SCALER_EN_CH18 (1 << 2)
+#define TWL6030_GPADC_CTRL2_VBAT_SCALER_DIV4 (1 << 3)
+
#define TWL6030_GPADC_IOC_MAGIC '`'
#define TWL6030_GPADC_IOCX_ADC_RAW_READ _IO(TWL6030_GPADC_IOC_MAGIC, 0)