All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@zonque.org>
To: "Rojhalat Ibrahim" <imr@rtschenk.de>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: devicetree@vger.kernel.org,
	"Sylvain Rochet" <sylvain.rochet@finsecur.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Johan Hovold" <johan@kernel.org>,
	"Haojian Zhuang" <haojian.zhuang@gmail.com>,
	linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de,
	linux-input@vger.kernel.org,
	"Robert Jarzmik" <robert.jarzmik@free.fr>,
	"Guido Martínez" <guido@vanguardiasur.com.ar>,
	"Ezequiel Garcia" <ezequiel@vanguardiasur.com.ar>
Subject: Re: [PATCH RFC 0/3] input: rotary_encoder: use more than two gpios as input
Date: Sat, 5 Dec 2015 20:50:18 +0100	[thread overview]
Message-ID: <56633FFA.5080708@zonque.org> (raw)
In-Reply-To: <21976926.6E4NCDDElu@pcimr>

On 12/03/2015 02:01 PM, Rojhalat Ibrahim wrote:
> On Wednesday 02 December 2015 19:59:20 Uwe Kleine-König wrote:

>> I have a real rotary encoder with 4 input lines and so 16
>> distinguishable positions. It would be described as:
>>
>> 	compatible = "rotary-encoder";
>> 	gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>, <&gpio4 11 GPIO_ACTIVE_HIGH>, <&gpio4 10 GPIO_ACTIVE_HIGH>, <&gpio4 9 GPIO_ACTIVE_HIGH>;
>> 	rotary-encoder,steps = <16>;
>> 	rotary-encoder,steps-per-period = <16>;
>>
>> with the binding implemented in my patches.
>>
>> The wikipedia article about rotary encoders[1] uses a device with 3
>> input lines to explain gray encoding. So I didn't consider "my" device
>> as exotic up to now.
>>
> 
> So you have an absolute encoder. From the state of the four input lines you
> can determine the absolute position value. There is no need to count steps.
> At least that's the original purpose of your device.
> 
> Of course it might be conceivable to use that kind of absolute encoder in an
> incremental way and count the steps throughout multiple revolutions.
> But why would you do that? The resolution of 16 steps per revolution is not
> very good (incremental encoders often have hundreds or thousands of steps per
> revolution). And the whole point of an absolute encoder is that you are able
> to determine the current position at any time just by looking at the inputs
> without having to count steps.

Yes, you're right, that's actually a very different kind of device which
should be supported with a different mode or something, so that the
output of the driver reflects the absolute state of the encoder. This
even simplifies things in the driver: The entire state logic would be
bypassed in this mode, and the current state of the GPIO lines would be
used directly to get the absolute value. Makes sense?


Thanks,
Daniel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: daniel@zonque.org (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 0/3] input: rotary_encoder: use more than two gpios as input
Date: Sat, 5 Dec 2015 20:50:18 +0100	[thread overview]
Message-ID: <56633FFA.5080708@zonque.org> (raw)
In-Reply-To: <21976926.6E4NCDDElu@pcimr>

On 12/03/2015 02:01 PM, Rojhalat Ibrahim wrote:
> On Wednesday 02 December 2015 19:59:20 Uwe Kleine-K?nig wrote:

>> I have a real rotary encoder with 4 input lines and so 16
>> distinguishable positions. It would be described as:
>>
>> 	compatible = "rotary-encoder";
>> 	gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>, <&gpio4 11 GPIO_ACTIVE_HIGH>, <&gpio4 10 GPIO_ACTIVE_HIGH>, <&gpio4 9 GPIO_ACTIVE_HIGH>;
>> 	rotary-encoder,steps = <16>;
>> 	rotary-encoder,steps-per-period = <16>;
>>
>> with the binding implemented in my patches.
>>
>> The wikipedia article about rotary encoders[1] uses a device with 3
>> input lines to explain gray encoding. So I didn't consider "my" device
>> as exotic up to now.
>>
> 
> So you have an absolute encoder. From the state of the four input lines you
> can determine the absolute position value. There is no need to count steps.
> At least that's the original purpose of your device.
> 
> Of course it might be conceivable to use that kind of absolute encoder in an
> incremental way and count the steps throughout multiple revolutions.
> But why would you do that? The resolution of 16 steps per revolution is not
> very good (incremental encoders often have hundreds or thousands of steps per
> revolution). And the whole point of an absolute encoder is that you are able
> to determine the current position at any time just by looking at the inputs
> without having to count steps.

Yes, you're right, that's actually a very different kind of device which
should be supported with a different mode or something, so that the
output of the driver reflects the absolute state of the encoder. This
even simplifies things in the driver: The entire state logic would be
bypassed in this mode, and the current state of the GPIO lines would be
used directly to get the absolute value. Makes sense?


Thanks,
Daniel

  reply	other threads:[~2015-12-05 19:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-02 10:07 [PATCH RFC 0/3] input: rotary_encoder: use more than two gpios as input Uwe Kleine-König
2015-12-02 10:07 ` Uwe Kleine-König
2015-12-02 10:07 ` [PATCH RFC 1/3] input: rotary_encoder: make use of devm_* to simplify .probe and .remove Uwe Kleine-König
2015-12-02 10:07   ` Uwe Kleine-König
     [not found] ` <1449050834-31779-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-12-02 10:07   ` [PATCH RFC 2/3] input: rotary_encoder: move configuration data to driver data Uwe Kleine-König
2015-12-02 10:07     ` Uwe Kleine-König
2015-12-02 10:07 ` [PATCH RFC 3/3] input: rotary_encoder: support more than 2 gpios as input Uwe Kleine-König
2015-12-02 10:07   ` Uwe Kleine-König
     [not found]   ` <1449050834-31779-4-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-12-02 14:29     ` Rob Herring
2015-12-02 14:29       ` Rob Herring
2015-12-02 12:52 ` [PATCH RFC 0/3] input: rotary_encoder: use more than two " Rojhalat Ibrahim
2015-12-02 12:52   ` Rojhalat Ibrahim
2015-12-02 18:59   ` Uwe Kleine-König
2015-12-02 18:59     ` Uwe Kleine-König
2015-12-03 13:01     ` Rojhalat Ibrahim
2015-12-03 13:01       ` Rojhalat Ibrahim
2015-12-05 19:50       ` Daniel Mack [this message]
2015-12-05 19:50         ` Daniel Mack
2015-12-07  9:01         ` Rojhalat Ibrahim
2015-12-07  9:01           ` Rojhalat Ibrahim

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=56633FFA.5080708@zonque.org \
    --to=daniel@zonque.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=guido@vanguardiasur.com.ar \
    --cc=haojian.zhuang@gmail.com \
    --cc=imr@rtschenk.de \
    --cc=johan@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=robert.jarzmik@free.fr \
    --cc=sylvain.rochet@finsecur.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.