aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/ts_filter_median.h
blob: 8f25e27b2aabada60d1248c14b259d8a3f1a04e4 (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 "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