From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Daniel Mack <daniel@caiaq.de>, linux-input@vger.kernel.org
Subject: Re: [PATCH] add REL_* axes support to the rotary encoder driver
Date: Wed, 15 Apr 2009 19:33:06 -0700 [thread overview]
Message-ID: <200904151933.06721.dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <BD79186B4FD85F4B8E60E381CAEE1909015F8DFD@mi8nycmail19.Mi8.com>
On Wednesday 15 April 2009 19:24:58 H Hartley Sweeten wrote:
> On Wednesday, April 15, 2009 7:09 PM, Dmitry Torokhov wrote:
> > Hi,
> >
> > On Monday 13 April 2009 16:06:24 H Hartley Sweeten wrote:
> >> +
> >> + unsigned int axis;
> >> + unsigned int pos;
> >> +
> >> + unsigned int irq_a;
> >> + unsigned int irq_b;
> >> +
> >> + unsigned int abs:1;
> >> + unsigned int dir:1;
> >> + unsigned int armed:1;
> >
> > Doing it this way makes us go from simple store to read/modify/write
> > cycle in the interrupt handler.
>
> Didn't think of that. Good catch.
>
> >> +#define ROTARY_ENCODER_REL (0<<31)
> >> +#define ROTARY_ENCODER_ABS (1<<31)
> >
> > Meh... How about below instead?
>
> Your changes look good to me.
>
> The only issue I can see is that absolute axis encoders wrap.
>
> If you have an encoder of something like ABS_VOLUME you would probably
> want the "pos" to go from 0 to "steps" and then clamp. The encoder
> could actually rotate multiple times depending on it's actual line
> count, but the effect would be correct.
I see. Care to prepare a patch? Thanks!
--
Dmitry
next prev parent reply other threads:[~2009-04-16 2:33 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-26 18:00 [PATCH] generic driver for rotary encoders on GPIOs Daniel Mack
2009-02-26 18:42 ` Daniel Mack
2009-02-27 3:18 ` hartleys
2009-02-27 6:43 ` Daniel Mack
2009-02-27 8:48 ` Daniel Mack
2009-02-27 17:13 ` hartleys
2009-02-27 17:17 ` Daniel Mack
2009-02-27 18:00 ` Daniel Mack
2009-02-27 18:30 ` hartleys
2009-02-27 18:34 ` Daniel Mack
2009-02-27 20:15 ` hartleys
2009-03-02 14:43 ` Daniel Mack
2009-03-03 8:52 ` Dmitry Torokhov
2009-03-03 9:03 ` Dmitry Torokhov
2009-03-03 9:59 ` Daniel Mack
2009-03-04 8:48 ` Dmitry Torokhov
2009-03-04 9:50 ` Daniel Mack
2009-03-04 17:02 ` hartleys
2009-03-04 17:20 ` Daniel Mack
2009-03-07 17:06 ` Daniel Mack
2009-04-13 23:06 ` [PATCH] add REL_* axes support to the rotary encoder driver H Hartley Sweeten
2009-04-14 5:50 ` Daniel Mack
2009-04-14 15:33 ` H Hartley Sweeten
2009-04-16 2:08 ` Dmitry Torokhov
2009-04-16 2:24 ` H Hartley Sweeten
2009-04-16 2:33 ` Dmitry Torokhov [this message]
2009-04-16 3:11 ` H Hartley Sweeten
2009-04-16 6:35 ` Daniel Mack
2009-04-16 8:05 ` Daniel Mack
2009-04-16 16:48 ` H Hartley Sweeten
2009-04-16 8:39 ` Daniel Mack
2009-04-16 17:09 ` H Hartley Sweeten
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=200904151933.06721.dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=daniel@caiaq.de \
--cc=hartleys@visionengravers.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).