summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/mc13xxx-core.c
diff options
context:
space:
mode:
authorAndrey Gusakov <andrey.gusakov@cogentembedded.com>2018-03-27 17:19:49 +0300
committerLee Jones <lee.jones@linaro.org>2018-04-16 13:01:36 +0100
commited645cccc0ebc0329916b6df039dd792d9105c9d (patch)
tree629d6d46412b03737502de902a93586421475889 /drivers/mfd/mc13xxx-core.c
parent60cc43fc888428bb2f18f08997432d426a243338 (diff)
downloadlinux-ed645cccc0ebc0329916b6df039dd792d9105c9d.tar.bz2
hwmon: MC13783: Add uid and die temperature sensor inputs
The uid and die temperature can be read out on the ADIN7 using input mux. Map uid and die temperature sensor to channels 16 and 17. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/mc13xxx-core.c')
-rw-r--r--drivers/mfd/mc13xxx-core.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index d7f54e492aa6..c63e331738c1 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -279,8 +279,21 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2;
adc1 = MC13XXX_ADC1_ADEN | MC13XXX_ADC1_ADTRIGIGN | MC13XXX_ADC1_ASC;
- if (channel > 7)
+ /*
+ * Channels mapped through ADIN7:
+ * 7 - General purpose ADIN7
+ * 16 - UID
+ * 17 - Die temperature
+ */
+ if (channel > 7 && channel < 16) {
adc1 |= MC13XXX_ADC1_ADSEL;
+ } else if (channel == 16) {
+ adc0 |= MC13XXX_ADC0_ADIN7SEL_UID;
+ channel = 7;
+ } else if (channel == 17) {
+ adc0 |= MC13XXX_ADC0_ADIN7SEL_DIE;
+ channel = 7;
+ }
switch (mode) {
case MC13XXX_ADC_MODE_TS: