mfd: da9052: Add register details for TSI
authorSebastian Reichel <sebastian.reichel@collabora.co.uk>
Mon, 21 Aug 2017 14:54:01 +0000 (16:54 +0200)
committerLee Jones <lee.jones@linaro.org>
Tue, 22 Aug 2017 07:44:37 +0000 (08:44 +0100)
Add register details an channels definition for using the TSI
registers in the hwmon driver.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
include/linux/mfd/da9052/da9052.h
include/linux/mfd/da9052/reg.h

index ce9230af09c20c0498e1111fdf148b8f6406b30e..ae5b663836d09bcac7bf86643bf2666282a8b072 100644 (file)
 #define DA9052_ADC_TJUNC       8
 #define DA9052_ADC_VBBAT       9
 
+/* TSI channel has its own 4 channel mux */
+#define DA9052_ADC_TSI_XP      70
+#define DA9052_ADC_TSI_XN      71
+#define DA9052_ADC_TSI_YP      72
+#define DA9052_ADC_TSI_YN      73
+
 #define DA9052_IRQ_DCIN        0
 #define DA9052_IRQ_VBUS        1
 #define DA9052_IRQ_DCINREM     2
index 5010f978725c50c210128b50ba6b6934ec33f244..76780ea8849c91911b8e8fa332593a6d711631ea 100644 (file)
 /* TSI CONTROL REGISTER B BITS */
 #define DA9052_TSICONTB_ADCREF         0X80
 #define DA9052_TSICONTB_TSIMAN         0X40
-#define DA9052_TSICONTB_TSIMUX         0X30
+#define DA9052_TSICONTB_TSIMUX_XP      0X00
+#define DA9052_TSICONTB_TSIMUX_YP      0X10
+#define DA9052_TSICONTB_TSIMUX_XN      0X20
+#define DA9052_TSICONTB_TSIMUX_YN      0X30
 #define DA9052_TSICONTB_TSISEL3        0X08
 #define DA9052_TSICONTB_TSISEL2        0X04
 #define DA9052_TSICONTB_TSISEL1        0X02
 /* TSI CO-ORDINATE LSB RESULT REGISTER BITS */
 #define DA9052_TSILSB_PENDOWN          0X40
 #define DA9052_TSILSB_TSIZL            0X30
+#define DA9052_TSILSB_TSIZL_SHIFT      4
+#define DA9052_TSILSB_TSIZL_BITS       2
 #define DA9052_TSILSB_TSIYL            0X0C
+#define DA9052_TSILSB_TSIYL_SHIFT      2
+#define DA9052_TSILSB_TSIYL_BITS       2
 #define DA9052_TSILSB_TSIXL            0X03
+#define DA9052_TSILSB_TSIXL_SHIFT      0
+#define DA9052_TSILSB_TSIXL_BITS       2
 
 /* TSI Z MEASUREMENT MSB RESULT REGISTER BIT */
 #define DA9052_TSIZMSB_TSIZM           0XFF