Do not map BTN_RIGHT/MIDDLE on buttonpads
Subsystems (8)
v2 cover Do not map BTN_RIGHT/MIDDLE on buttonpads
Hi all,
This patchset implements the changes to buttonpads discussed in v1:
https://lore.kernel.org/linux-input/YacOmYorwAIB4Q3c@quokka/T/#t
I'd be great to know if maintainers are interested in migrating the other properties to use the new function (input_set_property). If so, I can send the patches :)
Thanks,
Jose
José Expósito (2):
Input: add input_set_property()
Input: set INPUT_PROP_BUTTONPAD using input_set_property()
drivers/hid/hid-alps.c | 2 +- drivers/hid/hid-asus.c | 3 +- drivers/hid/hid-elan.c | 3 +- drivers/hid/hid-logitech-hidpp.c | 2 +- drivers/hid/hid-magicmouse.c | 8 ++---- drivers/hid/hid-multitouch.c | 2 +- drivers/hid/hid-playstation.c | 3 +- drivers/hid/hid-sony.c | 4 +-- drivers/input/input.c | 35 ++++++++++++++++++++++++ drivers/input/keyboard/applespi.c | 2 +- drivers/input/mouse/alps.c | 3 +- drivers/input/mouse/bcm5974.c | 2 +- drivers/input/mouse/cyapa.c | 2 +- drivers/input/mouse/elan_i2c_core.c | 2 +- drivers/input/mouse/elantech.c | 6 ++-- drivers/input/mouse/focaltech.c | 4 +-- drivers/input/mouse/synaptics.c | 2 +- drivers/input/rmi4/rmi_f30.c | 2 +- drivers/input/rmi4/rmi_f3a.c | 2 +- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- include/linux/input.h | 1 + 21 files changed, 57 insertions(+), 35 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/2 Input: add input_set_property()
Buttonpads are expected to map the INPUT_PROP_BUTTONPAD property bit and the BTN_LEFT key bit.
As explained in the specification, where a device has a button type value of 0 (click-pad) or 1 (pressure-pad) there should not be discrete buttons:
https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection#device-capabilities-feature-report
However, some drivers map the BTN_RIGHT and/or BTN_MIDDLE key bits even though the device is a buttonpad and therefore does not have those buttons.
This behavior has forced userspace applications like libinput to implement different workarounds and quirks to detect buttonpads and offer to the user the right set of features and configuration options. For more information:
https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/726
In order to avoid this issue add a helper function for drivers to add device properties and make sure that the conditions associated with the INPUT_PROP_BUTTONPAD property are meet.
Notice that this change will not affect udev because it does not check for buttons. See systemd/src/udev/udev-builtin-input_id.c.
List of known affected hardware:
- Chuwi AeroBook Plus
- Chuwi Gemibook
- Framework Laptop
- GPD Win Max
- Huawei MateBook 2020
- Prestigio Smartbook 141 C2
- Purism Librem 14v1
- StarLite Mk II - AMI firmware - StarLite Mk II - Coreboot firmware - StarLite Mk III - AMI firmware - StarLite Mk III - Coreboot firmware
- StarLabTop Mk IV - AMI firmware
- StarLabTop Mk IV - Coreboot firmware
- StarBook Mk V
--- drivers/input/input.c | 35 +++++++++++++++++++++++++++++++++++ include/linux/input.h | 1 + 2 files changed, 36 insertions(+)
drivers/input/input.c +35 -0
@@ -2125,6 +2125,41 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int }EXPORT_SYMBOL (input_set_capability); +/** +* input_set_property - add a property to the device +* @dev: device to add the property to +* @property: type of the property (INPUT_PROP_POINTER, INPUT_PROP_DIRECT...) +* +* In addition to setting up corresponding bit in dev->propbit the function +* might add or remove related capabilities. +*/ +void input_set_property (struct input_dev *dev,unsigned int property) +{ +switch (property) { +case INPUT_PROP_POINTER : +case INPUT_PROP_DIRECT : +case INPUT_PROP_SEMI_MT : +case INPUT_PROP_TOPBUTTONPAD : +case INPUT_PROP_POINTING_STICK : +case INPUT_PROP_ACCELEROMETER : +break ; + +case INPUT_PROP_BUTTONPAD : +input_set_capability (dev,EV_KEY ,BTN_LEFT ); +__clear_bit (BTN_RIGHT , dev->keybit); +__clear_bit (BTN_MIDDLE , dev->keybit); +break ; + +default : +pr_err ("%s: unknown property %u\n" , __func__, property); +dump_stack (); +return ; + } + +__set_bit (property, dev->propbit); +} +EXPORT_SYMBOL (input_set_property); +static unsigned int input_estimate_events_per_packet (struct input_dev *dev) {int mt_slots;
include/linux/input.h +1 -0
@@ -456,6 +456,7 @@ static inline void input_mt_sync(struct input_dev *dev) }void input_set_capability (struct input_dev *dev,unsigned int type,unsigned int code); +void input_set_property (struct input_dev *dev,unsigned int property);/** * input_set_events_per_packet - tell handlers about the driver event rate
Signature · 1 line
2.25.1
Dmitry Torokhov
maintainerRe: [PATCH v2 1/2] Input: add input_set_property()
Hi José,
Quoted 69 lines · José Expósito
Buttonpads are expected to map the
INPUT_PROP_BUTTONPADproperty bit and theBTN_LEFTkey bit.As explained in the specification, where a device has a button type value of 0 (click-pad) or 1 (pressure-pad) there should not be discrete buttons:
https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection#device-capabilities-feature-reportHowever, some drivers map the
BTN_RIGHTand/orBTN_MIDDLEkey bits even though the device is a buttonpad and therefore does not have those buttons.This behavior has forced userspace applications like libinput to implement different workarounds and quirks to detect buttonpads and offer to the user the right set of features and configuration options. For more information:
https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/726In order to avoid this issue add a helper function for drivers to add device properties and make sure that the conditions associated with the
INPUT_PROP_BUTTONPADproperty are meet.Notice that this change will not affect udev because it does not check for buttons. See
systemd/src/udev/udev-builtin-input_id.c.List of known affected hardware:
- Chuwi AeroBook Plus
- Chuwi Gemibook
- Framework Laptop
- GPD Win Max
- Huawei MateBook 2020
- Prestigio Smartbook 141 C2
- Purism Librem 14v1- StarLite Mk II - AMI firmware - StarLite Mk II - Coreboot firmware - StarLite Mk III - AMI firmware - StarLite Mk III - Coreboot firmware- StarLabTop Mk IV - AMI firmware
- StarLabTop Mk IV - Coreboot firmware
- StarBook Mk VSigned-off-by José Expósito <[email protected]>--- drivers/input/input.c | 35 +++++++++++++++++++++++++++++++++++ include/linux/input.h | 1 + 2 files changed, 36 insertions(+)drivers/input/input.c +13
-0@@ -2125,6 +2125,41 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int }EXPORT_SYMBOL (input_set_capability); +/** +* input_set_property - add a property to the device +* @dev: device to add the property to +* @property: type of the property (INPUT_PROP_POINTER, INPUT_PROP_DIRECT...) +* +* In addition to setting up corresponding bit in dev->propbit the function +* might add or remove related capabilities. +*/ +void input_set_property (struct input_dev *dev,unsigned int property) +{ +switch (property) { +case INPUT_PROP_POINTER : +case INPUT_PROP_DIRECT :
drivers/input/input.c void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int · line 2150
Quoted 10 lines
drivers/input/input.c +10
-0+case INPUT_PROP_SEMI_MT : +case INPUT_PROP_TOPBUTTONPAD : +case INPUT_PROP_POINTING_STICK : +case INPUT_PROP_ACCELEROMETER : +break ; + +case INPUT_PROP_BUTTONPAD : +input_set_capability (dev,EV_KEY ,BTN_LEFT ); +__clear_bit (BTN_RIGHT , dev->keybit); +__clear_bit (BTN_MIDDLE , dev->keybit);
I would prefer if we did this when registering input device, not when setting this property.
Quoted 30 lines
drivers/input/input.c +12
-0+break ; + +default : +pr_err ("%s: unknown property %u\n" , __func__, property); +dump_stack (); +return ; + } + +__set_bit (property, dev->propbit); +} +EXPORT_SYMBOL (input_set_property); +static unsigned int input_estimate_events_per_packet (struct input_dev *dev) {int mt_slots;include/linux/input.h +1
-0@@ -456,6 +456,7 @@ static inline void input_mt_sync(struct input_dev *dev) }void input_set_capability (struct input_dev *dev,unsigned int type,unsigned int code); +void input_set_property (struct input_dev *dev,unsigned int property);/** * input_set_events_per_packet - tell handlers about the driver event rate Signature · 1 line
2.25.1
Thanks.
Signature · 1 line
Dmitry
Re: [PATCH v2 1/2] Input: add input_set_property()
Hi Dmitry,
Quoted 18 lines · Dmitry Torokhov
Quoted 18 lines
drivers/input/input.c +18
-0+/** +* input_set_property - add a property to the device +* @dev: device to add the property to +* @property: type of the property (INPUT_PROP_POINTER, INPUT_PROP_DIRECT...) +* +* In addition to setting up corresponding bit in dev->propbit the function +* might add or remove related capabilities. +*/ +void input_set_property (struct input_dev *dev,unsigned int property) +{ +switch (property) { +case INPUT_PROP_POINTER : +case INPUT_PROP_DIRECT : +case INPUT_PROP_SEMI_MT : +case INPUT_PROP_TOPBUTTONPAD : +case INPUT_PROP_POINTING_STICK : +case INPUT_PROP_ACCELEROMETER : +break ;
Quoted 8 lines
drivers/input/input.c void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int · line 2150
Quoted 5 lines
drivers/input/input.c +5
-0+ +case INPUT_PROP_BUTTONPAD : +input_set_capability (dev,EV_KEY ,BTN_LEFT ); +__clear_bit (BTN_RIGHT , dev->keybit); +__clear_bit (BTN_MIDDLE , dev->keybit);I would prefer if we did this when registering input device, not when setting this property.
Thanks a lot for pointing me in this direction.
I emailed you v3 [1] implementing the change you suggested and also including the "Acked-by" tags present in this conversation.
Thanks to everyone for looking into this, appreciate it.
José Expósito
[1] https://lore.kernel.org/linux-input/[email protected]/T/#u
PATCH v2 2/2 Input: set INPUT_PROP_BUTTONPAD using input_set_property()
In reply to José Expósito--- drivers/hid/hid-alps.c | 2 +- drivers/hid/hid-asus.c | 3 +-- drivers/hid/hid-elan.c | 3 +-- drivers/hid/hid-logitech-hidpp.c | 2 +- drivers/hid/hid-magicmouse.c | 8 ++------ drivers/hid/hid-multitouch.c | 2 +- drivers/hid/hid-playstation.c | 3 +-- drivers/hid/hid-sony.c | 4 +--- drivers/input/keyboard/applespi.c | 2 +- drivers/input/mouse/alps.c | 3 +-- drivers/input/mouse/bcm5974.c | 2 +- drivers/input/mouse/cyapa.c | 2 +- drivers/input/mouse/elan_i2c_core.c | 2 +- drivers/input/mouse/elantech.c | 6 ++---- drivers/input/mouse/focaltech.c | 4 +--- drivers/input/mouse/synaptics.c | 2 +- drivers/input/rmi4/rmi_f30.c | 2 +- drivers/input/rmi4/rmi_f3a.c | 2 +- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- 19 files changed, 21 insertions(+), 35 deletions(-)
drivers/hid/hid-alps.c +1 -1
@@ -722,7 +722,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)__set_bit (EV_KEY , input->evbit);if (data->btn_cnt ==1 ) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );for (i =0 ; i < data->btn_cnt; i++)__set_bit (BTN_LEFT + i, input->keybit);
drivers/hid/hid-asus.c +1 -2
@@ -798,8 +798,7 @@ static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) MAX_PRESSURE, 0, 0); } -__set_bit (BTN_LEFT , input->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); ret =input_mt_init_slots (input, drvdata->tp->max_contacts,INPUT_MT_POINTER );
drivers/hid/hid-elan.c +1 -2
@@ -182,8 +182,7 @@ static int elan_input_configured(struct hid_device *hdev, struct hid_input *hi)input_set_abs_params (input,ABS_MT_PRESSURE ,0 ,ELAN_MAX_PRESSURE ,0 ,0 ); -__set_bit (BTN_LEFT , input->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); ret =input_mt_init_slots (input,ELAN_MAX_FINGERS ,INPUT_MT_POINTER );if (ret) {
drivers/hid/hid-logitech-hidpp.c +1 -1
@@ -2679,7 +2679,7 @@ static void wtp_populate_input(struct hidpp_device *hidpp,if (hidpp->quirks &HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS )input_set_capability (input_dev,EV_KEY ,BTN_RIGHT );else -__set_bit (INPUT_PROP_BUTTONPAD , input_dev->propbit); +input_set_property (input_dev,INPUT_PROP_BUTTONPAD );input_mt_init_slots (input_dev, wd->maxcontacts,INPUT_MT_POINTER |INPUT_MT_DROP_UNUSED );
drivers/hid/hid-magicmouse.c +2 -6
@@ -545,11 +545,9 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd__clear_bit (EV_MSC , input->evbit);__clear_bit (BTN_0 , input->keybit); -__clear_bit (BTN_RIGHT , input->keybit); -__clear_bit (BTN_MIDDLE , input->keybit);__set_bit (BTN_MOUSE , input->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit);__set_bit (BTN_TOOL_FINGER , input->keybit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); mt_flags =INPUT_MT_POINTER |INPUT_MT_DROP_UNUSED |INPUT_MT_TRACK ;
@@ -559,8 +557,6 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd* button (BTN_LEFT == BTN_MOUSE). Make sure we don't * advertise buttons that don't exist... */ -__clear_bit (BTN_RIGHT , input->keybit); -__clear_bit (BTN_MIDDLE , input->keybit);__set_bit (BTN_MOUSE , input->keybit);__set_bit (BTN_TOOL_FINGER , input->keybit);__set_bit (BTN_TOOL_DOUBLETAP , input->keybit);
@@ -569,7 +565,7 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd__set_bit (BTN_TOOL_QUINTTAP , input->keybit);__set_bit (BTN_TOUCH , input->keybit);__set_bit (INPUT_PROP_POINTER , input->propbit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); }
drivers/hid/hid-multitouch.c +1 -1
@@ -1287,7 +1287,7 @@ static int mt_touch_input_configured(struct hid_device *hdev, td->is_buttonpad = true;if (td->is_buttonpad) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); app->pending_palm_slots = devm_kcalloc(&hi->input->dev, BITS_TO_LONGS(td->maxcontacts),
drivers/hid/hid-playstation.c +1 -2
@@ -651,8 +651,7 @@ static struct input_dev *ps_touchpad_create(struct hid_device *hdev, int width,return ERR_CAST (touchpad);/* Map button underneath touchpad to BTN_LEFT. */ -input_set_capability (touchpad,EV_KEY ,BTN_LEFT ); -__set_bit (INPUT_PROP_BUTTONPAD , touchpad->propbit); +input_set_property (touchpad,INPUT_PROP_BUTTONPAD );input_set_abs_params (touchpad,ABS_MT_POSITION_X ,0 , width -1 ,0 ,0 );input_set_abs_params (touchpad,ABS_MT_POSITION_Y ,0 , height -1 ,0 ,0 );
drivers/hid/hid-sony.c +1 -3
@@ -1519,9 +1519,7 @@ static int sony_register_touchpad(struct sony_sc *sc, int touch_count, sc->touchpad->name = name;/* We map the button underneath the touchpad to BTN_LEFT. */ -__set_bit (EV_KEY , sc->touchpad->evbit); -__set_bit (BTN_LEFT , sc->touchpad->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , sc->touchpad->propbit); +input_set_property (sc->touchpad,INPUT_PROP_BUTTONPAD );input_set_abs_params (sc->touchpad,ABS_MT_POSITION_X ,0 , w,0 ,0 );input_set_abs_params (sc->touchpad,ABS_MT_POSITION_Y ,0 , h,0 ,0 );
drivers/input/keyboard/applespi.c +1 -1
@@ -1289,7 +1289,7 @@ applespi_register_touchpad_device(struct applespi_data *applespi,input_set_capability (touchpad_input_dev,EV_REL ,REL_Y );__set_bit (INPUT_PROP_POINTER , touchpad_input_dev->propbit); -__set_bit (INPUT_PROP_BUTTONPAD , touchpad_input_dev->propbit); +input_set_property (touchpad_input_dev,INPUT_PROP_BUTTONPAD );/* finger touch area */ input_set_abs_params(touchpad_input_dev, ABS_MT_TOUCH_MAJOR,
drivers/input/mouse/alps.c +1 -2
@@ -3082,8 +3082,7 @@ int alps_init(struct psmouse *psmouse) dev1->keybit[BIT_WORD (BTN_2 )] |=BIT_MASK (BTN_2 ); dev1->keybit[BIT_WORD (BTN_3 )] |=BIT_MASK (BTN_3 ); }else if (priv->flags &ALPS_BUTTONPAD ) { -set_bit (INPUT_PROP_BUTTONPAD , dev1->propbit); -clear_bit (BTN_RIGHT , dev1->keybit); +input_set_property (dev1,INPUT_PROP_BUTTONPAD ); }else { dev1->keybit[BIT_WORD (BTN_MIDDLE )] |=BIT_MASK (BTN_MIDDLE ); }
drivers/input/mouse/bcm5974.c +1 -1
@@ -538,7 +538,7 @@ static void setup_events_to_report(struct input_dev *input_dev,__set_bit (BTN_LEFT , input_dev->keybit);if (cfg->caps &HAS_INTEGRATED_BUTTON ) -__set_bit (INPUT_PROP_BUTTONPAD , input_dev->propbit); +input_set_property (input_dev,INPUT_PROP_BUTTONPAD );input_mt_init_slots (input_dev,MAX_FINGERS ,INPUT_MT_POINTER |INPUT_MT_DROP_UNUSED |INPUT_MT_TRACK );
drivers/input/mouse/cyapa.c +1 -1
@@ -501,7 +501,7 @@ static int cyapa_create_input_dev(struct cyapa *cyapa)__set_bit (BTN_RIGHT , input->keybit);if (cyapa->btn_capability ==CAPABILITY_LEFT_BTN_MASK ) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );/* Handle pointer emulation and unused slots in core */ error = input_mt_init_slots(input, CYAPA_MAX_MT_SLOTS,
drivers/input/mouse/elan_i2c_core.c +1 -1
@@ -1177,7 +1177,7 @@ static int elan_setup_input_device(struct elan_tp_data *data)__set_bit (EV_ABS , input->evbit);__set_bit (INPUT_PROP_POINTER , input->propbit);if (data->clickpad) { -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); }else {__set_bit (BTN_RIGHT , input->keybit);if (data->middle_button)
drivers/input/mouse/elantech.c +2 -4
@@ -1122,10 +1122,8 @@ static void elantech_set_buttonpad_prop(struct psmouse *psmouse)struct input_dev *dev = psmouse->dev;struct elantech_data *etd = psmouse->private; -if (elantech_is_buttonpad (&etd->info)) { -__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); -__clear_bit (BTN_RIGHT , dev->keybit); - } +if (elantech_is_buttonpad (&etd->info)) +input_set_property (dev,INPUT_PROP_BUTTONPAD ); }/*
drivers/input/mouse/focaltech.c +1 -3
@@ -330,8 +330,6 @@ static void focaltech_set_input_params(struct psmouse *psmouse)__clear_bit (EV_REL , dev->evbit);__clear_bit (REL_X , dev->relbit);__clear_bit (REL_Y , dev->relbit); -__clear_bit (BTN_RIGHT , dev->keybit); -__clear_bit (BTN_MIDDLE , dev->keybit);/* * Now set up our capabilities.
@@ -341,7 +339,7 @@ static void focaltech_set_input_params(struct psmouse *psmouse)input_set_abs_params (dev,ABS_MT_POSITION_Y ,0 , priv->y_max,0 ,0 );input_set_abs_params (dev,ABS_TOOL_WIDTH ,0 ,15 ,0 ,0 );input_mt_init_slots (dev,5 ,INPUT_MT_POINTER ); -__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); +input_set_property (dev,INPUT_PROP_BUTTONPAD ); } static int focaltech_read_register(struct ps2dev *ps2dev, int reg,
drivers/input/mouse/synaptics.c +1 -1
@@ -1349,7 +1349,7 @@ static int set_input_params(struct psmouse *psmouse,input_set_capability (dev,EV_KEY ,BTN_0 + i);if (SYN_CAP_CLICKPAD (info->ext_cap_0c)) { -__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); +input_set_property (dev,INPUT_PROP_BUTTONPAD );if (psmouse_matches_pnp_id (psmouse, topbuttonpad_pnp_ids) && !SYN_CAP_EXT_BUTTONS_STICK (info->ext_cap_10))__set_bit (INPUT_PROP_TOPBUTTONPAD , dev->propbit);
drivers/input/rmi4/rmi_f30.c +1 -1
@@ -265,7 +265,7 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,* mapped buttons. */ if (pdata->gpio_data.buttonpad || (button -BTN_LEFT ==1 )) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );return 0 ; }
drivers/input/rmi4/rmi_f3a.c +1 -1
@@ -159,7 +159,7 @@ static int rmi_f3a_map_gpios(struct rmi_function *fn, struct f3a_data *f3a, input->keycodemax = f3a->gpio_count;if (pdata->gpio_data.buttonpad || (button -BTN_LEFT ==1 )) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );return 0 ; }
drivers/input/touchscreen/atmel_mxt_ts.c +1 -1
@@ -2028,7 +2028,7 @@ static void mxt_set_up_as_touchpad(struct input_dev *input_dev, input_dev->name ="Atmel maXTouch Touchpad" ; -__set_bit (INPUT_PROP_BUTTONPAD , input_dev->propbit); +input_set_property (input_dev,INPUT_PROP_BUTTONPAD );input_abs_set_res (input_dev,ABS_X ,MXT_PIXELS_PER_MM );input_abs_set_res (input_dev,ABS_Y ,MXT_PIXELS_PER_MM );
Signature · 1 line
2.25.1
Re: [PATCH v2 2/2] Input: set INPUT_PROP_BUTTONPAD using input_set_property()
Quoted 14 lines · José Expósito
Signed-off-by José Expósito <[email protected]>--- drivers/hid/hid-alps.c | 2 +- drivers/hid/hid-asus.c | 3 +-- drivers/hid/hid-elan.c | 3 +-- drivers/hid/hid-logitech-hidpp.c | 2 +- drivers/hid/hid-magicmouse.c | 8 ++------ drivers/hid/hid-multitouch.c | 2 +- drivers/hid/hid-playstation.c | 3 +-- drivers/hid/hid-sony.c | 4 +--- drivers/input/keyboard/applespi.c | 2 +- drivers/input/mouse/alps.c | 3 +-- drivers/input/mouse/bcm5974.c | 2 +- drivers/input/mouse/cyapa.c | 2 +-
Quoted 8 lines
drivers/input/mouse/elan_i2c_core.c | 2 +- drivers/input/mouse/elantech.c | 6 ++---- drivers/input/mouse/focaltech.c | 4 +--- drivers/input/mouse/synaptics.c | 2 +- drivers/input/rmi4/rmi_f30.c | 2 +- drivers/input/rmi4/rmi_f3a.c | 2 +- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- 19 files changed, 21 insertions(+), 35 deletions(-)
series: Acked-by: Peter Hutterer <[email protected]>
Cheers,
Peter
Dmitry Torokhov
maintainerRe: [PATCH v2 2/2] Input: set INPUT_PROP_BUTTONPAD using input_set_property()
In reply to José ExpósitoHi José,
On Thu, Dec 02, 2021 at 12:08:07PM +0100, José Expósito wrote:
A short description would be appreciated.
Jiri, Benjamin, do you mind if I take this through my tree or you would prefer having this split?
Quoted 314 lines
Signed-off-by José Expósito <[email protected]>--- drivers/hid/hid-alps.c | 2 +- drivers/hid/hid-asus.c | 3 +-- drivers/hid/hid-elan.c | 3 +-- drivers/hid/hid-logitech-hidpp.c | 2 +- drivers/hid/hid-magicmouse.c | 8 ++------ drivers/hid/hid-multitouch.c | 2 +- drivers/hid/hid-playstation.c | 3 +-- drivers/hid/hid-sony.c | 4 +--- drivers/input/keyboard/applespi.c | 2 +- drivers/input/mouse/alps.c | 3 +-- drivers/input/mouse/bcm5974.c | 2 +- drivers/input/mouse/cyapa.c | 2 +- drivers/input/mouse/elan_i2c_core.c | 2 +- drivers/input/mouse/elantech.c | 6 ++---- drivers/input/mouse/focaltech.c | 4 +--- drivers/input/mouse/synaptics.c | 2 +- drivers/input/rmi4/rmi_f30.c | 2 +- drivers/input/rmi4/rmi_f3a.c | 2 +- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- 19 files changed, 21 insertions(+), 35 deletions(-)drivers/hid/hid-alps.c +1
-1@@ -722,7 +722,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)__set_bit (EV_KEY , input->evbit);if (data->btn_cnt ==1 ) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );for (i =0 ; i < data->btn_cnt; i++)__set_bit (BTN_LEFT + i, input->keybit);drivers/hid/hid-asus.c +1
-2@@ -798,8 +798,7 @@ static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) MAX_PRESSURE, 0, 0); } -__set_bit (BTN_LEFT , input->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); ret =input_mt_init_slots (input, drvdata->tp->max_contacts,INPUT_MT_POINTER );drivers/hid/hid-elan.c +1
-2@@ -182,8 +182,7 @@ static int elan_input_configured(struct hid_device *hdev, struct hid_input *hi)input_set_abs_params (input,ABS_MT_PRESSURE ,0 ,ELAN_MAX_PRESSURE ,0 ,0 ); -__set_bit (BTN_LEFT , input->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); ret =input_mt_init_slots (input,ELAN_MAX_FINGERS ,INPUT_MT_POINTER );if (ret) {drivers/hid/hid-logitech-hidpp.c +1
-1@@ -2679,7 +2679,7 @@ static void wtp_populate_input(struct hidpp_device *hidpp,if (hidpp->quirks &HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS )input_set_capability (input_dev,EV_KEY ,BTN_RIGHT );else -__set_bit (INPUT_PROP_BUTTONPAD , input_dev->propbit); +input_set_property (input_dev,INPUT_PROP_BUTTONPAD );input_mt_init_slots (input_dev, wd->maxcontacts,INPUT_MT_POINTER |INPUT_MT_DROP_UNUSED );drivers/hid/hid-magicmouse.c +2
-6@@ -545,11 +545,9 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd__clear_bit (EV_MSC , input->evbit);__clear_bit (BTN_0 , input->keybit); -__clear_bit (BTN_RIGHT , input->keybit); -__clear_bit (BTN_MIDDLE , input->keybit);__set_bit (BTN_MOUSE , input->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit);__set_bit (BTN_TOOL_FINGER , input->keybit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); mt_flags =INPUT_MT_POINTER |INPUT_MT_DROP_UNUSED |INPUT_MT_TRACK ;@@ -559,8 +557,6 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd* button (BTN_LEFT == BTN_MOUSE). Make sure we don't * advertise buttons that don't exist... */ -__clear_bit (BTN_RIGHT , input->keybit); -__clear_bit (BTN_MIDDLE , input->keybit);__set_bit (BTN_MOUSE , input->keybit);__set_bit (BTN_TOOL_FINGER , input->keybit);__set_bit (BTN_TOOL_DOUBLETAP , input->keybit);@@ -569,7 +565,7 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd__set_bit (BTN_TOOL_QUINTTAP , input->keybit);__set_bit (BTN_TOUCH , input->keybit);__set_bit (INPUT_PROP_POINTER , input->propbit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); }drivers/hid/hid-multitouch.c +1
-1@@ -1287,7 +1287,7 @@ static int mt_touch_input_configured(struct hid_device *hdev, td->is_buttonpad = true;if (td->is_buttonpad) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); app->pending_palm_slots = devm_kcalloc(&hi->input->dev, BITS_TO_LONGS(td->maxcontacts),drivers/hid/hid-playstation.c +1
-2@@ -651,8 +651,7 @@ static struct input_dev *ps_touchpad_create(struct hid_device *hdev, int width,return ERR_CAST (touchpad);/* Map button underneath touchpad to BTN_LEFT. */ -input_set_capability (touchpad,EV_KEY ,BTN_LEFT ); -__set_bit (INPUT_PROP_BUTTONPAD , touchpad->propbit); +input_set_property (touchpad,INPUT_PROP_BUTTONPAD );input_set_abs_params (touchpad,ABS_MT_POSITION_X ,0 , width -1 ,0 ,0 );input_set_abs_params (touchpad,ABS_MT_POSITION_Y ,0 , height -1 ,0 ,0 );drivers/hid/hid-sony.c +1
-3@@ -1519,9 +1519,7 @@ static int sony_register_touchpad(struct sony_sc *sc, int touch_count, sc->touchpad->name = name;/* We map the button underneath the touchpad to BTN_LEFT. */ -__set_bit (EV_KEY , sc->touchpad->evbit); -__set_bit (BTN_LEFT , sc->touchpad->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , sc->touchpad->propbit); +input_set_property (sc->touchpad,INPUT_PROP_BUTTONPAD );input_set_abs_params (sc->touchpad,ABS_MT_POSITION_X ,0 , w,0 ,0 );input_set_abs_params (sc->touchpad,ABS_MT_POSITION_Y ,0 , h,0 ,0 );drivers/input/keyboard/applespi.c +1
-1@@ -1289,7 +1289,7 @@ applespi_register_touchpad_device(struct applespi_data *applespi,input_set_capability (touchpad_input_dev,EV_REL ,REL_Y );__set_bit (INPUT_PROP_POINTER , touchpad_input_dev->propbit); -__set_bit (INPUT_PROP_BUTTONPAD , touchpad_input_dev->propbit); +input_set_property (touchpad_input_dev,INPUT_PROP_BUTTONPAD );/* finger touch area */ input_set_abs_params(touchpad_input_dev, ABS_MT_TOUCH_MAJOR,drivers/input/mouse/alps.c +1
-2@@ -3082,8 +3082,7 @@ int alps_init(struct psmouse *psmouse) dev1->keybit[BIT_WORD (BTN_2 )] |=BIT_MASK (BTN_2 ); dev1->keybit[BIT_WORD (BTN_3 )] |=BIT_MASK (BTN_3 ); }else if (priv->flags &ALPS_BUTTONPAD ) { -set_bit (INPUT_PROP_BUTTONPAD , dev1->propbit); -clear_bit (BTN_RIGHT , dev1->keybit); +input_set_property (dev1,INPUT_PROP_BUTTONPAD ); }else { dev1->keybit[BIT_WORD (BTN_MIDDLE )] |=BIT_MASK (BTN_MIDDLE ); }drivers/input/mouse/bcm5974.c +1
-1@@ -538,7 +538,7 @@ static void setup_events_to_report(struct input_dev *input_dev,__set_bit (BTN_LEFT , input_dev->keybit);if (cfg->caps &HAS_INTEGRATED_BUTTON ) -__set_bit (INPUT_PROP_BUTTONPAD , input_dev->propbit); +input_set_property (input_dev,INPUT_PROP_BUTTONPAD );input_mt_init_slots (input_dev,MAX_FINGERS ,INPUT_MT_POINTER |INPUT_MT_DROP_UNUSED |INPUT_MT_TRACK );drivers/input/mouse/cyapa.c +1
-1@@ -501,7 +501,7 @@ static int cyapa_create_input_dev(struct cyapa *cyapa)__set_bit (BTN_RIGHT , input->keybit);if (cyapa->btn_capability ==CAPABILITY_LEFT_BTN_MASK ) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );/* Handle pointer emulation and unused slots in core */ error = input_mt_init_slots(input, CYAPA_MAX_MT_SLOTS,drivers/input/mouse/elan_i2c_core.c +1
-1@@ -1177,7 +1177,7 @@ static int elan_setup_input_device(struct elan_tp_data *data)__set_bit (EV_ABS , input->evbit);__set_bit (INPUT_PROP_POINTER , input->propbit);if (data->clickpad) { -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); }else {__set_bit (BTN_RIGHT , input->keybit);if (data->middle_button)drivers/input/mouse/elantech.c +2
-4@@ -1122,10 +1122,8 @@ static void elantech_set_buttonpad_prop(struct psmouse *psmouse)struct input_dev *dev = psmouse->dev;struct elantech_data *etd = psmouse->private; -if (elantech_is_buttonpad (&etd->info)) { -__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); -__clear_bit (BTN_RIGHT , dev->keybit); - } +if (elantech_is_buttonpad (&etd->info)) +input_set_property (dev,INPUT_PROP_BUTTONPAD ); }/* drivers/input/mouse/focaltech.c +1
-3@@ -330,8 +330,6 @@ static void focaltech_set_input_params(struct psmouse *psmouse)__clear_bit (EV_REL , dev->evbit);__clear_bit (REL_X , dev->relbit);__clear_bit (REL_Y , dev->relbit); -__clear_bit (BTN_RIGHT , dev->keybit); -__clear_bit (BTN_MIDDLE , dev->keybit);/* * Now set up our capabilities. @@ -341,7 +339,7 @@ static void focaltech_set_input_params(struct psmouse *psmouse)input_set_abs_params (dev,ABS_MT_POSITION_Y ,0 , priv->y_max,0 ,0 );input_set_abs_params (dev,ABS_TOOL_WIDTH ,0 ,15 ,0 ,0 );input_mt_init_slots (dev,5 ,INPUT_MT_POINTER ); -__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); +input_set_property (dev,INPUT_PROP_BUTTONPAD ); } static int focaltech_read_register(struct ps2dev *ps2dev, int reg,drivers/input/mouse/synaptics.c +1
-1@@ -1349,7 +1349,7 @@ static int set_input_params(struct psmouse *psmouse,input_set_capability (dev,EV_KEY ,BTN_0 + i);if (SYN_CAP_CLICKPAD (info->ext_cap_0c)) { -__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); +input_set_property (dev,INPUT_PROP_BUTTONPAD );if (psmouse_matches_pnp_id (psmouse, topbuttonpad_pnp_ids) && !SYN_CAP_EXT_BUTTONS_STICK (info->ext_cap_10))__set_bit (INPUT_PROP_TOPBUTTONPAD , dev->propbit);drivers/input/rmi4/rmi_f30.c +1
-1@@ -265,7 +265,7 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,* mapped buttons. */ if (pdata->gpio_data.buttonpad || (button -BTN_LEFT ==1 )) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );return 0 ; }drivers/input/rmi4/rmi_f3a.c +1
-1@@ -159,7 +159,7 @@ static int rmi_f3a_map_gpios(struct rmi_function *fn, struct f3a_data *f3a, input->keycodemax = f3a->gpio_count;if (pdata->gpio_data.buttonpad || (button -BTN_LEFT ==1 )) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );return 0 ; }drivers/input/touchscreen/atmel_mxt_ts.c +1
-1@@ -2028,7 +2028,7 @@ static void mxt_set_up_as_touchpad(struct input_dev *input_dev, input_dev->name ="Atmel maXTouch Touchpad" ; -__set_bit (INPUT_PROP_BUTTONPAD , input_dev->propbit); +input_set_property (input_dev,INPUT_PROP_BUTTONPAD );input_abs_set_res (input_dev,ABS_X ,MXT_PIXELS_PER_MM );input_abs_set_res (input_dev,ABS_Y ,MXT_PIXELS_PER_MM );Signature · 1 line
2.25.1
Signature · 1 line
Dmitry
Benjamin Tissoires
Acked-byRe: [PATCH v2 2/2] Input: set INPUT_PROP_BUTTONPAD using input_set_property()
Quoted 9 lines · Dmitry Torokhov
Hi José,
On Thu, Dec 02, 2021 at 12:08:07PM +0100, José Expósito wrote:
A short description would be appreciated.
Jiri, Benjamin, do you mind if I take this through my tree or you would prefer having this split?
No objections from my side:
Cheers,
Benjamin
Quoted 319 lines
Quoted 313 lines
Signed-off-by José Expósito <[email protected]>--- drivers/hid/hid-alps.c | 2 +- drivers/hid/hid-asus.c | 3 +-- drivers/hid/hid-elan.c | 3 +-- drivers/hid/hid-logitech-hidpp.c | 2 +- drivers/hid/hid-magicmouse.c | 8 ++------ drivers/hid/hid-multitouch.c | 2 +- drivers/hid/hid-playstation.c | 3 +-- drivers/hid/hid-sony.c | 4 +--- drivers/input/keyboard/applespi.c | 2 +- drivers/input/mouse/alps.c | 3 +-- drivers/input/mouse/bcm5974.c | 2 +- drivers/input/mouse/cyapa.c | 2 +- drivers/input/mouse/elan_i2c_core.c | 2 +- drivers/input/mouse/elantech.c | 6 ++---- drivers/input/mouse/focaltech.c | 4 +--- drivers/input/mouse/synaptics.c | 2 +- drivers/input/rmi4/rmi_f30.c | 2 +- drivers/input/rmi4/rmi_f3a.c | 2 +- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- 19 files changed, 21 insertions(+), 35 deletions(-)drivers/hid/hid-alps.c +1
-1@@ -722,7 +722,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)__set_bit (EV_KEY , input->evbit);if (data->btn_cnt ==1 ) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );for (i =0 ; i < data->btn_cnt; i++)__set_bit (BTN_LEFT + i, input->keybit);drivers/hid/hid-asus.c +1
-2@@ -798,8 +798,7 @@ static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) MAX_PRESSURE, 0, 0); } -__set_bit (BTN_LEFT , input->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); ret =input_mt_init_slots (input, drvdata->tp->max_contacts,INPUT_MT_POINTER );drivers/hid/hid-elan.c +1
-2@@ -182,8 +182,7 @@ static int elan_input_configured(struct hid_device *hdev, struct hid_input *hi)input_set_abs_params (input,ABS_MT_PRESSURE ,0 ,ELAN_MAX_PRESSURE ,0 ,0 ); -__set_bit (BTN_LEFT , input->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); ret =input_mt_init_slots (input,ELAN_MAX_FINGERS ,INPUT_MT_POINTER );if (ret) {drivers/hid/hid-logitech-hidpp.c +1
-1@@ -2679,7 +2679,7 @@ static void wtp_populate_input(struct hidpp_device *hidpp,if (hidpp->quirks &HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS )input_set_capability (input_dev,EV_KEY ,BTN_RIGHT );else -__set_bit (INPUT_PROP_BUTTONPAD , input_dev->propbit); +input_set_property (input_dev,INPUT_PROP_BUTTONPAD );input_mt_init_slots (input_dev, wd->maxcontacts,INPUT_MT_POINTER |INPUT_MT_DROP_UNUSED );drivers/hid/hid-magicmouse.c +2
-6@@ -545,11 +545,9 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd__clear_bit (EV_MSC , input->evbit);__clear_bit (BTN_0 , input->keybit); -__clear_bit (BTN_RIGHT , input->keybit); -__clear_bit (BTN_MIDDLE , input->keybit);__set_bit (BTN_MOUSE , input->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit);__set_bit (BTN_TOOL_FINGER , input->keybit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); mt_flags =INPUT_MT_POINTER |INPUT_MT_DROP_UNUSED |INPUT_MT_TRACK ;@@ -559,8 +557,6 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd* button (BTN_LEFT == BTN_MOUSE). Make sure we don't * advertise buttons that don't exist... */ -__clear_bit (BTN_RIGHT , input->keybit); -__clear_bit (BTN_MIDDLE , input->keybit);__set_bit (BTN_MOUSE , input->keybit);__set_bit (BTN_TOOL_FINGER , input->keybit);__set_bit (BTN_TOOL_DOUBLETAP , input->keybit);@@ -569,7 +565,7 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd__set_bit (BTN_TOOL_QUINTTAP , input->keybit);__set_bit (BTN_TOUCH , input->keybit);__set_bit (INPUT_PROP_POINTER , input->propbit); -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); }drivers/hid/hid-multitouch.c +1
-1@@ -1287,7 +1287,7 @@ static int mt_touch_input_configured(struct hid_device *hdev, td->is_buttonpad = true;if (td->is_buttonpad) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); app->pending_palm_slots = devm_kcalloc(&hi->input->dev, BITS_TO_LONGS(td->maxcontacts),drivers/hid/hid-playstation.c +1
-2@@ -651,8 +651,7 @@ static struct input_dev *ps_touchpad_create(struct hid_device *hdev, int width,return ERR_CAST (touchpad);/* Map button underneath touchpad to BTN_LEFT. */ -input_set_capability (touchpad,EV_KEY ,BTN_LEFT ); -__set_bit (INPUT_PROP_BUTTONPAD , touchpad->propbit); +input_set_property (touchpad,INPUT_PROP_BUTTONPAD );input_set_abs_params (touchpad,ABS_MT_POSITION_X ,0 , width -1 ,0 ,0 );input_set_abs_params (touchpad,ABS_MT_POSITION_Y ,0 , height -1 ,0 ,0 );drivers/hid/hid-sony.c +1
-3@@ -1519,9 +1519,7 @@ static int sony_register_touchpad(struct sony_sc *sc, int touch_count, sc->touchpad->name = name;/* We map the button underneath the touchpad to BTN_LEFT. */ -__set_bit (EV_KEY , sc->touchpad->evbit); -__set_bit (BTN_LEFT , sc->touchpad->keybit); -__set_bit (INPUT_PROP_BUTTONPAD , sc->touchpad->propbit); +input_set_property (sc->touchpad,INPUT_PROP_BUTTONPAD );input_set_abs_params (sc->touchpad,ABS_MT_POSITION_X ,0 , w,0 ,0 );input_set_abs_params (sc->touchpad,ABS_MT_POSITION_Y ,0 , h,0 ,0 );drivers/input/keyboard/applespi.c +1
-1@@ -1289,7 +1289,7 @@ applespi_register_touchpad_device(struct applespi_data *applespi,input_set_capability (touchpad_input_dev,EV_REL ,REL_Y );__set_bit (INPUT_PROP_POINTER , touchpad_input_dev->propbit); -__set_bit (INPUT_PROP_BUTTONPAD , touchpad_input_dev->propbit); +input_set_property (touchpad_input_dev,INPUT_PROP_BUTTONPAD );/* finger touch area */ input_set_abs_params(touchpad_input_dev, ABS_MT_TOUCH_MAJOR,drivers/input/mouse/alps.c +1
-2@@ -3082,8 +3082,7 @@ int alps_init(struct psmouse *psmouse) dev1->keybit[BIT_WORD (BTN_2 )] |=BIT_MASK (BTN_2 ); dev1->keybit[BIT_WORD (BTN_3 )] |=BIT_MASK (BTN_3 ); }else if (priv->flags &ALPS_BUTTONPAD ) { -set_bit (INPUT_PROP_BUTTONPAD , dev1->propbit); -clear_bit (BTN_RIGHT , dev1->keybit); +input_set_property (dev1,INPUT_PROP_BUTTONPAD ); }else { dev1->keybit[BIT_WORD (BTN_MIDDLE )] |=BIT_MASK (BTN_MIDDLE ); }drivers/input/mouse/bcm5974.c +1
-1@@ -538,7 +538,7 @@ static void setup_events_to_report(struct input_dev *input_dev,__set_bit (BTN_LEFT , input_dev->keybit);if (cfg->caps &HAS_INTEGRATED_BUTTON ) -__set_bit (INPUT_PROP_BUTTONPAD , input_dev->propbit); +input_set_property (input_dev,INPUT_PROP_BUTTONPAD );input_mt_init_slots (input_dev,MAX_FINGERS ,INPUT_MT_POINTER |INPUT_MT_DROP_UNUSED |INPUT_MT_TRACK );drivers/input/mouse/cyapa.c +1
-1@@ -501,7 +501,7 @@ static int cyapa_create_input_dev(struct cyapa *cyapa)__set_bit (BTN_RIGHT , input->keybit);if (cyapa->btn_capability ==CAPABILITY_LEFT_BTN_MASK ) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );/* Handle pointer emulation and unused slots in core */ error = input_mt_init_slots(input, CYAPA_MAX_MT_SLOTS,drivers/input/mouse/elan_i2c_core.c +1
-1@@ -1177,7 +1177,7 @@ static int elan_setup_input_device(struct elan_tp_data *data)__set_bit (EV_ABS , input->evbit);__set_bit (INPUT_PROP_POINTER , input->propbit);if (data->clickpad) { -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD ); }else {__set_bit (BTN_RIGHT , input->keybit);if (data->middle_button)drivers/input/mouse/elantech.c +2
-4@@ -1122,10 +1122,8 @@ static void elantech_set_buttonpad_prop(struct psmouse *psmouse)struct input_dev *dev = psmouse->dev;struct elantech_data *etd = psmouse->private; -if (elantech_is_buttonpad (&etd->info)) { -__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); -__clear_bit (BTN_RIGHT , dev->keybit); - } +if (elantech_is_buttonpad (&etd->info)) +input_set_property (dev,INPUT_PROP_BUTTONPAD ); }/* drivers/input/mouse/focaltech.c +1
-3@@ -330,8 +330,6 @@ static void focaltech_set_input_params(struct psmouse *psmouse)__clear_bit (EV_REL , dev->evbit);__clear_bit (REL_X , dev->relbit);__clear_bit (REL_Y , dev->relbit); -__clear_bit (BTN_RIGHT , dev->keybit); -__clear_bit (BTN_MIDDLE , dev->keybit);/* * Now set up our capabilities. @@ -341,7 +339,7 @@ static void focaltech_set_input_params(struct psmouse *psmouse)input_set_abs_params (dev,ABS_MT_POSITION_Y ,0 , priv->y_max,0 ,0 );input_set_abs_params (dev,ABS_TOOL_WIDTH ,0 ,15 ,0 ,0 );input_mt_init_slots (dev,5 ,INPUT_MT_POINTER ); -__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); +input_set_property (dev,INPUT_PROP_BUTTONPAD ); } static int focaltech_read_register(struct ps2dev *ps2dev, int reg,drivers/input/mouse/synaptics.c +1
-1@@ -1349,7 +1349,7 @@ static int set_input_params(struct psmouse *psmouse,input_set_capability (dev,EV_KEY ,BTN_0 + i);if (SYN_CAP_CLICKPAD (info->ext_cap_0c)) { -__set_bit (INPUT_PROP_BUTTONPAD , dev->propbit); +input_set_property (dev,INPUT_PROP_BUTTONPAD );if (psmouse_matches_pnp_id (psmouse, topbuttonpad_pnp_ids) && !SYN_CAP_EXT_BUTTONS_STICK (info->ext_cap_10))__set_bit (INPUT_PROP_TOPBUTTONPAD , dev->propbit);drivers/input/rmi4/rmi_f30.c +1
-1@@ -265,7 +265,7 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,* mapped buttons. */ if (pdata->gpio_data.buttonpad || (button -BTN_LEFT ==1 )) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );return 0 ; }drivers/input/rmi4/rmi_f3a.c +1
-1@@ -159,7 +159,7 @@ static int rmi_f3a_map_gpios(struct rmi_function *fn, struct f3a_data *f3a, input->keycodemax = f3a->gpio_count;if (pdata->gpio_data.buttonpad || (button -BTN_LEFT ==1 )) -__set_bit (INPUT_PROP_BUTTONPAD , input->propbit); +input_set_property (input,INPUT_PROP_BUTTONPAD );return 0 ; }drivers/input/touchscreen/atmel_mxt_ts.c +1
-2@@ -2028,7 +2028,7 @@ static void mxt_set_up_as_touchpad(struct input_dev *input_dev, input_dev->name ="Atmel maXTouch Touchpad" ; -__set_bit (INPUT_PROP_BUTTONPAD , input_dev->propbit); +input_set_property (input_dev,INPUT_PROP_BUTTONPAD );input_abs_set_res (input_dev,ABS_X ,MXT_PIXELS_PER_MM );input_abs_set_res (input_dev,ABS_Y ,MXT_PIXELS_PER_MM ); --Quoted 2 lines
2.25.1
--
Dmitry
Re: [PATCH v2 2/2] Input: set INPUT_PROP_BUTTONPAD using input_set_property()
In reply to Dmitry TorokhovQuoted 8 lines · Dmitry Torokhov
Hi José,
On Thu, Dec 02, 2021 at 12:08:07PM +0100, José Expósito wrote:
A short description would be appreciated.
Jiri, Benjamin, do you mind if I take this through my tree or you would prefer having this split?
Please just take it through input.git with
for the HID parts.
Thanks!
Signature · 2 lines
Jiri Kosina SUSE Labs