diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2018-08-28 17:02:40 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-01 09:13:45 +0100 |
commit | ff00b5656fb0de41a23c8c5ecb8d848b5fd88614 (patch) | |
tree | 83bebc3c107ad761925b289d7f2628baf9d2d324 /drivers/mfd | |
parent | b583f37009be4e2686b4f5a46f4389ac96b65a83 (diff) | |
download | linux-stable-ff00b5656fb0de41a23c8c5ecb8d848b5fd88614.tar.gz linux-stable-ff00b5656fb0de41a23c8c5ecb8d848b5fd88614.tar.bz2 linux-stable-ff00b5656fb0de41a23c8c5ecb8d848b5fd88614.zip |
mfd: mc13xxx-core: Fix PMIC shutdown when reading ADC values
[ Upstream commit 55143439b7b501882bea9d95a54adfe00ffc79a3 ]
When trying to read any MC13892 ADC channel on a imx51-babbage board:
The MC13892 PMIC shutdowns completely.
After debugging this issue and comparing the MC13892 and MC13783
initializations done in the vendor kernel, it was noticed that the
CHRGRAWDIV bit of the ADC0 register was not being set.
This bit is set by default after power on, but the driver was
clearing it.
After setting this bit it is possible to read the ADC values correctly.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/mc13xxx-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index 6c16f170529f..75d52034f89d 100644 --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c @@ -278,7 +278,8 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, if (ret) goto out; - adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2; + adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2 | + MC13XXX_ADC0_CHRGRAWDIV; adc1 = MC13XXX_ADC1_ADEN | MC13XXX_ADC1_ADTRIGIGN | MC13XXX_ADC1_ASC; if (channel > 7) |