mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
sec_mmi: Get finger size from dts
Get max finger siza major and minor value from dts. If this is not set, use default value 255. Change-Id: Ide50ca02521acdb02529764e061deb689956197f Signed-off-by: haojl2 <haojl2@motorola.com> Reviewed-on: https://gerrit.mot.com/1484433 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Konstantin Makariev <kmakariev@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
20f126bfcb
commit
fa376c6ac2
2 changed files with 13 additions and 2 deletions
|
|
@ -1200,6 +1200,7 @@ static int sec_ts_parse_dt(struct i2c_client *client)
|
|||
struct sec_ts_plat_data *pdata = dev->platform_data;
|
||||
struct device_node *np = dev->of_node;
|
||||
u32 coords[2];
|
||||
u32 finger_size[2];
|
||||
int ret = 0;
|
||||
int count = 0;
|
||||
u32 ic_match_value;
|
||||
|
|
@ -1276,6 +1277,14 @@ static int sec_ts_parse_dt(struct i2c_client *client)
|
|||
pdata->max_y = coords[1] - 1;
|
||||
}
|
||||
|
||||
if (of_property_read_u32_array(np, "sec,max_finger_size", finger_size, 2)) {
|
||||
pdata->max_major = 255;
|
||||
pdata->max_minor = 255;
|
||||
} else {
|
||||
pdata->max_major = finger_size[0] - 1;
|
||||
pdata->max_minor = finger_size[1] - 1;
|
||||
}
|
||||
|
||||
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));
|
||||
|
|
@ -1427,8 +1436,8 @@ static void sec_ts_set_input_prop(struct sec_ts_data *ts, struct input_dev *dev,
|
|||
|
||||
input_set_abs_params(dev, ABS_MT_POSITION_X, 0, ts->plat_data->max_x, 0, 0);
|
||||
input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, ts->plat_data->max_y, 0, 0);
|
||||
input_set_abs_params(dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
|
||||
input_set_abs_params(dev, ABS_MT_TOUCH_MINOR, 0, 255, 0, 0);
|
||||
input_set_abs_params(dev, ABS_MT_TOUCH_MAJOR, 0, ts->plat_data->max_major, 0, 0);
|
||||
input_set_abs_params(dev, ABS_MT_TOUCH_MINOR, 0, ts->plat_data->max_minor, 0, 0);
|
||||
input_set_abs_params(dev, ABS_MT_CUSTOM, 0, 0xFFFFFFFF, 0, 0);
|
||||
if (ts->plat_data->support_mt_pressure)
|
||||
input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
|
||||
|
|
|
|||
|
|
@ -737,6 +737,8 @@ struct sec_ts_data {
|
|||
struct sec_ts_plat_data {
|
||||
int max_x;
|
||||
int max_y;
|
||||
int max_major;
|
||||
int max_minor;
|
||||
unsigned rst_gpio;
|
||||
unsigned irq_gpio;
|
||||
int irq_type;
|
||||
|
|
|
|||
Loading…
Reference in a new issue