2 * drivers/input/touchscreen/calibration_ts.h
\r
4 * Copyright (C) 2010 ROCKCHIP, Inc.
\r
6 * This software is licensed under the terms of the GNU General Public
\r
7 * License version 2, as published by the Free Software Foundation, and
\r
8 * may be copied, distributed, and modified under those terms.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
16 #ifndef __DRIVERS_TOUCHSCREEN_CALIBRATION_TS_H
\r
17 #define __DRIVERS_TOUCHSCREEN_CALIBRATION_TS_H
\r
25 #define TWO_DIMENSIONAL_CALIBRATION 1
\r
27 #define ADC_PRECISION 12 // Precision of ADC output (in bits)
\r
28 #define MAX_TERM_PRECISION 27 // Reserve 1 bit for sign and two bits for
\r
29 // three terms (there are three terms in
\r
30 // each of x and y mapping functions.)
\r
33 // All a1, a2, b1, and b2 must have less than MAX_COEFF_PRECISION bits since
\r
34 // they all are multiplied with either an X or a Y to form a term.
\r
35 // Both c1 and c2 can have up to MAX_TERM_PRECISION since they each alone
\r
38 #define MAX_COEFF_PRECISION (MAX_TERM_PRECISION - ADC_PRECISION)
\r
41 TouchPanelSetCalibration(
\r
42 int cCalibrationPoints, //@PARM The number of calibration points
\r
43 int *pScreenXBuffer, //@PARM List of screen X coords displayed
\r
44 int *pScreenYBuffer, //@PARM List of screen Y coords displayed
\r
45 int *pUncalXBuffer, //@PARM List of X coords collected
\r
46 int *pUncalYBuffer //@PARM List of Y coords collected
\r
50 TouchPanelCalibrateAPoint(
\r
51 int UncalX, //@PARM The uncalibrated X coordinate
\r
52 int UncalY, //@PARM The uncalibrated Y coordinate
\r
53 int *pCalX, //@PARM The calibrated X coordinate
\r
54 int *pCalY //@PARM The calibrated Y coordinate
\r
57 int tp_calib_iface_init(int *x,int *y,int *uncali_x, int *uncali_y);
\r
58 void tp_calib_iface_exit(void);
\r