diff options
author | merge <null@invalid> | 2008-12-04 21:30:41 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2008-12-04 21:30:41 +0000 |
commit | 1bfcb6881cb4ea120894ef4e032fa3ca7d311b35 (patch) | |
tree | f1baa757ac1c48529a2433a295a490ef383c82b5 /drivers/input/touchscreen/ts_filter_mean.c | |
parent | f1e6e9204ab03f140abe71c701d79728ae9a0baf (diff) |
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-cleanup-add-internal-functions-1228426177
pending-tracking-hist top was MERGE-via-stable-tracking-cleanup-add-internal-functions-1228426177 / cf9f1f4a754f2db71f829a8b07ac455e053b3d1f ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-cleanup-add-internal-functions
stable-tracking-hist top was cleanup-add-internal-functions / 251b632aa7be6c6307a6938a59793e205da5b326 ... parent commitmessage:
From: Nelson Castillo <nelsoneci@gmail.com>
Cleanup - Add internal functions for clearing filters
This patch adds the following functions:
* ts_filter_mean_clear_internal
* ts_filter_median_clear_internal
The idea: avoid calling the clean function of other filters
when we initialize one.
Also:
* modify messages for consistency.
* remove an unneeded else.
Signed-off-by: Nelson Castillo <nelsoneci@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/ts_filter_mean.c')
-rw-r--r-- | drivers/input/touchscreen/ts_filter_mean.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/ts_filter_mean.c b/drivers/input/touchscreen/ts_filter_mean.c index 2322432fc3f..a2f1748a686 100644 --- a/drivers/input/touchscreen/ts_filter_mean.c +++ b/drivers/input/touchscreen/ts_filter_mean.c @@ -36,7 +36,7 @@ #include <linux/slab.h> #include <linux/ts_filter_mean.h> -static void ts_filter_mean_clear(struct ts_filter *tsf) +static void ts_filter_mean_clear_internal(struct ts_filter *tsf) { struct ts_filter_mean *tsfs = (struct ts_filter_mean *)tsf; int n; @@ -46,6 +46,11 @@ static void ts_filter_mean_clear(struct ts_filter *tsf) tsfs->ftail[n] = 0; tsfs->lowpass[n] = 0; } +} + +static void ts_filter_mean_clear(struct ts_filter *tsf) +{ + ts_filter_mean_clear_internal(tsf); if (tsf->next) /* chain */ (tsf->next->api->clear)(tsf->next); @@ -82,10 +87,11 @@ static struct ts_filter *ts_filter_mean_create(void *config, int count_coords) if (!tsfs->config->averaging_threshold) tsfs->config->averaging_threshold = 0xffff; /* always active */ - ts_filter_mean_clear(&tsfs->tsf); + ts_filter_mean_clear_internal(&tsfs->tsf); - printk(KERN_INFO " Created Mean ts filter len %d thresh %d\n", - tsfs->config->extent, tsfs->config->averaging_threshold); + printk(KERN_INFO" Created Mean ts filter len %d depth %d thresh %d\n", + tsfs->config->extent, count_coords, + tsfs->config->averaging_threshold); return &tsfs->tsf; } @@ -151,8 +157,8 @@ static int ts_filter_mean_process(struct ts_filter *tsf, int *coords) if (tsf->next) /* chain */ return (tsf->next->api->process)(tsf->next, coords); -// else - return 1; + + return 1; } struct ts_filter_api ts_filter_mean_api = { |