IMX6Q Ft5216触屏驱动移植
来源:互联网 发布:数控冲床编程招聘 编辑:程序博客网 时间:2024/05/16 03:45
触摸屏为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
阅读全文
0 0
- IMX6Q Ft5216触屏驱动移植
- IMX6Q移植ft5x06_ts触摸屏驱动
- IMX6Q上移植AR3K蓝牙驱动
- IMX6Q下tlv320aic3x音频驱动移植
- imx6q can驱动理解
- imx6q中的按键驱动
- IMX6Q(TQIMX6Q/TQE9)移植笔记
- [IMX6Q]u-boot_v2009.08移植
- 基于imx6q平台移植ffmpeg
- [IMX6Q][Android5.1]移植笔记 --- kernel移植
- [IMX6Q][Android5.1]移植笔记 --- kernel移植
- imx6q中led驱动分析
- 明远智睿IMX6Q Android4.4.2移植USBWIFI(RTL8188EUS)
- imx6q sebrasd can总线移植指南
- 基于imx6q平台移植usbwifi: rt5370sta
- IMX6Q调试之 ----- DDR3 32位移植
- 明远智睿IMX6Q Android4.4.2移植USBWIFI(RTL8188EUS)
- IMX6q下gt9xx TP简易移植
- 机器学习基石-02-2-PLA何时停下来?
- PHP函数之error_reporting(E_ALL ^ E_NOTICE)详细说明
- Nginx简介及配置文件详解
- 總結——關於2017 10 13測試的分析總結
- Java注解
- IMX6Q Ft5216触屏驱动移植
- HDU-1754 I Hate It (线段树裸题 splay模板 单点修改 区间询问最大值)
- Mac 下载安装和卸载mysql
- 城市平乱
- java序列化与反序列化
- Windows玩转Caffe(五): mnist模型可视化探知,Matlab绘制其Accuracy和Loss曲线
- 微信小程序实战--高仿人民日报
- 建造者模式
- 安卓小项目之Everyday(1)---使用fragment实现选项卡