aboutsummaryrefslogtreecommitdiff
path: root/include/linux/ts_filter_median.h
blob: d81642883f72c84f53cffb923550b83b836b0dfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __TS_FILTER_MEDIAN_H__
#define __TS_FILTER_MEDIAN_H__

#include <linux/ts_filter.h>

/*
 * touchscreen filter
 *
 * median
 *
 * (c) 2008 Andy Green <andy@openmoko.com>
 */

struct ts_filter_median_configuration {
	int extent;
	int midpoint;
	int decimation_threshold;
	int decimation_above;
	int decimation_below;
};

struct ts_filter_median {
	struct ts_filter tsf;
	struct ts_filter_median_configuration *config;

	int decimation_count;
	int last_issued[MAX_TS_FILTER_COORDS];
	int valid; /* how many samples in the sort buffer are valid */
	int *sort[MAX_TS_FILTER_COORDS]; /* samples taken for median */
	int *fifo[MAX_TS_FILTER_COORDS]; /* samples taken for median */
	int pos; /* where we are in the fifo sample memory */
};

extern struct ts_filter_api ts_filter_median_api;

#endif