linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "José Expósito" <jose.exposito89@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: jikos@kernel.org, benjamin.tissoires@redhat.com,
	peter.hutterer@who-t.net, roderick.colenbrander@sony.com,
	pali@kernel.org, rydberg@bitmath.org, nick@shmanahar.org,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] Input: add input_set_property()
Date: Sat, 8 Jan 2022 20:51:20 +0100	[thread overview]
Message-ID: <20220108195120.GA14485@elementary> (raw)
In-Reply-To: <YdPnsiFTc2/7f83z@google.com>

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

  reply	other threads:[~2022-01-08 19:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 11:08 [PATCH v2 0/2] Do not map BTN_RIGHT/MIDDLE on buttonpads José Expósito
2021-12-02 11:08 ` [PATCH v2 1/2] Input: add input_set_property() José Expósito
2022-01-04  6:22   ` Dmitry Torokhov
2022-01-08 19:51     ` José Expósito [this message]
2021-12-02 11:08 ` [PATCH v2 2/2] Input: set INPUT_PROP_BUTTONPAD using input_set_property() José Expósito
2021-12-07  5:03   ` Peter Hutterer
2022-01-04  6:24   ` Dmitry Torokhov
2022-01-04  9:18     ` Benjamin Tissoires
2022-01-06 13:09     ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220108195120.GA14485@elementary \
    --to=jose.exposito89@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick@shmanahar.org \
    --cc=pali@kernel.org \
    --cc=peter.hutterer@who-t.net \
    --cc=roderick.colenbrander@sony.com \
    --cc=rydberg@bitmath.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).