All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Sebastian Reichel <sre@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] Input: of_touchscreen - fix setting max values on X/Y axis
Date: Tue, 7 Jul 2015 12:37:31 +0300	[thread overview]
Message-ID: <559B9DDB.6080606@ti.com> (raw)
In-Reply-To: <1436228849-29530-2-git-send-email-dmitry.torokhov@gmail.com>

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?

>   						&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",
>

cheers,
-roger

WARNING: multiple messages have this Message-ID (diff)
From: Roger Quadros <rogerq@ti.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	<linux-input@vger.kernel.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Sebastian Reichel <sre@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] Input: of_touchscreen - fix setting max values on X/Y axis
Date: Tue, 7 Jul 2015 12:37:31 +0300	[thread overview]
Message-ID: <559B9DDB.6080606@ti.com> (raw)
In-Reply-To: <1436228849-29530-2-git-send-email-dmitry.torokhov@gmail.com>

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?

>   						&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",
>

cheers,
-roger

  reply	other threads:[~2015-07-07  9:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07  0:27 [PATCH 1/3] Input: of_touchscreen - always issue warning if axis is not set up Dmitry Torokhov
2015-07-07  0:27 ` [PATCH 2/3] Input: of_touchscreen - fix setting max values on X/Y axis Dmitry Torokhov
2015-07-07  9:37   ` Roger Quadros [this message]
2015-07-07  9:37     ` Roger Quadros
2015-07-07 16:25     ` Dmitry Torokhov
2015-07-08  7:59       ` Roger Quadros
2015-07-08  7:59         ` Roger Quadros
2015-07-08 15:08         ` Dmitry Torokhov
2015-07-09  8:32           ` Roger Quadros
2015-07-09  8:32             ` Roger Quadros
2015-07-09 18:16             ` Dmitry Torokhov
2015-07-10  8:32               ` Roger Quadros
2015-07-10  8:32                 ` Roger Quadros
2015-07-07  0:27 ` [PATCH 3/3] Input: of_touchscreen - switch to using device properties 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=559B9DDB.6080606@ti.com \
    --to=rogerq@ti.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=pavel@ucw.cz \
    --cc=sre@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.