* [PATCH V3] mfd: Fixed unconditional reset of the ADC reading enable bits
@ 2011-11-29 11:09 Robin van der Gracht
2011-12-12 17:11 ` Samuel Ortiz
0 siblings, 1 reply; 3+ messages in thread
From: Robin van der Gracht @ 2011-11-29 11:09 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
V3: Removed the added tabular at the definition of MC13XXX_ADC0,
so the offset equals the idention used in 'drivers/mfd/mc13xxx-core.c'
drivers/mfd/mc13xxx-core.c | 4 ++--
include/linux/mfd/mc13xxx.h | 8 ++++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index e9619ac..5315999 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -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;
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index 3816c2f..261fc11 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -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 */
--
1.7.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH V3] mfd: Fixed unconditional reset of the ADC reading enable bits
2011-11-29 11:09 [PATCH V3] mfd: Fixed unconditional reset of the ADC reading enable bits Robin van der Gracht
@ 2011-12-12 17:11 ` Samuel Ortiz
2011-12-12 17:08 ` Uwe Kleine-König
0 siblings, 1 reply; 3+ messages in thread
From: Samuel Ortiz @ 2011-12-12 17:11 UTC (permalink / raw)
To: linux-arm-kernel
Hi Robin,
On Tue, Nov 29, 2011 at 12:09:03PM +0100, Robin van der Gracht wrote:
> 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.
Patch applied, thanks. Uwe, should I add your Acked-by ?
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH V3] mfd: Fixed unconditional reset of the ADC reading enable bits
2011-12-12 17:11 ` Samuel Ortiz
@ 2011-12-12 17:08 ` Uwe Kleine-König
0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2011-12-12 17:08 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 06:11:43PM +0100, Samuel Ortiz wrote:
> Hi Robin,
>
> On Tue, Nov 29, 2011 at 12:09:03PM +0100, Robin van der Gracht wrote:
> > 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.
>
> Patch applied, thanks. Uwe, should I add your Acked-by ?
you can.
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-12 17:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-29 11:09 [PATCH V3] mfd: Fixed unconditional reset of the ADC reading enable bits Robin van der Gracht
2011-12-12 17:11 ` Samuel Ortiz
2011-12-12 17:08 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).