From: Sebastian Reichel <sre@kernel.org>
To: dmitry.torokhov@gmail.com
Cc: Pavel Machek <pavel@ucw.cz>,
maxime.ripard@free-electrons.com,
kernel list <linux-kernel@vger.kernel.org>,
linux-omap@vger.kernel.org, linux-input@vger.kernel.org,
Sebastian Reichel <sre@kernel.org>
Subject: [PATCH] Input: of_touchscreen - remove interdependence of max/fuzz values
Date: Sat, 30 May 2015 04:24:34 +0200 [thread overview]
Message-ID: <1432952674-15228-1-git-send-email-sre@kernel.org> (raw)
In-Reply-To: <20150530022111.GA28241@earth>
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;
}
/**
@@ -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);
maximum = of_get_optional_u32(np, "touchscreen-size-y");
fuzz = of_get_optional_u32(np, "touchscreen-fuzz-y");
- if (maximum || fuzz) {
- touchscreen_set_params(dev, ABS_Y, maximum, fuzz);
- touchscreen_set_params(dev, ABS_MT_POSITION_Y, maximum, fuzz);
- }
+ touchscreen_set_params(dev, ABS_Y, maximum, fuzz);
+ touchscreen_set_params(dev, ABS_MT_POSITION_Y, maximum, fuzz);
maximum = of_get_optional_u32(np, "touchscreen-max-pressure");
fuzz = of_get_optional_u32(np, "touchscreen-fuzz-pressure");
- if (maximum || fuzz) {
- touchscreen_set_params(dev, ABS_PRESSURE, maximum, fuzz);
- touchscreen_set_params(dev, ABS_MT_PRESSURE, maximum, fuzz);
- }
+ touchscreen_set_params(dev, ABS_PRESSURE, maximum, fuzz);
+ touchscreen_set_params(dev, ABS_MT_PRESSURE, maximum, fuzz);
}
EXPORT_SYMBOL(touchscreen_parse_of_params);
--
2.1.4
next prev parent reply other threads:[~2015-05-30 2:25 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201505241444.41039@pali>
[not found] ` <20150527132545.GA23434@amd>
[not found] ` <20150527133311.GJ30798@pali>
[not found] ` <20150527143722.GA28108@amd>
[not found] ` <20150527145837.GA13223@earth>
2015-05-29 19:08 ` 4.1 touchscreen regression on n900 -- pinpointed [was Re: linux-n900 v4.1-rc4] Pavel Machek
2015-05-29 19:25 ` Pavel Machek
2015-05-29 19:32 ` [PATCH] fix n900 dts file to work around 4.1 touchscreen regression on n900 Pavel Machek
2015-05-29 19:49 ` Felipe Balbi
2015-05-29 19:56 ` Pavel Machek
2015-05-29 20:17 ` Maxime Ripard
2015-05-29 20:21 ` Felipe Balbi
2015-05-29 20:29 ` Dmitry Torokhov
2015-05-29 20:34 ` Pavel Machek
2015-05-29 20:48 ` Dmitry Torokhov
2015-05-29 21:02 ` Pavel Machek
2015-05-29 21:38 ` Dmitry Torokhov
2015-06-01 9:55 ` Maxime Ripard
2015-06-01 14:06 ` Please revert 3eea8b5d68c801fec788b411582b803463834752 as it breaks touchscreen " Pavel Machek
2015-06-01 14:58 ` Maxime Ripard
2015-06-01 15:21 ` Pavel Machek
2015-06-01 17:47 ` Dmitry Torokhov
2015-06-01 20:27 ` Pavel Machek
2015-06-01 20:45 ` Dmitry Torokhov
2015-06-01 20:54 ` Tony Lindgren
2015-06-01 21:22 ` Maxime Ripard
2015-06-01 21:32 ` Dmitry Torokhov
2015-06-02 8:25 ` Pavel Machek
2015-06-02 9:44 ` Maxime Ripard
2015-06-02 17:58 ` Dmitry Torokhov
2015-06-02 18:08 ` Dmitry Torokhov
2015-06-25 20:25 ` Pavel Machek
2015-05-29 20:22 ` [PATCH] fix n900 dts file to work around 4.1 touchscreen regression " Dmitry Torokhov
2015-05-29 20:03 ` Maxime Ripard
2015-05-29 20:18 ` Tony Lindgren
2015-05-29 20:30 ` Pavel Machek
2015-05-30 10:14 ` Pavel Machek
2015-06-01 9:49 ` Maxime Ripard
2015-06-01 9:54 ` Pavel Machek
2015-05-30 2:21 ` Sebastian Reichel
2015-05-30 2:24 ` Sebastian Reichel [this message]
2015-05-30 6:26 ` [PATCH] Input: of_touchscreen - remove interdependence of max/fuzz values Pavel Machek
2015-05-29 19:57 ` 4.1 touchscreen regression on n900 -- pinpointed [was Re: linux-n900 v4.1-rc4] Maxime Ripard
2015-05-29 20:29 ` Pavel Machek
2015-05-29 21:17 ` Pavel Machek
2015-05-29 21:36 ` Dmitry Torokhov
2015-05-29 21:58 ` Pavel Machek
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=1432952674-15228-1-git-send-email-sre@kernel.org \
--to=sre@kernel.org \
--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=pavel@ucw.cz \
/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).