diff options
author | Mirko Vogt <mirko@openwrt.org> | 2008-12-12 11:58:53 +0000 |
---|---|---|
committer | Mirko Vogt <mirko@openwrt.org> | 2008-12-12 11:58:53 +0000 |
commit | fac7f7f84f3771c5247c7fdee825c092077984f5 (patch) | |
tree | 54644c1229434d7ee13c5872bda4129e34337fc0 /target/linux/s3c24xx/patches-2.6.26/0189-fix-touchscreen-meddling-divde.patch.patch | |
parent | a34279723a9cf0796f9261f2fb90bea18cd95711 (diff) | |
download | master-187ad058-fac7f7f84f3771c5247c7fdee825c092077984f5.tar.gz master-187ad058-fac7f7f84f3771c5247c7fdee825c092077984f5.tar.bz2 master-187ad058-fac7f7f84f3771c5247c7fdee825c092077984f5.zip |
changed Makefile and profiles, added patches for kernel 2.6.24
(stable-branch of Openmoko)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13613 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/s3c24xx/patches-2.6.26/0189-fix-touchscreen-meddling-divde.patch.patch')
-rwxr-xr-x | target/linux/s3c24xx/patches-2.6.26/0189-fix-touchscreen-meddling-divde.patch.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/patches-2.6.26/0189-fix-touchscreen-meddling-divde.patch.patch b/target/linux/s3c24xx/patches-2.6.26/0189-fix-touchscreen-meddling-divde.patch.patch new file mode 100755 index 0000000000..4ff79105ef --- /dev/null +++ b/target/linux/s3c24xx/patches-2.6.26/0189-fix-touchscreen-meddling-divde.patch.patch @@ -0,0 +1,52 @@ +From 9bdb2dbc9725d7f2ba23566303d5abe0504beb83 Mon Sep 17 00:00:00 2001 +From: Andy Green <andy@openmoko.com> +Date: Fri, 25 Jul 2008 23:06:16 +0100 +Subject: [PATCH] fix-touchscreen-meddling-divde.patch + Reported-by: Holger Freyther <zecke@openmoko.org> + +length can be zero... blowing a divide by zero exception... +which somehow I don't get (?) Anyway the code is wrong and +this should fix it. + +Signed-off-by: Andy Green <andy@openmoko.com> +--- + drivers/input/touchscreen/s3c2410_ts.c | 12 +++++++++--- + 1 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c +index b1ba73d..5bc347f 100644 +--- a/drivers/input/touchscreen/s3c2410_ts.c ++++ b/drivers/input/touchscreen/s3c2410_ts.c +@@ -226,12 +226,18 @@ static irqreturn_t stylus_action(int irq, void *dev_id) + unsigned long x; + unsigned long y; + int length = (ts.head_raw_fifo - ts.tail_raw_fifo) & (ts.extent - 1); +- int scaled_avg_x = ts.raw_running_avg.x / length; +- int scaled_avg_y = ts.raw_running_avg.y / length; ++ int scaled_avg_x; ++ int scaled_avg_y; + + x = readl(base_addr + S3C2410_ADCDAT0) & S3C2410_ADCDAT0_XPDATA_MASK; + y = readl(base_addr + S3C2410_ADCDAT1) & S3C2410_ADCDAT1_YPDATA_MASK; + ++ if (!length) ++ goto store_sample; ++ ++ scaled_avg_x = ts.raw_running_avg.x / length; ++ scaled_avg_y = ts.raw_running_avg.y / length; ++ + /* we appear to accept every sample into both the running average FIFO + * and the summing average. BUT, if the last sample crossed a + * machine-set threshold, each time we do a beauty contest +@@ -280,7 +286,7 @@ static irqreturn_t stylus_action(int irq, void *dev_id) + else + ts.flag_previous_exceeded_threshold = 1; + +- /* accepted */ ++store_sample: + ts.xp += x; + ts.yp += y; + ts.count++; +-- +1.5.6.3 + |