linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Linux Input <linux-input@vger.kernel.org>, devicetree@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: input: Convert gpio-keys bindings to schema
Date: Thu, 23 Jan 2020 19:35:06 -0600	[thread overview]
Message-ID: <CAL_JsqLNG0i9QbRiueXAZ6LjAGN7Mx0vaoUM43np8Jn4qOuiZg@mail.gmail.com> (raw)
In-Reply-To: <20200123222508.GB184237@dtor-ws>

On Thu, Jan 23, 2020 at 4:25 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Hi Rob,
>
> On Thu, Jan 23, 2020 at 03:42:22PM -0600, Rob Herring wrote:
> > Convert the gpio-keys and gpio-keys-polled bindings to a DT schema. As
> > both bindings are almost the same, combine them into a single schema.
> >
> > The binding said 'interrupts' was required, but testing on dts files
> > showed that it isn't required.
> >
> > 'linux,input-value' was only documented for gpio-keys-polled, but there
> > doesn't seem to be any reason for it to be specific to that.
>
> Actually, there is: with gpio-keys-polled we take a "snapshot" of the
> entire device state, so we know when to generate a 0 event (the example
> we have a device with several GPIOs with values assigned 1, 2, 3, 4, 5..
> values, when one of the gpios is active we generate event with given
> value, when all are inactive we generate 0 event). This does not work
> for interrupt-only driven device.

Okay, it wasn't clear to me reading the binding doc. I'll make it conditional.


> > +      properties:
> > +        gpios:
> > +          maxItems: 1

> > +
> > +        interrupts:
> > +          maxItems: 1
>
> We support "interrupt-only" mode where we do not have GPIO, so for
> "gpio-keys" we need either interrupts or gpios or both, and for polled
> we must have gpios (and I guess we simply ignore interrupts if they are
> specified).
>
> Does this binding manages to enforce this?

Yes, this hunk does that:

+      anyOf:
+        - required:
+            - interrupts
+        - required:
+            - gpios

Rob

  reply	other threads:[~2020-01-24  1:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 21:42 [PATCH] dt-bindings: input: Convert gpio-keys bindings to schema Rob Herring
2020-01-23 22:25 ` Dmitry Torokhov
2020-01-24  1:35   ` Rob Herring [this message]
2020-01-27  2:30     ` Dmitry Torokhov

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=CAL_JsqLNG0i9QbRiueXAZ6LjAGN7Mx0vaoUM43np8Jn4qOuiZg@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.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).