From patchwork Fri Dec 9 10:35:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9467821 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 07A5E60586 for ; Fri, 9 Dec 2016 10:35:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F23B72855B for ; Fri, 9 Dec 2016 10:35:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E724B28577; Fri, 9 Dec 2016 10:35:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B1D12855B for ; Fri, 9 Dec 2016 10:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932426AbcLIKf2 (ORCPT ); Fri, 9 Dec 2016 05:35:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36176 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932349AbcLIKf2 (ORCPT ); Fri, 9 Dec 2016 05:35:28 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31B1780B56; Fri, 9 Dec 2016 10:35:28 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-6-165.ams2.redhat.com [10.36.6.165]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB9AZNeh008389; Fri, 9 Dec 2016 05:35:27 -0500 From: Hans de Goede To: Dmitry Torokhov Cc: "russianneuromancer @ ya . ru" , Gregor Riepl , linux-input@vger.kernel.org, Hans de Goede 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 Message-Id: <20161209103522.3833-3-hdegoede@redhat.com> In-Reply-To: <20161209103522.3833-1-hdegoede@redhat.com> References: <20161209103522.3833-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 09 Dec 2016 10:35:28 +0000 (UTC) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)