All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "russianneuromancer @ ya . ru" <russianneuromancer@ya.ru>,
	Gregor Riepl <onitake@gmail.com>,
	linux-input@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH 3/4] Input: silead_gsl1680: Allow silead_ts_read_props to override default resolution
Date: Fri,  9 Dec 2016 11:35:21 +0100	[thread overview]
Message-ID: <20161209103522.3833-3-hdegoede@redhat.com> (raw)
In-Reply-To: <20161209103522.3833-1-hdegoede@redhat.com>

Set the default max_x / max_y in prop.max_? before calling
silead_ts_read_props, so that silead_ts_read_props can override
them. This will be used to fill in DMI based touchscreen info on
ACPI based tablets, since the APCI touchscreen node does not
contain resolution info.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/input/touchscreen/silead.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index 4387cd8..d6593bb 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -99,8 +99,10 @@ static int silead_ts_request_input_dev(struct silead_ts_data *data)
 		return -ENOMEM;
 	}
 
-	input_set_abs_params(data->input, ABS_MT_POSITION_X, 0, 4095, 0, 0);
-	input_set_abs_params(data->input, ABS_MT_POSITION_Y, 0, 4095, 0, 0);
+	input_set_abs_params(data->input, ABS_MT_POSITION_X, 0,
+			     data->prop.max_x, 0, 0);
+	input_set_abs_params(data->input, ABS_MT_POSITION_Y, 0,
+			     data->prop.max_y, 0, 0);
 	touchscreen_parse_properties(data->input, true, &data->prop);
 
 	input_mt_init_slots(data->input, data->max_fingers,
@@ -454,6 +456,8 @@ static int silead_ts_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, data);
 	data->client = client;
+	data->prop.max_x = 4095;
+	data->prop.max_y = 4095;
 
 	error = silead_ts_set_default_fw_name(data, id);
 	if (error)
-- 
2.9.3


  parent reply	other threads:[~2016-12-09 10:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-09 10:35 [PATCH 1/4] input: of_touchscreen: Preserve flags passed into touchscreen_parse_properties Hans de Goede
2016-12-09 10:35 ` [PATCH 2/4] Input: silead_gsl1680: gpiod_get returning -EBUSY is not an error Hans de Goede
2016-12-27 22:14   ` Dmitry Torokhov
2016-12-31 16:45     ` Hans de Goede
2016-12-31 17:06       ` Gregor Riepl
2016-12-31 18:57         ` Hans de Goede
2016-12-09 10:35 ` Hans de Goede [this message]
2016-12-09 10:35 ` [PATCH 4/4] Input: silead_gsl1680: Add support for setting resolution based on dmi data Hans de Goede
2016-12-27 22:27   ` Dmitry Torokhov
2016-12-31 17:09     ` Hans de Goede

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=20161209103522.3833-3-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=onitake@gmail.com \
    --cc=russianneuromancer@ya.ru \
    /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.