From: Rob Herring <robh+dt@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
"kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: Re: [PATCH v3] Input: rotary_encoder - support binary encoding of states
Date: Thu, 7 Apr 2016 17:45:00 -0500 [thread overview]
Message-ID: <CAL_JsqLfQQu69LcsFuJkKmjppp047vW5Ga+y5XiDAAG-Weh6ug@mail.gmail.com> (raw)
In-Reply-To: <1460055528-13814-1-git-send-email-u.kleine-koenig@pengutronix.de>
On Thu, Apr 7, 2016 at 1:58 PM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> It's not advisable to use this encoding, but to support existing devices
> add support for this to the driver.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Ack for the binding, but...
> @@ -213,6 +222,17 @@ static int rotary_encoder_probe(struct platform_device *pdev)
> encoder->rollover =
> device_property_read_bool(dev, "rotary-encoder,rollover");
>
> + err = device_property_read_string(dev, "rotary-encoder,encoding",
> + &encoding);
> + if (!err && !strcmp(encoding, "binary")) {
> + encoder->encoding = ROTENC_BINARY;
> + } else if (err || !strcmp(encoding, "gray")) {
> + encoder->encoding = ROTENC_GRAY;
> + } else {
> + dev_err(dev, "unknown encoding setting");
> + return -EINVAL;
device_property_match_string() here instead.
> + }
> +
> device_property_read_u32(dev, "linux,axis", &encoder->axis);
> encoder->relative_axis =
> device_property_read_bool(dev, "rotary-encoder,relative-axis");
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-04-07 22:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-07 18:58 [PATCH v3] Input: rotary_encoder - support binary encoding of states Uwe Kleine-König
2016-04-07 22:45 ` Rob Herring [this message]
[not found] ` <CAL_JsqLfQQu69LcsFuJkKmjppp047vW5Ga+y5XiDAAG-Weh6ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-08 6:40 ` Uwe Kleine-König
[not found] ` <20160408064058.GC10108-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2016-04-11 15:32 ` Rob Herring
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_JsqLfQQu69LcsFuJkKmjppp047vW5Ga+y5XiDAAG-Weh6ug@mail.gmail.com \
--to=robh+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-input@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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).