lkml.org 
[lkml]   [2022]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] Input: add input_set_property()
Hi Dmitry,

On Mon, Jan 03, 2022 at 10:22:42PM -0800, Dmitry Torokhov wrote:
> > +/**
> > + * 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);
>
> 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/20220108194235.14401-1-jose.exposito89@gmail.com/T/#u

\
 
 \ /
  Last update: 2022-01-08 20:52    [W:0.044 / U:2.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site