diff --git a/drivers/input/touchscreen/sec_mmi/sec_ts.c b/drivers/input/touchscreen/sec_mmi/sec_ts.c index b2dde8c618fa..ce34f7ea0582 100644 --- a/drivers/input/touchscreen/sec_mmi/sec_ts.c +++ b/drivers/input/touchscreen/sec_mmi/sec_ts.c @@ -795,8 +795,10 @@ static void sec_ts_read_event(struct sec_ts_data *ts) input_report_abs(ts->input_dev, ABS_MT_POSITION_X, ts->coord[t_id].x); input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, ts->coord[t_id].y); - input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, ts->coord[t_id].major); - input_report_abs(ts->input_dev, ABS_MT_TOUCH_MINOR, ts->coord[t_id].minor); + input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, + (ts->coord[t_id].major * ts->plat_data->size_to_pixel_multiple_factor) >> 7); + input_report_abs(ts->input_dev, ABS_MT_TOUCH_MINOR, + (ts->coord[t_id].minor * ts->plat_data->size_to_pixel_multiple_factor) >> 7); if (ts->brush_mode) input_report_abs(ts->input_dev, ABS_MT_CUSTOM, (ts->coord[t_id].z << 1) | ts->coord[t_id].palm); else @@ -841,8 +843,10 @@ static void sec_ts_read_event(struct sec_ts_data *ts) input_report_abs(ts->input_dev, ABS_MT_POSITION_X, ts->coord[t_id].x); input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, ts->coord[t_id].y); - input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, ts->coord[t_id].major); - input_report_abs(ts->input_dev, ABS_MT_TOUCH_MINOR, ts->coord[t_id].minor); + input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, + (ts->coord[t_id].major * ts->plat_data->size_to_pixel_multiple_factor) >> 7); + input_report_abs(ts->input_dev, ABS_MT_TOUCH_MINOR, + (ts->coord[t_id].minor * ts->plat_data->size_to_pixel_multiple_factor) >> 7); if (ts->brush_mode) input_report_abs(ts->input_dev, ABS_MT_CUSTOM, (ts->coord[t_id].z << 1) | ts->coord[t_id].palm); else @@ -1285,6 +1289,12 @@ static int sec_ts_parse_dt(struct i2c_client *client) pdata->max_minor = finger_size[1] - 1; } + if (of_property_read_u32(np, "sec,size_to_pixel_multiple_factor", &pdata->size_to_pixel_multiple_factor)) + /* multiple_factor not set in device_tree. Set as default value. + * report major and minor value = raw value * size_to_pixel_multiple_factor / 128 + */ + pdata->size_to_pixel_multiple_factor = 128; + pdata->tsp_id = of_get_named_gpio(np, "sec,tsp-id_gpio", 0); if (gpio_is_valid(pdata->tsp_id)) input_info(true, dev, "%s: TSP_ID : %d\n", __func__, gpio_get_value(pdata->tsp_id)); diff --git a/drivers/input/touchscreen/sec_mmi/sec_ts.h b/drivers/input/touchscreen/sec_mmi/sec_ts.h index 8ba6bab398a6..740596ed2a87 100644 --- a/drivers/input/touchscreen/sec_mmi/sec_ts.h +++ b/drivers/input/touchscreen/sec_mmi/sec_ts.h @@ -739,6 +739,7 @@ struct sec_ts_plat_data { int max_y; int max_major; int max_minor; + int size_to_pixel_multiple_factor; unsigned rst_gpio; unsigned irq_gpio; int irq_type;