2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 19:23:57 +08:00

mfd: Fixed unconditional reset of the mc13xxx ADC reading enable bits

When the ADC is being prepared for a single or multiple channel reading,
the adc0 register is reconfigured without taking the lithium cell, charge
current and battery current reading enable bits into account. Which results
in clearing the bits.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Robin van der Gracht 2011-11-29 12:09:03 +01:00 committed by Samuel Ortiz
parent 99f09bebbe
commit 2161891a0a
2 changed files with 10 additions and 2 deletions

View File

@ -615,13 +615,13 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
break;
case MC13XXX_ADC_MODE_SINGLE_CHAN:
adc0 |= old_adc0 & MC13XXX_ADC0_TSMOD_MASK;
adc0 |= old_adc0 & MC13XXX_ADC0_CONFIG_MASK;
adc1 |= (channel & 0x7) << MC13XXX_ADC1_CHAN0_SHIFT;
adc1 |= MC13XXX_ADC1_RAND;
break;
case MC13XXX_ADC_MODE_MULT_CHAN:
adc0 |= old_adc0 & MC13XXX_ADC0_TSMOD_MASK;
adc0 |= old_adc0 & MC13XXX_ADC0_CONFIG_MASK;
adc1 |= 4 << MC13XXX_ADC1_CHAN1_SHIFT;
break;

View File

@ -173,6 +173,9 @@ struct mc13xxx_platform_data {
#define MC13XXX_ADC_MODE_MULT_CHAN 3
#define MC13XXX_ADC0 43
#define MC13XXX_ADC0_LICELLCON (1 << 0)
#define MC13XXX_ADC0_CHRGICON (1 << 1)
#define MC13XXX_ADC0_BATICON (1 << 2)
#define MC13XXX_ADC0_ADREFEN (1 << 10)
#define MC13XXX_ADC0_TSMOD0 (1 << 12)
#define MC13XXX_ADC0_TSMOD1 (1 << 13)
@ -184,4 +187,9 @@ struct mc13xxx_platform_data {
MC13XXX_ADC0_TSMOD1 | \
MC13XXX_ADC0_TSMOD2)
#define MC13XXX_ADC0_CONFIG_MASK (MC13XXX_ADC0_TSMOD_MASK | \
MC13XXX_ADC0_LICELLCON | \
MC13XXX_ADC0_CHRGICON | \
MC13XXX_ADC0_BATICON)
#endif /* ifndef __LINUX_MFD_MC13XXX_H */