mfd: mc13xxx-core: Fix PMIC shutdown when reading ADC values
authorFabio Estevam <fabio.estevam@nxp.com>
Tue, 28 Aug 2018 20:02:40 +0000 (17:02 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Dec 2019 08:13:45 +0000 (09:13 +0100)
commitff00b5656fb0de41a23c8c5ecb8d848b5fd88614
tree83bebc3c107ad761925b289d7f2628baf9d2d324
parentb583f37009be4e2686b4f5a46f4389ac96b65a83
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>
drivers/mfd/mc13xxx-core.c
include/linux/mfd/mc13xxx.h