linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Sebastian Reichel <sre@kernel.org>
Cc: dmitry.torokhov@gmail.com, maxime.ripard@free-electrons.com,
	kernel list <linux-kernel@vger.kernel.org>,
	linux-omap@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: of_touchscreen - remove interdependence of max/fuzz values
Date: Sat, 30 May 2015 08:26:51 +0200	[thread overview]
Message-ID: <20150530062651.GA4344@amd> (raw)
In-Reply-To: <1432952674-15228-1-git-send-email-sre@kernel.org>

On Sat 2015-05-30 04:24:34, Sebastian Reichel wrote:
> Commit 3eea8b5d68c8 introduced a dependency between touchscreen-max-*
> and touchscreen-fuzz-*, so that either both must be specified or none
> of them. If only one of them is specified the other value will be
> reset to 0. This commit restores the previous behaviour, that the
> drivers default value will be used for the unspecified value.
> 
> Reported-By: Pavel Machek <pavel@ucw.cz>
> Fixes: 3eea8b5d68c8 (Input: of_touchscreen - rework the DT parsing function)
> Signed-off-by: Sebastian Reichel <sre@kernel.org>
> ---
>  drivers/input/touchscreen/of_touchscreen.c | 25 +++++++++++--------------
>  1 file changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/of_touchscreen.c b/drivers/input/touchscreen/of_touchscreen.c
> index b82b520..7d2cf59 100644
> --- a/drivers/input/touchscreen/of_touchscreen.c
> +++ b/drivers/input/touchscreen/of_touchscreen.c
> @@ -42,8 +42,11 @@ static void touchscreen_set_params(struct input_dev *dev,
>  	}
>  
>  	absinfo = &dev->absinfo[axis];
> -	absinfo->maximum = max;
> -	absinfo->fuzz = fuzz;
> +
> +	if (max)
> +		absinfo->maximum = max;
> +	if (fuzz)
> +		absinfo->fuzz = fuzz;

If driver sets absinfo->fuzz to 5, and then device tree specifies fuzz
of 0, this means it will not be overwritten.

> @@ -65,23 +68,17 @@ void touchscreen_parse_of_params(struct input_dev *dev)
>  
>  	maximum = of_get_optional_u32(np, "touchscreen-size-x");
>  	fuzz = of_get_optional_u32(np, "touchscreen-fuzz-x");
> -	if (maximum || fuzz) {
> -		touchscreen_set_params(dev, ABS_X, maximum, fuzz);
> -		touchscreen_set_params(dev, ABS_MT_POSITION_X, maximum, fuzz);
> -	}
> +	touchscreen_set_params(dev, ABS_X, maximum, fuzz);
> +	touchscreen_set_params(dev, ABS_MT_POSITION_X, maximum, fuzz);

This will introduce warn_on() on axis that are not mentioned in the
device tree. Same problem Dmitry did not like on my patch.
								Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

      reply	other threads:[~2015-05-30  6:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150530022111.GA28241@earth>
2015-05-30  2:24 ` [PATCH] Input: of_touchscreen - remove interdependence of max/fuzz values Sebastian Reichel
2015-05-30  6:26   ` Pavel Machek [this message]

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=20150530062651.GA4344@amd \
    --to=pavel@ucw.cz \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --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 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).