mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 14:40:55 +07:00
Input: atmel_mxt_ts - use T9 reportid range to init number of mt slots
Atmel mxt devices can report one finger for each T9 reportid. Therefore, this range can be used to report the max number of MT-B slots to userspace instead of assuming a fixed 10. Note that mxt_initialized() must complete early, since the input_dev properties now depend on values in the object table. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
This commit is contained in:
parent
04a79181c4
commit
cb15911509
@ -212,8 +212,6 @@
|
|||||||
/* Touchscreen absolute values */
|
/* Touchscreen absolute values */
|
||||||
#define MXT_MAX_AREA 0xff
|
#define MXT_MAX_AREA 0xff
|
||||||
|
|
||||||
#define MXT_MAX_FINGER 10
|
|
||||||
|
|
||||||
struct mxt_info {
|
struct mxt_info {
|
||||||
u8 family_id;
|
u8 family_id;
|
||||||
u8 variant_id;
|
u8 variant_id;
|
||||||
@ -1086,6 +1084,7 @@ static int __devinit mxt_probe(struct i2c_client *client,
|
|||||||
struct mxt_data *data;
|
struct mxt_data *data;
|
||||||
struct input_dev *input_dev;
|
struct input_dev *input_dev;
|
||||||
int error;
|
int error;
|
||||||
|
unsigned int num_mt_slots;
|
||||||
|
|
||||||
if (!pdata)
|
if (!pdata)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -1115,6 +1114,10 @@ static int __devinit mxt_probe(struct i2c_client *client,
|
|||||||
|
|
||||||
mxt_calc_resolution(data);
|
mxt_calc_resolution(data);
|
||||||
|
|
||||||
|
error = mxt_initialize(data);
|
||||||
|
if (error)
|
||||||
|
goto err_free_mem;
|
||||||
|
|
||||||
__set_bit(EV_ABS, input_dev->evbit);
|
__set_bit(EV_ABS, input_dev->evbit);
|
||||||
__set_bit(EV_KEY, input_dev->evbit);
|
__set_bit(EV_KEY, input_dev->evbit);
|
||||||
__set_bit(BTN_TOUCH, input_dev->keybit);
|
__set_bit(BTN_TOUCH, input_dev->keybit);
|
||||||
@ -1128,9 +1131,10 @@ static int __devinit mxt_probe(struct i2c_client *client,
|
|||||||
0, 255, 0, 0);
|
0, 255, 0, 0);
|
||||||
|
|
||||||
/* For multi touch */
|
/* For multi touch */
|
||||||
error = input_mt_init_slots(input_dev, MXT_MAX_FINGER);
|
num_mt_slots = data->T9_reportid_max - data->T9_reportid_min + 1;
|
||||||
|
error = input_mt_init_slots(input_dev, num_mt_slots);
|
||||||
if (error)
|
if (error)
|
||||||
goto err_free_mem;
|
goto err_free_object;
|
||||||
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR,
|
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR,
|
||||||
0, MXT_MAX_AREA, 0, 0);
|
0, MXT_MAX_AREA, 0, 0);
|
||||||
input_set_abs_params(input_dev, ABS_MT_POSITION_X,
|
input_set_abs_params(input_dev, ABS_MT_POSITION_X,
|
||||||
@ -1143,10 +1147,6 @@ static int __devinit mxt_probe(struct i2c_client *client,
|
|||||||
input_set_drvdata(input_dev, data);
|
input_set_drvdata(input_dev, data);
|
||||||
i2c_set_clientdata(client, data);
|
i2c_set_clientdata(client, data);
|
||||||
|
|
||||||
error = mxt_initialize(data);
|
|
||||||
if (error)
|
|
||||||
goto err_free_mem;
|
|
||||||
|
|
||||||
error = request_threaded_irq(client->irq, NULL, mxt_interrupt,
|
error = request_threaded_irq(client->irq, NULL, mxt_interrupt,
|
||||||
pdata->irqflags, client->name, data);
|
pdata->irqflags, client->name, data);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user