Skip to contentSkip to conversation

ARM: SAMSUNG: Add over sampling preventing code

PATCH New Huisung Kang 1 participant 1 message Feb 10, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: SAMSUNG: Add over sampling preventing code

From: Dongsoo Ha <[email protected]>

Multiple calling adc by other device have happend over sampling. It can be TS(TouchScreen), in the issue, while the adc is approaching. This commit is preventing code for over sampling.

---
 arch/arm/plat-samsung/adc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/plat-samsung/adc.c +2 -1
index 33ecd0c..10b32ea 100644
@@ -297,7 +297,8 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
 	data1 = readl(adc->regs + S3C2410_ADCDAT1);
 	adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1);
 
-	client->nr_samples--;
+	if (client->nr_samples > 0)
+		client->nr_samples--;
 
 	if (cpu == TYPE_ADCV1 || cpu == TYPE_ADCV11) {
 		data0 &= 0x3ff;
Signature · 1 line
1.7.1