From patchwork Sun Jun 18 10:18:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9794783 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 BBC7D6032B for ; Sun, 18 Jun 2017 10:18:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A603E28453 for ; Sun, 18 Jun 2017 10:18:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A5962848F; Sun, 18 Jun 2017 10:18:39 +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 4B29A28453 for ; Sun, 18 Jun 2017 10:18:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751088AbdFRKSi (ORCPT ); Sun, 18 Jun 2017 06:18:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59738 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751009AbdFRKSi (ORCPT ); Sun, 18 Jun 2017 06:18:38 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA94881222; Sun, 18 Jun 2017 10:18:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CA94881222 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=hdegoede@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CA94881222 Received: from shalem.localdomain.com (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACD5491E9C; Sun, 18 Jun 2017 10:18:36 +0000 (UTC) From: Hans de Goede To: Dmitry Torokhov Cc: Hans de Goede , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Subject: [PATCH v2 4/4] Input: icn8318 - Add support for capacative home button Date: Sun, 18 Jun 2017 12:18:29 +0200 Message-Id: <20170618101829.18734-4-hdegoede@redhat.com> In-Reply-To: <20170618101829.18734-1-hdegoede@redhat.com> References: <20170618101829.18734-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 18 Jun 2017 10:18:37 +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 Some x86 tablets with an icn8505 touchscreen have a capacative home button, add support for this. Note that it turns out that the removed comment (and if) is inaccurate, yes when the capacative home button is pressed the touch info contains invalid data, but touch_count is set to 0 so this is not a problem and if both the button is used and a finger is touching the normal touchscreen area then there is valid touch data. Signed-off-by: Hans de Goede --- drivers/input/touchscreen/chipone_icn8318.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/input/touchscreen/chipone_icn8318.c b/drivers/input/touchscreen/chipone_icn8318.c index 7a28caef1475..ab8f037fc9bc 100644 --- a/drivers/input/touchscreen/chipone_icn8318.c +++ b/drivers/input/touchscreen/chipone_icn8318.c @@ -125,16 +125,6 @@ static irqreturn_t icn8318_irq(int irq, void *dev_id) return IRQ_HANDLED; } - if (touch_data.softbutton) { - /* - * Other data is invalid when a softbutton is pressed. - * This needs some extra devicetree bindings to map the icn8318 - * softbutton codes to evdev codes. Currently no known devices - * use this. - */ - return IRQ_HANDLED; - } - if (touch_data.touch_count > ICN8318_MAX_TOUCHES) { dev_warn(dev, "Too much touches %d > %d\n", touch_data.touch_count, ICN8318_MAX_TOUCHES); @@ -157,6 +147,7 @@ static irqreturn_t icn8318_irq(int irq, void *dev_id) } input_mt_sync_frame(data->input); + input_report_key(data->input, KEY_LEFTMETA, touch_data.softbutton == 1); input_sync(data->input); return IRQ_HANDLED; @@ -329,6 +320,7 @@ static int icn8318_probe(struct i2c_client *client) le16_to_cpu(resolution[0]) - 1, 0, 0); input_set_abs_params(input, ABS_MT_POSITION_Y, 0, le16_to_cpu(resolution[1]) - 1, 0, 0); + input_set_capability(input, EV_KEY, KEY_LEFTMETA); } touchscreen_parse_properties(input, true, &data->prop);