]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
authorHans de Goede <hdegoede@redhat.com>
Wed, 14 Dec 2016 13:55:25 +0000 (14:55 +0100)
committerJonathan Cameron <jic23@kernel.org>
Tue, 10 Jan 2017 19:54:57 +0000 (19:54 +0000)
commitfa2849e9649b5180ffc4cb3c3b005261c403093a
tree48998e122f8d60adf40b855368cb21727a007797
parent06fc41daae224731e5537a239ab464e5ae2fe762
iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications

For some reason the axp288_adc driver was modifying the
AXP288_ADC_TS_PIN_CTRL register, changing bits 0-1 depending on
whether the GP_ADC channel or another channel was written.

These bits control when a bias current is send to the TS_PIN, the
GP_ADC has its own pin and a separate bit in another register to
control the bias current.

Not only does changing when to enable the TS_PIN bias current
(always or only when sampling) when reading the GP_ADC make no sense
at all, the code is modifying these bits is writing the entire register,
assuming that all the other bits have their default value.

So if the firmware has configured a different bias-current for either
pin, then that change gets clobbered by the write, likewise if the
firmware has set bit 2 to indicate that the battery has no thermal sensor,
this will get clobbered by the write.

This commit fixes all this, by simply removing all writes to the
AXP288_ADC_TS_PIN_CTRL register, they are not needed to read the
GP_ADC pin, and can actually be harmful.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/axp288_adc.c