linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff LaBundy <jeff@labundy.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Stefan Hansson <newbie13xd@gmail.com>,
	Andreas Kemnade <andreas@kemnade.info>
Subject: Re: [RFC PATCH 1/2] dt-bindings: input: gpio-keys: enforce node names to match all properties
Date: Sun, 5 Jun 2022 11:28:20 -0500	[thread overview]
Message-ID: <20220605162820.GA12875@nixie71> (raw)
In-Reply-To: <fd5833ac-2f8c-98ce-a9bd-188c90cda6f5@linaro.org>

Hi Krzysztof,

On Sun, Jun 05, 2022 at 05:12:42PM +0200, Krzysztof Kozlowski wrote:
> On 04/06/2022 05:04, Jeff LaBundy wrote:
> >> -      dependencies:
> >> -        wakeup-event-action: [ wakeup-source ]
> >> -        linux,input-value: [ gpios ]
> >> -
> >> -      unevaluatedProperties: false
> >> +  "^(key|key-[a-z0-9-]+|[a-z0-9-]+-key)$":
> > 
> > Maybe this would be better as:
> > 
> > "^((key|switch|axis)|(key|switch|axis)-[a-z0-9-]+|[a-z0-9-]+-(key|switch|axis))$":
> > 
> > ...or perhaps a more efficient version of my counter-proposal.
> > 
> > The reason is because it is confusing to see a lid or dock switch named
> > as "key-lid", etc.
> 
> Nice point. "switch" I understand, but can you really have "axis" on
> GPIO keys? I had impression axis is related to joysticks.

I do not think it is very common, but technically we can use gpio-keys
to create coarse sliders as follows:

- linux,code = ABS_X (or ABS_Y, etc.)
- linux,input-type = EV_ABS
- linux,input-value = 0, 10, 20...

Trying to encode all possible values for linux,input-type (EV_*) in the
pattern is not reasonable, so maybe a compromise would be to use 'event'
in place of 'key|switch' because events are what we are ultimately trying
to describe here.

That being said, these are special cases and I don't feel strongly against
simply using 'key|switch' for now as those are by far the most common use-
cases. Another compromise is 'key|switch|event', with 'event' available as
a catch-all for these special cases.

> 
> 
> Best regards,
> Krzysztof

Kind regards,
Jeff LaBundy

  reply	other threads:[~2022-06-05 16:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03 10:15 [RFC PATCH 0/2] dt-bindings: input: gpio-keys: rework matching children Krzysztof Kozlowski
2022-06-03 10:16 ` [RFC PATCH 1/2] dt-bindings: input: gpio-keys: enforce node names to match all properties Krzysztof Kozlowski
2022-06-03 18:30   ` Rob Herring
2022-06-04  3:04   ` Jeff LaBundy
2022-06-05 15:12     ` Krzysztof Kozlowski
2022-06-05 16:28       ` Jeff LaBundy [this message]
2022-06-03 10:16 ` [RFC PATCH 2/2] dt-bindings: input: gpio-keys: document label and autorepeat properties Krzysztof Kozlowski
2022-06-03 16:43   ` Dmitry Torokhov
2022-06-05 15:15     ` Krzysztof Kozlowski
2022-06-08 21:20       ` Rob Herring
2022-06-09  6:52         ` Krzysztof Kozlowski

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=20220605162820.GA12875@nixie71 \
    --to=jeff@labundy.com \
    --cc=andreas@kemnade.info \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=newbie13xd@gmail.com \
    --cc=robh+dt@kernel.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).