由于无法通过浏览器直接访问coding,您需要使用git工具进行下载:
git clone https://e.coding.net/weidongshan/linux/doc_and_source_for_drivers.git
您可以观看百问网的驱动大全视频。
Linux 5.x内核
Linux 4.x内核
设备树
作为一个I2C设备,在某个I2C控制器节点下创建一个子节点。属性包括:
i2c@00000000 {/* ... */gt928@5d {compatible = "goodix,gt928";reg = ;interrupt-parent = ;interrupts = ;irq-gpios = ;reset-gpios = ;};/* ... */};
&i2c2 {gt9xx@5d {compatible = "goodix,gt9xx";reg = ;status = "okay";interrupt-parent = ;interrupts = ;pinctrl-names = "default";pinctrl-0 = ;/*pinctrl-1 = ;*//* pinctrl-names = "default", "int-output-low", "int-output-high", "int-input"; pinctrl-0 = ; pinctrl-1 = ; pinctrl-2 = ; pinctrl-3 = ;*/reset-gpios = ;irq-gpios = ;irq-flags = ; /*1:rising 2: falling*/touchscreen-max-id = ;touchscreen-size-x = ;touchscreen-size-y = ;touchscreen-max-w = ;touchscreen-max-p = ;/*touchscreen-key-map = , ;*/ /*KEY_HOMEPAGE, KEY_BACK*/goodix,type-a-report = ;goodix,driver-send-cfg = ;goodix,create-wr-node = ;goodix,wakeup-with-reset = ;goodix,resume-in-workqueue = ;goodix,int-sync = ;goodix,swap-x2y = ;goodix,esd-protect = ;goodix,pen-suppress-finger = ;goodix,auto-update = ;goodix,auto-update-cfg = ;goodix,power-off-sleep = ;/* ...... */};};
&i2c4 { gt911@5d {compatible = "goodix,gt928";reg = ;interrupt-parent = ;interrupts = ;reset-gpios = ;irq-gpios = ;irq-flags = ; /*1:rising 2: falling*/touchscreen-max-id = ;touchscreen-size-x = ;touchscreen-size-y = ;};};
gtp_proberet = gtp_request_input_dev(ts);ts->input_dev = input_allocate_device();......ret = input_register_device(ts->input_dev);ret = gtp_request_irq(ts);
goodix_ts_probeerror = request_firmware_nowait(THIS_MODULE, true, ts->cfg_name,&client->dev, GFP_KERNEL, ts,goodix_config_cb);goodix_config_cbgoodix_configure_dev(ts);ts->input_dev = devm_input_allocate_device(&ts->client->dev);......error = input_register_device(ts->input_dev);error = goodix_request_irq(ts);
ret = request_threaded_irq(ts->client->irq, NULL,gtp_irq_handler,ts->pdata->irq_flags | IRQF_ONESHOT,ts->client->name,ts);
static int goodix_request_irq(struct goodix_ts_data *ts){return devm_request_threaded_irq(&ts->client->dev, ts->client->irq, NULL, goodix_ts_irq_handler, ts->irq_flags, ts->client->name, ts);}
通过I2C函数读取数据、上报数据。
gtp_irq_handlergtp_work_func(ts);point_state = gtp_get_points(ts, points, &key_value);gtp_i2c_readi2c_transfergtp_mt_slot_report(ts, point_state & 0x0f, points);input_mt_slotinput_mt_report_slot_stateinput_report_abs
goodix_ts_irq_handlergoodix_process_events(ts);touch_num = goodix_ts_read_input_report(ts, point_data);goodix_i2c_readi2c_transfergoodix_ts_report_touch_9binput_mt_slotinput_mt_report_slot_statetouchscreen_report_posinput_report_abs
以上就是DRV_06_I2C接口触摸屏驱动分析的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号