From patchwork Wed May 19 17:22:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 100968 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4JHOPAB021848 for ; Wed, 19 May 2010 17:24:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754291Ab0ESRXz (ORCPT ); Wed, 19 May 2010 13:23:55 -0400 Received: from buzzloop.caiaq.de ([212.112.241.133]:50837 "EHLO buzzloop.caiaq.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754248Ab0ESRXy (ORCPT ); Wed, 19 May 2010 13:23:54 -0400 Received: from localhost (localhost [127.0.0.1]) by buzzloop.caiaq.de (Postfix) with ESMTP id E1612840029; Wed, 19 May 2010 19:23:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at buzzloop.caiaq.de Received: from buzzloop.caiaq.de ([127.0.0.1]) by localhost (buzzloop.caiaq.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PkAdYFatjPJf; Wed, 19 May 2010 19:23:27 +0200 (CEST) Received: from jup (pd95699b2.dip0.t-ipconnect.de [217.86.153.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by buzzloop.caiaq.de (Postfix) with ESMTPSA id 04334840025; Wed, 19 May 2010 19:22:49 +0200 (CEST) From: Daniel Mack To: linux-kernel@vger.kernel.org Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, Daniel Mack , Dmitry Torokhov Subject: [PATCH 2/4] input: add static inline helpers for ABS properties Date: Wed, 19 May 2010 19:22:35 +0200 Message-Id: <1274289757-2723-3-git-send-email-daniel@caiaq.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1274289757-2723-1-git-send-email-daniel@caiaq.de> References: <1274289757-2723-1-git-send-email-daniel@caiaq.de> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 19 May 2010 17:24:26 +0000 (UTC) diff --git a/include/linux/input.h b/include/linux/input.h index 0e41f77..ff1ee6d 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -1188,6 +1188,66 @@ struct input_dev { }; #define to_input_dev(d) container_of(d, struct input_dev, dev) +static inline int input_abs(struct input_dev *dev, int axis) +{ + return dev->abs[axis]; +} + +static inline int input_abs_max(struct input_dev *dev, int axis) +{ + return dev->absmax[axis]; +} + +static inline int input_abs_min(struct input_dev *dev, int axis) +{ + return dev->absmin[axis]; +} + +static inline int input_abs_fuzz(struct input_dev *dev, int axis) +{ + return dev->absfuzz[axis]; +} + +static inline int input_abs_flat(struct input_dev *dev, int axis) +{ + return dev->absflat[axis]; +} + +static inline int input_abs_res(struct input_dev *dev, int axis) +{ + return dev->absres[axis]; +} + +static inline void input_abs_set(struct input_dev *dev, int axis, int val) +{ + dev->abs[axis] = val; +} + +static inline void input_abs_set_max(struct input_dev *dev, int axis, int val) +{ + dev->absmax[axis] = val; +} + +static inline void input_abs_set_min(struct input_dev *dev, int axis, int val) +{ + dev->absmin[axis] = val; +} + +static inline void input_abs_set_fuzz(struct input_dev *dev, int axis, int val) +{ + dev->absfuzz[axis] = val; +} + +static inline void input_abs_set_flat(struct input_dev *dev, int axis, int val) +{ + dev->absflat[axis] = val; +} + +static inline void input_abs_set_res(struct input_dev *dev, int axis, int val) +{ + dev->absres[axis] = val; +} + /* * Verify that we are in sync with input_device_id mod_devicetable.h #defines */