From patchwork Sun May 29 03:39:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KT Liao X-Patchwork-Id: 9139653 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 A477A60757 for ; Sun, 29 May 2016 03:39:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96F0227CB2 for ; Sun, 29 May 2016 03:39:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B88227F17; Sun, 29 May 2016 03:39:42 +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 D871927CB2 for ; Sun, 29 May 2016 03:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbcE2Dj2 (ORCPT ); Sat, 28 May 2016 23:39:28 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33919 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751907AbcE2Dj1 (ORCPT ); Sat, 28 May 2016 23:39:27 -0400 Received: by mail-pf0-f195.google.com with SMTP id c84so10719226pfc.1; Sat, 28 May 2016 20:39:27 -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=3KHN416LofStSr2ixL61p3oTwuMjWpi6uEh2AufmpXs=; b=aucjRg1SIY31/o9ydqywgOTdefCa/faSSgv5N3BFQYcYevEY1Gntty5NNoPaxWgsoc JrWqPFWbb+tKT+BbZtNpRm68hnwBy8n/NvxROgymIm7b5TkBNEKonXbXImZ98Uh53tUN +7uw1XF4AHI44QczizrKrmHP+TRWxoNBJzHBh8pOTibUkgN249s3YX35zxy6b3D39ycJ +I5YWHuO42Il+lTx2cQjew5PNG9ZYYMJlylxsLZ9f0GX4uhK4sghiHD9/HlBvo0j8osg dk7LoxUTDq5jJLeJt0M6P8So3fjmy6DuCIn/jReHtfUMpz14iJMIR0Ld6CsDuTN3kuoj pIJg== 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=3KHN416LofStSr2ixL61p3oTwuMjWpi6uEh2AufmpXs=; b=ggJHXE4jWkCtmPaeBCXYvJg8wo2xpJ/+KdBxY8CcS7w+y6nFH/wAECPQxcQ67YJqZX SrPiGcYda0NmCuIjf1zTvxHmOh2PbxtUfC56TdFLFIRQ9LWf3jo7RibBT852lixUpgq0 Jr1yuipNOwGGr8dIrl4mWTUuOc5ACD7MMVdm/dIYJEU57I4bmBCckDf67gUoRGkCGX75 BjTpUJVBRr99MMLz5Zz69E8Dyg2gjAYOZeKlioNFiD7DAaKPAclnn5g3pUg4k/rqXNdW ZgjJ3itkfq+oVzTayWqnMuFt5ag1TUFfxF8fILJhpoUU7k8SABBnDHecud8xwRSD6XBA YJpA== X-Gm-Message-State: ALyK8tJLKHcuLsW5ew9FSTvaYJbGZEpV4rKHxrHp6TYd3jxEqv4txU/ksILOD9Go5v1FnA== X-Received: by 10.98.71.135 with SMTP id p7mr3618193pfi.165.1464493166749; Sat, 28 May 2016 20:39:26 -0700 (PDT) Received: from localhost.localdomain (42-73-137-206.EMOME-IP.hinet.net. [42.73.137.206]) by smtp.gmail.com with ESMTPSA id f24sm7622146pfd.62.2016.05.28.20.39.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 May 2016 20:39:26 -0700 (PDT) From: KT Liao X-Google-Original-From: KT Liao To: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Cc: phoenix@emc.com.tw, kt.liao@emc.com.tw, jeff.chung@emc.com.tw, charliemooney@google.com Subject: [PATCH] Input: /input/input-mt.c Emit BTN_TOO_FINGER in function input_mt_report_pointer_emulation if touchpad meets hover condition Signed-off-by: KT Liao Date: Sun, 29 May 2016 11:39:12 +0800 Message-Id: <1464493153-2509-1-git-send-email-kt.liao@emc.com.tw> X-Mailer: git-send-email 2.7.4 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 --- drivers/input/input-mt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 54fce56..b89aaa7 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -218,8 +218,17 @@ void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count) } input_event(dev, EV_KEY, BTN_TOUCH, count > 0); - if (use_count) + + if (use_count) { + if (count == 0 && + !test_bit(ABS_MT_DISTANCE, dev->absbit) && + test_bit(ABS_DISTANCE, dev->absbit) && + input_abs_get_val(dev, ABS_DISTANCE) != 0) { + count = 1; + } input_mt_report_finger_count(dev, count); + } + if (oldest) { int x = input_mt_get_value(oldest, ABS_MT_POSITION_X);