DORMANTno replies

[PATCH] ARM: SAMSUNG: Add over sampling preventing code

From: Huisung Kang <hidden>
Date: 2012-02-10 12:22:58
Also in: linux-samsung-soc
Subsystem: arm port, the rest · Maintainers: Russell King, Linus Torvalds

From: Dongsoo Ha <redacted>

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.

Signed-off-by: Dongsoo Ha <redacted>
Signed-off-by: Huisung Kang <redacted>
---
 arch/arm/plat-samsung/adc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index 33ecd0c..10b32ea 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -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;
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help