lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 7 Jul 2015 09:25:35 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Roger Quadros <rogerq@...com>
Cc:	linux-input@...r.kernel.org,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	Sebastian Reichel <sre@...nel.org>,
	Pavel Machek <pavel@....cz>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] Input: of_touchscreen - fix setting max values on
 X/Y axis

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@...il.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists