linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Dmitry Torokhov
	<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Rojhalat Ibrahim <imr-yYm5e5rpIQsb1SvskN2V4Q@public.gmane.org>,
	Sylvain Rochet
	<sylvain.rochet-ETtyaVkrhkNWk0Htik3J/w@public.gmane.org>,
	Johan Hovold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Ezequiel Garcia
	<ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	Daniel Mack <daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH v2] Input: rotary_encoder - support binary encoding of states
Date: Thu, 7 Apr 2016 20:45:30 +0200	[thread overview]
Message-ID: <20160407184530.GA10108@pengutronix.de> (raw)
In-Reply-To: <20160407181513.GA7283@dtor-ws>

Hello Dmitry,

On Thu, Apr 07, 2016 at 11:15:13AM -0700, Dmitry Torokhov wrote:
> On Thu, Mar 24, 2016 at 08:57:12AM +0100, Uwe Kleine-König wrote:
> > diff --git a/Documentation/devicetree/bindings/input/rotary-encoder.txt b/Documentation/devicetree/bindings/input/rotary-encoder.txt
> > index 6c9f0c8a846c..e85ce3dea480 100644
> > --- a/Documentation/devicetree/bindings/input/rotary-encoder.txt
> > +++ b/Documentation/devicetree/bindings/input/rotary-encoder.txt
> > @@ -20,6 +20,8 @@ Optional properties:
> >    2: Half-period mode
> >    4: Quarter-period mode
> >  - wakeup-source: Boolean, rotary encoder can wake up the system.
> > +- rotary-encoder,encoding: String, the method used to encode steps.
> > +  Supported are "gray" (the default and more common) and "binary".
> >  
> >  Deprecated properties:
> >  - rotary-encoder,half-period: Makes the driver work on half-period mode.
> > [...]
> > +	err = device_property_read_string(dev, "rotary-encoder,encoding",
> > +					  &encoding);
> > +	if (!err && encoding[0] == 'b')
> 
> Why do we only match on first letter? I'd prefer we did better parsing
> (i.e. only accepted valid encodings or no encoding property.

IMHO it's not a problem that

	rotary-encoder,encoding = "blablubfasel";

isn't rejected by interpretet as "binary" instead. That's a bit like
compilers that are free to do whatever they want if the source code
contains something non-standard or undefined.

But I admit this might become a problem when the set of allowed
encodings is expanded in the future. So I will resend a more stricter
version.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2016-04-07 18:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24  7:57 [PATCH v2] Input: rotary_encoder - support binary encoding of states Uwe Kleine-König
2016-03-25 14:21 ` Rob Herring
2016-04-07 18:15 ` Dmitry Torokhov
2016-04-07 18:45   ` Uwe Kleine-König [this message]

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=20160407184530.GA10108@pengutronix.de \
    --to=u.kleine-koenig-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org \
    --cc=imr-yYm5e5rpIQsb1SvskN2V4Q@public.gmane.org \
    --cc=johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sylvain.rochet-ETtyaVkrhkNWk0Htik3J/w@public.gmane.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).