Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1178711

Re: [PATCH 2/3] Input: of_touchscreen - fix setting max values on X/Y axis

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] Input: of_touchscreen - fix setting max values on X/Y axis
Date Tue, 07 Jul 2015 18:30:03 +0200
Message-ID <pJDUT-7UN-23@gated-at.bofh.it> (permalink)
References <pJoVP-6VB-5@gated-at.bofh.it> <pJoVP-6VB-7@gated-at.bofh.it> <pJxw6-3UB-13@gated-at.bofh.it>
X-Original-To Roger Quadros <rogerq@ti.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=+ij1HnwDKw41Qf/Ll5rXrYJxdmOv1AxDJnhClWH86QQ=; b=zvKkBN0mSX+aA1OUHFM4RNtpQMTC7XOcVrKoXW9pT8qIUfVJpi6LDegjf1Ff7mAF/r QkwEfQJPjQkzE1QGltlEZJPyyCH6DQEraOStQKhH7YOW56BKdYT/tuFnFeuUHmkczQLR 7nM05biY04mMZptZyXY0oeaJ1YpdFOjxmKTPnElhCNAl2ZXdqOirfAR9z0ic/bUXIrLo z+McVMQM6fKLCkt9Z6UU4ZaNgfK7Wl7Ya8/LfJYVnyPQNoLtgbDhdYgzwCK98VRtUylZ b//Zah8KTjDsSP6g4PjxNW5ulzRPOOjZCDK0evwqSkRYznSDgaJ0xFQ079NbJoavn23C GsLw==
X-Received by 10.107.137.154 with SMTP id t26mr8204403ioi.13.1436286339616; Tue, 07 Jul 2015 09:25:39 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 72
Organization linux.* mail to news gateway
X-Original-Cc linux-input@vger.kernel.org, Maxime Ripard <maxime.ripard@free-electrons.com>, Sebastian Reichel <sre@kernel.org>, Pavel Machek <pavel@ucw.cz>, linux-kernel@vger.kernel.org
X-Original-Date Tue, 7 Jul 2015 09:25:35 -0700
X-Original-Message-ID <20150707162535.GA12491@dtor-ws>
X-Original-References <1436228849-29530-1-git-send-email-dmitry.torokhov@gmail.com> <1436228849-29530-2-git-send-email-dmitry.torokhov@gmail.com> <559B9DDB.6080606@ti.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1178711

Show key headers only | View raw


Hi Roger,

On Tue, Jul 07, 2015 at 12:37:31PM +0300, Roger Quadros wrote:
> Hi Dmitry,
> 
> On 07/07/15 03:27, Dmitry Torokhov wrote:
> >The binding specification says that "touchscreen-size-x" and "-y" specify
> >horizontal and vertical resolution of the touchscreen and therefore maximum
> >absolute coordinates should be reduced by 1 since we are starting with 0.
> >
> >Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >---
> >  drivers/input/touchscreen/of_touchscreen.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> >diff --git a/drivers/input/touchscreen/of_touchscreen.c b/drivers/input/touchscreen/of_touchscreen.c
> >index 759cf4b..50bc0f2 100644
> >--- a/drivers/input/touchscreen/of_touchscreen.c
> >+++ b/drivers/input/touchscreen/of_touchscreen.c
> >@@ -71,23 +71,25 @@ void touchscreen_parse_of_params(struct input_dev *dev, bool multitouch)
> >
> >  	axis = multitouch ? ABS_MT_POSITION_X : ABS_X;
> >  	data_present = touchscreen_get_prop_u32(np, "touchscreen-size-x",
> >-						input_abs_get_max(dev, axis),
> >+						input_abs_get_max(dev,
> >+								  axis) + 1,
> 
> Why do we need to pass default_value to touchscreen_get_prop_u32()?
> If the property doesn't exist we are not updating the parameter
> anyway right?

The binding can specify max, fuzz, both, or neither. If only one is
specified we do not want to "undo" whatever the driver did (for example
tsc2005 sets up the default maximums before trying to parse OF), so we
fetch the current value and pass it on as default one.

> 
> >  						&maximum) |
> >  		       touchscreen_get_prop_u32(np, "touchscreen-fuzz-x",
> >  						input_abs_get_fuzz(dev, axis),
> >  						&fuzz);
> >  	if (data_present)
> >-		touchscreen_set_params(dev, axis, maximum, fuzz);
> >+		touchscreen_set_params(dev, axis, maximum - 1, fuzz);
> >
> >  	axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y;
> >  	data_present = touchscreen_get_prop_u32(np, "touchscreen-size-y",
> >-						input_abs_get_max(dev, axis),
> >+						input_abs_get_max(dev,
> >+								  axis) + 1,
> >  						&maximum) |
> >  		       touchscreen_get_prop_u32(np, "touchscreen-fuzz-y",
> >  						input_abs_get_fuzz(dev, axis),
> >  						&fuzz);
> >  	if (data_present)
> >-		touchscreen_set_params(dev, axis, maximum, fuzz);
> >+		touchscreen_set_params(dev, axis, maximum - 1, fuzz);
> >
> >  	axis = multitouch ? ABS_MT_PRESSURE : ABS_PRESSURE;
> >  	data_present = touchscreen_get_prop_u32(np, "touchscreen-max-pressure",
> >
> 

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 2/3] Input: of_touchscreen - fix setting max values on  X/Y axis Roger Quadros <rogerq@ti.com> - 2015-07-07 11:40 +0200
  Re: [PATCH 2/3] Input: of_touchscreen - fix setting max values on  X/Y axis Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-07-07 18:30 +0200

csiph-web