From patchwork Fri Jul 15 23:25:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9232863 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 67C6C60868 for ; Fri, 15 Jul 2016 23:26:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BF331FE82 for ; Fri, 15 Jul 2016 23:26:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50804262FF; Fri, 15 Jul 2016 23:26:12 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 9B6141FE82 for ; Fri, 15 Jul 2016 23:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751725AbcGOX0K (ORCPT ); Fri, 15 Jul 2016 19:26:10 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:32919 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751497AbcGOX0J (ORCPT ); Fri, 15 Jul 2016 19:26:09 -0400 Received: by mail-pf0-f196.google.com with SMTP id i6so6785942pfe.0 for ; Fri, 15 Jul 2016 16:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=AgJR4onWUUNwxh8but1WhZf3DyTCHgh3yBcsCnJSl/U=; b=KVbuM6JOPNJxgrc1Q/46FJ64M2rrtfuLJc/+xxu1zOK5Hh6KLYf5hlOOPdGv8akHRy LDVFd6u5qwQ969rvM9IxoA3LzKNWVugFnjuvDnjzLFdzxIfaELU470qROTwRsDAXePYp f0FXGV+YsSXYPVubuxPmN5OAT+V6/L/GjrHJ+DyDrzUZzrwNSBsVEPBqx2vbmRxO4+N/ 9vYE1fU1b4GVGvnCLTmKyowRTV4Rwj2ZRMSPBz+gBNsrB3orkA0R6vSBGOLPZs3YuQhs H4z3sdcmWWeKPpmLAZz54IJd5KLxccQxoY3Z3wiuY40vD43iSX2HiNACFc/Uro68+SJe lEOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AgJR4onWUUNwxh8but1WhZf3DyTCHgh3yBcsCnJSl/U=; b=FOlWFn+2GH57jamQSWvJe2QlOky4SGg8prg1B3hFR0RhGbojZplwLa4NT2JlwCeL5Q Rn+YBq/UZPQ9nX86dMb/jskeIJh5aQtA2go2zg5oFFPGsqaM9Fp1dM4KANd4igmzze3e rj1DP1aYwTaMmBEEEV7X6q1CSmg5+nTvNQ1p75sOtL0UfWy2GK3IcGg5FkW8BJ7E00A2 Qkn07xnJcKCt6JPWRgg+jeRmGPHQZ6i9wzujR3dtaYeczto20wXnV01+FzUq8dg0UmNs 7WshASitnnzFVpy3VBADQpNTa/DtdDIV5htAbdUFCnS5ywvkBn43bWhJS6a2ofQ5wWt5 KCpg== X-Gm-Message-State: ALyK8tKyaheihdEkCsl1/QR2MNLCqL3PK33x4zmYHFEv5K0L5z+WSDOcGipiAyEjYEDwVw== X-Received: by 10.98.0.83 with SMTP id 80mr26024695pfa.0.1468625168765; Fri, 15 Jul 2016 16:26:08 -0700 (PDT) Received: from localhost.net (c-24-21-228-48.hsd1.wa.comcast.net. [24.21.228.48]) by smtp.gmail.com with ESMTPSA id i69sm6023774pfk.30.2016.07.15.16.26.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2016 16:26:08 -0700 (PDT) From: Ping Cheng X-Google-Original-From: Ping Cheng To: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Cc: Ping Cheng , Peter Hutterer Subject: [PATCH 1/2 v2] input: wacom_w8001 - resolution wasn't set for ABS_MT_POSITION_X/Y Date: Fri, 15 Jul 2016 16:25:57 -0700 Message-Id: <1468625157-17766-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 1.8.3.1 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 Also, process error handling for input_mt_init_slots before moving forward. Signed-off-by: Ping Cheng Signed-off-by: Peter Hutterer --- v2: splited from PATCH] input: wacom_w8001 - cleanup 2FG touch code, as suggested by Dmitry. --- drivers/input/touchscreen/wacom_w8001.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index fe983e7..7e807af 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -509,13 +509,20 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename, w8001->pktlen = W8001_PKTLEN_TOUCH2FG; __set_bit(BTN_TOOL_DOUBLETAP, dev->keybit); - input_mt_init_slots(dev, 2, 0); + error = input_mt_init_slots(dev, 2, 0); + if (error) { + pr_debug("w8001: failed to initialize MT slots: %d\n", error); + return error; + } + input_set_abs_params(dev, ABS_MT_POSITION_X, 0, touch.x, 0, 0); input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, touch.y, 0, 0); input_set_abs_params(dev, ABS_MT_TOOL_TYPE, 0, MT_TOOL_MAX, 0, 0); + input_abs_set_res(dev, ABS_MT_POSITION_X, touch.panel_res); + input_abs_set_res(dev, ABS_MT_POSITION_Y, touch.panel_res); strlcat(basename, " 2FG", basename_sz); if (w8001->max_pen_x && w8001->max_pen_y)