mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
sec_mmi: report major and minor value in pixel unit.
If dts defined size to pixel factor, report those two value in pixel unit. Change-Id: Ie89e8d9427cc80d82a742e4ab2efbe8c468ac16e Signed-off-by: haojl2 <haojl2@motorola.com> Reviewed-on: https://gerrit.mot.com/1493096 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
ebdae4dd88
commit
0844bfbb61
2 changed files with 15 additions and 4 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue