linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Daniel Mack <daniel@caiaq.de>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH 4/4] input: dynamically allocate ABS information
Date: Wed, 21 Jul 2010 01:30:48 -0700	[thread overview]
Message-ID: <20100721083048.GA21558@core.coreip.homeip.net> (raw)
In-Reply-To: <20100616083903.GU17833@buzzloop.caiaq.de>

On Wed, Jun 16, 2010 at 10:39:03AM +0200, Daniel Mack wrote:
> Hi Dmitry,
> 
> On Mon, May 24, 2010 at 09:15:28AM -0700, Dmitry Torokhov wrote:
> > On Mon, May 24, 2010 at 06:08:05PM +0200, Daniel Mack wrote:
> > > any feelings about this approach?
> > > 
> > 
> > Still pondering...I applied the very first patch though...
> 
> Any news about this? I have no problem throwing away the whole patch set
> and use a different approach, if there is any :)
> 

Daniel,

The approach is pretty solid, with the exception that I do not think
we'd save much if we allocate every axis data separately (as I mentioned
in one of my earlier mails).

Coudl you please take a look at the following patches and let me know if
you see something wrong.

Thanks!

-- 
Dmitry


Input: add static inline accessors for ABS properties

From: Daniel Mack <daniel@caiaq.de>

In preparation for dynamically allocated ABS axis, introduce a number of
sttaic inline access helpers. This should make the transition less
painful.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 include/linux/input.h |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)


diff --git a/include/linux/input.h b/include/linux/input.h
index 339d043..4a55311 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1469,6 +1469,36 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
 	dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
 }
 
+#define INPUT_GENERATE_ABS_ACCESSORS(_suffix, _item)			\
+static inline int input_abs_get_##_suffix(struct input_dev *dev,	\
+					  unsigned int axis)		\
+{									\
+	return dev->abs##_item[axis];					\
+}									\
+									\
+static inline void input_abs_set_##_suffix(struct input_dev *dev,	\
+					   unsigned int axis, int val)	\
+{									\
+	dev->abs##_item[axis] = val;					\
+}
+
+INPUT_GENERATE_ABS_ACCESSORS(min, min)
+INPUT_GENERATE_ABS_ACCESSORS(max, max)
+INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz)
+INPUT_GENERATE_ABS_ACCESSORS(flat, flat)
+INPUT_GENERATE_ABS_ACCESSORS(res, res)
+
+static inline int input_abs_get_val(struct input_dev *dev, unsigned int axis)
+{
+	return dev->abs[axis];
+}
+
+static inline void input_abs_set_val(struct input_dev *dev,
+				     unsigned int axis, int val)
+{
+	dev->abs[axis] = val;
+}
+
 int input_get_keycode(struct input_dev *dev,
 		      unsigned int scancode, unsigned int *keycode);
 int input_set_keycode(struct input_dev *dev,

  reply	other threads:[~2010-07-21  8:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 17:22 [RFC] linux-input: dynamically allocate ABS axis information Daniel Mack
2010-05-19 17:22 ` [PATCH 1/4] input: use ABS_CNT rather than (ABS_MAX + 1) Daniel Mack
2010-05-19 17:22 ` [PATCH 2/4] input: add static inline helpers for ABS properties Daniel Mack
2010-05-19 17:22 ` [PATCH 3/4] input: switch to input_abs_*() access functions Daniel Mack
2010-07-14  8:09   ` Dmitry Torokhov
2010-05-19 17:22 ` [PATCH 4/4] input: dynamically allocate ABS information Daniel Mack
2010-05-24 16:08   ` Daniel Mack
2010-05-24 16:15     ` Dmitry Torokhov
2010-06-16  8:39       ` Daniel Mack
2010-07-21  8:30         ` Dmitry Torokhov [this message]
2010-07-21  8:31           ` Dmitry Torokhov
2010-07-21  8:32             ` Dmitry Torokhov
2010-07-21  9:22               ` ext-phil.2.carmody
2010-07-21 10:42                 ` Artem Bityutskiy
2010-08-11  7:02             ` Daniel Mack
2010-08-13  3:35               ` Dmitry Torokhov
2010-08-07 15:23           ` Daniel Mack
2010-08-11  3:29             ` Dmitry Torokhov
2010-07-14  8:18   ` Dmitry Torokhov

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=20100721083048.GA21558@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=daniel@caiaq.de \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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).