ts->pen_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->pen_dev, 16); //
+ input_mt_init_slots(ts->pen_dev, 16, INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
#else
ts->pen_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
#endif
Executive outcomes.
0: succeed, otherwise: failed.
*******************************************************/
-static s8 gtp_request_input_dev(struct goodix_ts_data *ts)
+static s8 gtp_request_input_dev(struct i2c_client *client,
+ struct goodix_ts_data *ts)
{
s8 ret = -1;
s8 phys[32];
#endif
GTP_DEBUG_FUNC();
- ts->input_dev = input_allocate_device();
+ ts->input_dev = devm_input_allocate_device(&client->dev);
if (ts->input_dev == NULL)
{
GTP_ERROR("Failed to allocate input device.");
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); // in case of "out of memory"
+ input_mt_init_slots(ts->input_dev, 16, INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); // in case of "out of memory"
#else
ts->input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
#endif
GTP_SWAP(ts->abs_x_max, ts->abs_y_max);
}
+#if defined(CONFIG_CHROME_PLATFORMS)
+ input_set_abs_params(ts->input_dev, ABS_X, 0, ts->abs_x_max, 0, 0);
+ input_set_abs_params(ts->input_dev, ABS_Y, 0, ts->abs_y_max, 0, 0);
+#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);
}
#endif
- ret = gtp_request_input_dev(ts);
+ ret = gtp_request_input_dev(client, ts);
if (ret < 0)
{
GTP_ERROR("GTP request input dev failed");
#define GTP_DRIVER_SEND_CFG 1
#define GTP_HAVE_TOUCH_KEY 0
#define GTP_POWER_CTRL_SLEEP 0
+
+#if defined(CONFIG_CHROME_PLATFORMS)
+#define GTP_ICS_SLOT_REPORT 1
+#else
#define GTP_ICS_SLOT_REPORT 0
+#endif
#define GTP_AUTO_UPDATE 0 // auto update fw by .bin file as default
#define GTP_HEADER_FW_UPDATE 0 // auto update fw by gtp_default_FW in gt9xx_firmware.h, function together with GTP_AUTO_UPDATE