From patchwork Thu Nov 13 14:06:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 5297291 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1BED99F440 for ; Thu, 13 Nov 2014 14:11:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C81D201F4 for ; Thu, 13 Nov 2014 14:11:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 718532011B for ; Thu, 13 Nov 2014 14:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933153AbaKMOLv (ORCPT ); Thu, 13 Nov 2014 09:11:51 -0500 Received: from down.free-electrons.com ([37.187.137.238]:40479 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933123AbaKMOKF (ORCPT ); Thu, 13 Nov 2014 09:10:05 -0500 Received: by mail.free-electrons.com (Postfix, from userid 106) id 6064274F; Thu, 13 Nov 2014 15:10:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 1165B739; Thu, 13 Nov 2014 15:10:07 +0100 (CET) From: Maxime Ripard To: =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= , Dmitry Torokhov , Henrik Rydberg Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Pargmann , Maxime Ripard Subject: [PATCH v2 3/4] input: ft5x06: Allow to set the maximum axes value through the DT Date: Thu, 13 Nov 2014 15:06:57 +0100 Message-Id: <1415887618-29844-4-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1415887618-29844-1-git-send-email-maxime.ripard@free-electrons.com> References: <1415887618-29844-1-git-send-email-maxime.ripard@free-electrons.com> 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 Currently the driver relies on some obscure and undocumented register to set the maximum axis value. The reported value is way too high to be meaningful, which confuses some userspace tools like QT's evdevtouch plugin which try to scale the reported events to the maximum values. Use the values from the DT to set meaningful values. Signed-off-by: Maxime Ripard --- drivers/input/touchscreen/edt-ft5x06.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index ee3434f1e949..3ebc1a7e46c5 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #define MAX_SUPPORT_POINTS 5 @@ -1042,6 +1043,10 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, 0, tsdata->num_x * 64 - 1, 0, 0); input_set_abs_params(input, ABS_MT_POSITION_Y, 0, tsdata->num_y * 64 - 1, 0, 0); + + if (!pdata) + touchscreen_parse_of_params(input); + error = input_mt_init_slots(input, MAX_SUPPORT_POINTS, 0); if (error) { dev_err(&client->dev, "Unable to init MT slots.\n");