求助,触摸事件上报导致内核崩溃
-
核心代码如下,内核报错内容晚点贴上,这么写看起来应该没啥问题吧
input_report_abs(ts_data->input_dev,ABS_X, 10); input_report_abs(ts_data->input_dev,ABS_Y, 10); input_report_abs(ts_data->input_dev,ABS_PRESSURE, 1); input_report_key(ts_data->input_dev,BTN_TOUCH,1); // //input_mt_sync_frame(ts_data->input_dev); input_sync(ts_data->input_dev); input_report_abs(ts_data->input_dev,ABS_PRESSURE, 0); input_report_key(ts_data->input_dev,BTN_TOUCH,0); input_sync(ts_data->input_dev);
INIT_DELAYED_WORK(&ts_data->poll_work, cst3xx_touch_report1); //INIT_DELAYED_WORK(&poll_work, hyn_interrupt_handler); schedule_delayed_work(&ts_data->poll_work, msecs_to_jiffies(80));
static void cst3xx_touch_report1(struct work_struct *work) { u8 buf[5]; struct delayed_work *dw = container_of(work, struct delayed_work, work); struct hynitron_ts_data *ts_data = container_of(dw, struct hynitron_ts_data, poll_work); if( touch_flag ){ touch_flag = 0; // int err = cst3xx_i2c_read_register(ts_data->client, 0x02, // buf, 5); // if ( err ){ // dev_err(&ts_data->client->dev, "cst3xx touch read failure %d\n",err); // } // printk("touch data is 0x%2x 0x%2x 0x%2x 0x%2x\r\n",buf[1],buf[2],buf[3],buf[4]); cst3xx_touch_report(ts_data->client); } schedule_delayed_work(&ts_data->poll_work, msecs_to_jiffies(80)); }
input = devm_input_allocate_device(dev); if (!input) return -ENOMEM; ts_data->input_dev = input; input->name = client->name; input->id.bustype = BUS_I2C; set_bit(EV_ABS, input->evbit); set_bit(EV_KEY, input->evbit); set_bit(BTN_TOUCH, input->keybit); input_set_abs_params(ts_data->input_dev, ABS_X, 0, 240, 0, 0); input_set_abs_params(ts_data->input_dev, ABS_Y, 0, 280, 0, 0); input_set_abs_params(ts_data->input_dev, ABS_PRESSURE, 0, 1, 0, 0); err = input_register_device(input); if (err) { dev_err(dev, "failed to register input device: %d\n", err); return err; }
-
崩溃的log有吗
-
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号