linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] input: rotary_encoder: use more than two gpios as input
@ 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
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2015-12-02 10:07 UTC (permalink / raw)
  To: Guido Martínez, Ezequiel Garcia, Rob Herring,
	Dmitry Torokhov, Sylvain Rochet, Johan Hovold, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik
  Cc: linux-arm-kernel, kernel, devicetree, linux-input

Hello,

some time ago I worked on the rotary encoder driver to make it support
more than two input lines. This is the (only slightly tested[1]) rebase of
this series on top of 4.4-rc2 (from 4.1).

It would be great to get some feedback, especially (but not only) for my
change to raumfeld.c.

Before Ezequiel's patch 3a341a4c30d4 ("Input: rotary-encoder - add
support for quarter-period mode") we had a dt property
"rotary-encoder,half-period" defined. It's presence meant that we had 2
indents per period; it's absence that there is only 1. Ezequiel
introduced rotary-encoder,steps-per-period instead when adding support
for quarter-period mode (which has 4 indents per period).

Up to now (i.e. with two inputs) a period has length 4. Now with (say)
four inputs a period has length 16 instead. Now how should this be
modeled in dt? This series implements that I have to pass

	rotary-encoder,steps-per-period = <16>;

now for "quarter-period mode" (i.e. 4 indents per 4 state changes[2]),
but that feels unnatural. I'd prefer to set a property to <1> instead,
meaning the device has an indent for each state change[2]. half-period
mode would be <2> and full-period mode would be <4>. But I don't have a
nice name for such a property and maybe it's easier to live with
steps-per-period = <16>? What do you think?

Also note that these patches are not as technically versatile as
possible. With 4 (n) input lines we could detect a quick rotation where the
machine's latency only allows to sample after 7 (2^(n-1)-1) state
changes. Currently this is not implemented, but can be done later.

Best regards
Uwe

[1] the machine that has the device is ~600 km away from me
[2] if you have a better word for that, please tell me.

Uwe Kleine-König (3):
  input: rotary_encoder: make use of devm_* to simplify .probe and
    .remove
  input: rotary_encoder: move configuration data to driver data
  input: rotary_encoder: support more than 2 gpios as input

 .../devicetree/bindings/input/rotary-encoder.txt   |   2 +-
 arch/arm/mach-pxa/raumfeld.c                       |  25 +-
 drivers/input/misc/rotary_encoder.c                | 283 ++++++++++-----------
 include/linux/rotary_encoder.h                     |   4 -
 4 files changed, 153 insertions(+), 161 deletions(-)

-- 
2.6.2

--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-12-07  9:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH RFC 1/3] input: rotary_encoder: make use of devm_* to simplify .probe and .remove 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 ` [PATCH RFC 3/3] input: rotary_encoder: support more than 2 gpios as input 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 12:52 ` [PATCH RFC 0/3] input: rotary_encoder: use more than two " Rojhalat Ibrahim
2015-12-02 18:59   ` Uwe Kleine-König
2015-12-03 13:01     ` Rojhalat Ibrahim
2015-12-05 19:50       ` Daniel Mack
2015-12-07  9:01         ` Rojhalat Ibrahim

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).