触摸屏为ft5216
复位:TOUCH_RES--->NANDF_D1 MX6QDL_PAD_NANDF_D1__GPIO2_IO01
中断:TOUCH_INT1---->NANDF_D5 MX6QDL_PAD_NANDF_D5__GPIO2_IO05
I2C3 地址为0x38
参考:kernel_imx/arch/arm/boot/dts/imx6qdl-tx6.dtsi
1.dts修改
&i2c3 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";
edt-ft5x06@38 {
compatible = "edt,edt-ft5x06";
reg = <0x38>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_edt_ft5x06>;
interrupt-parent = <&gpio2>;
interrupts = <5 0>;
reset-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
};
........
};
pinctrl_edt_ft5x06: edt-ft5x06grp{
fsl,pins = <
MX6QDL_PAD_NANDF_D5__GPIO2_IO05 0x1b0b0 /*Interrupt*/
MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0 /*Reset*/
>;
};
2.驱动,跟根屏的大小和原点调整x,y的范围和方向
--- a/kernel_imx/drivers/input/touchscreen/edt-ft5x06.c
+++ b/kernel_imx/drivers/input/touchscreen/edt-ft5x06.c
@@ -71,6 +71,9 @@
#define EDT_RAW_DATA_RETRIES 100
#define EDT_RAW_DATA_DELAY 1 /* msec */
+#define MAX_SCREEN_X 1024
+#define MAX_SCREEN_Y 600
+
enum edt_ver {
M06,
M09,
@@ -236,7 +239,8 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
y = ((buf[2] << 8) | buf[3]) & 0x0fff;
id = (buf[2] >> 4) & 0x0f;
down = type != TOUCH_EVENT_UP;
-
+ x = MAX_SCREEN_X - x;
+ y = MAX_SCREEN_Y - y;
input_mt_slot(tsdata->input, id);
input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, down);
@@ -1038,12 +1042,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
__set_bit(EV_KEY, input->evbit);
__set_bit(EV_ABS, input->evbit);
__set_bit(BTN_TOUCH, input->keybit);
- input_set_abs_params(input, ABS_X, 0, tsdata->num_x * 64 - 1, 0, 0);
- input_set_abs_params(input, ABS_Y, 0, tsdata->num_y * 64 - 1, 0, 0);
+ input_set_abs_params(input, ABS_X, 0, MAX_SCREEN_X, 0, 0);
+ input_set_abs_params(input, ABS_Y, 0, MAX_SCREEN_Y, 0, 0);
input_set_abs_params(input, ABS_MT_POSITION_X,
- 0, tsdata->num_x * 64 - 1, 0, 0);
+ 0, MAX_SCREEN_X, 0, 0);
input_set_abs_params(input, ABS_MT_POSITION_Y,
- 0, tsdata->num_y * 64 - 1, 0, 0);
+
3.idc配置文件
system/usr/idc/EP0790M09.idc
文件名字为input_dev->name
# cat EP0790M09.idc
touch.deviceType = touchScreen
touch.orientationAware = 1
touch.size.calibration = none
touch.orientation.calibration = none
复位:TOUCH_RES--->NANDF_D1 MX6QDL_PAD_NANDF_D1__GPIO2_IO01
中断:TOUCH_INT1---->NANDF_D5 MX6QDL_PAD_NANDF_D5__GPIO2_IO05
I2C3 地址为0x38
参考:kernel_imx/arch/arm/boot/dts/imx6qdl-tx6.dtsi
1.dts修改
&i2c3 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";
edt-ft5x06@38 {
compatible = "edt,edt-ft5x06";
reg = <0x38>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_edt_ft5x06>;
interrupt-parent = <&gpio2>;
interrupts = <5 0>;
reset-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
};
........
};
pinctrl_edt_ft5x06: edt-ft5x06grp{
fsl,pins = <
MX6QDL_PAD_NANDF_D5__GPIO2_IO05 0x1b0b0 /*Interrupt*/
MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0 /*Reset*/
>;
};
2.驱动,跟根屏的大小和原点调整x,y的范围和方向
--- a/kernel_imx/drivers/input/touchscreen/edt-ft5x06.c
+++ b/kernel_imx/drivers/input/touchscreen/edt-ft5x06.c
@@ -71,6 +71,9 @@
#define EDT_RAW_DATA_RETRIES 100
#define EDT_RAW_DATA_DELAY 1 /* msec */
+#define MAX_SCREEN_X 1024
+#define MAX_SCREEN_Y 600
+
enum edt_ver {
M06,
M09,
@@ -236,7 +239,8 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
y = ((buf[2] << 8) | buf[3]) & 0x0fff;
id = (buf[2] >> 4) & 0x0f;
down = type != TOUCH_EVENT_UP;
-
+ x = MAX_SCREEN_X - x;
+ y = MAX_SCREEN_Y - y;
input_mt_slot(tsdata->input, id);
input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, down);
@@ -1038,12 +1042,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
__set_bit(EV_KEY, input->evbit);
__set_bit(EV_ABS, input->evbit);
__set_bit(BTN_TOUCH, input->keybit);
- input_set_abs_params(input, ABS_X, 0, tsdata->num_x * 64 - 1, 0, 0);
- input_set_abs_params(input, ABS_Y, 0, tsdata->num_y * 64 - 1, 0, 0);
+ input_set_abs_params(input, ABS_X, 0, MAX_SCREEN_X, 0, 0);
+ input_set_abs_params(input, ABS_Y, 0, MAX_SCREEN_Y, 0, 0);
input_set_abs_params(input, ABS_MT_POSITION_X,
- 0, tsdata->num_x * 64 - 1, 0, 0);
+ 0, MAX_SCREEN_X, 0, 0);
input_set_abs_params(input, ABS_MT_POSITION_Y,
- 0, tsdata->num_y * 64 - 1, 0, 0);
+
3.idc配置文件
system/usr/idc/EP0790M09.idc
文件名字为input_dev->name
# cat EP0790M09.idc
touch.deviceType = touchScreen
touch.orientationAware = 1
touch.size.calibration = none
touch.orientation.calibration = none