Goodix系列------input device的init
来源:互联网 发布:聊聊语音聊天网mac 编辑:程序博客网 时间:2024/05/24 06:51
在probe函数里会有
static s8 gtp_request_input_dev(struct goodix_ts_data *ts)
{
s8 ret = -1;
u8 index = 0;
ts->input_dev = input_allocate_device(); //先请求分配设备,初始化dev的lock
ts->input_dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) ;
#if GTP_ICS_SLOT_REPORT
input_mt_init_slots(ts->input_dev, 16,0); // 最多上报多少个点
#else
ts->input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
#endif
__set_bit(INPUT_PROP_DIRECT, ts->input_dev->propbit);
#if GTP_HAVE_TOUCH_KEY
for (index = 0; index < GTP_MAX_KEY_NUM; index++)
{
input_set_capability(ts->input_dev, EV_KEY, touch_key_array[index]); //上报key的kernel的定义值
}
#endif
#if GTP_GESTURE_WAKEUP
input_set_capability(ts->input_dev, EV_KEY, KEY_POWER);//手势唤醒
#endif
#if GTP_CHANGE_X2Y
GTP_SWAP(ts->abs_x_max, ts->abs_y_max);
#endif
input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, 0, ts->abs_x_max, 0, 0);
input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, 0, ts->abs_y_max, 0, 0);
input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(ts->input_dev, ABS_MT_TRACKING_ID, 0, 255, 0, 0);
ts->input_dev->name = goodix_ts_name; //static const char *goodix_ts_name = "goodix-ts";
ts->input_dev->phys = goodix_input_phys; //static const char *goodix_input_phys = "input/ts";
ts->input_dev->id.bustype = BUS_I2C;
ts->input_dev->id.vendor = 0xDEAD;
ts->input_dev->id.product = 0xBEEF;
ts->input_dev->id.version = 10427;
ret = input_register_device(ts->input_dev); //注册这个device
if (ret)
{
GTP_ERROR("Register %s input device failed", ts->input_dev->name);
return -ENODEV;
}
#if GTP_WITH_PEN
gtp_pen_init(ts);
#endif
return 0;
}
- Goodix系列------input device的init
- Goodix系列------如何取消原生的屏幕上的三个key(如何在java里获取property)
- input device
- input device
- Device Input
- android 5.0的input init过程
- device manager init
- linux input系列------input的初始化
- Linux Input Device
- Unity Mobile Device Input
- Input Device Configuration
- input device 按键处理
- html5系列:device's media capture mechanism(设备的媒体捕捉机制)——利用input:file调用设备的照相机/相册、摄像机、录音机
- Android input device request_irq() 的 注册中断服务
- [知其然不知其所以然-1]input device与UI的交互方式
- Linux Input Device 介紹: APIs
- Linux Input Device 介绍: APIs
- Linux Input Device 介绍: APIs
- EM(Expectation-Maximization)算法的浅显理解
- C++的XML编程经验――LIBXML2库使用指南
- [疯狂Java]NIO.2:WatchService、WatchKey(监控文件变化)
- Android从按下开机键到启动发生了什么
- iOS开发:环信实现即时通讯
- Goodix系列------input device的init
- RSA算法原理
- 【Android基础】webview加载网页出现("找不到网页net:err_unknown_url_scheme")
- 数据时代技能书单
- Linux的sed和awk
- DrawCall相关优化(Unity 5.4)
- LR中忽略Socket接收数据长度验证
- 【bzoj1610】【Usaco2008 Feb】Line连线游戏
- 如何让网页上的失效图片,显示默认缺省图片