From patchwork Wed Aug 8 00:31:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tatsunosuke Tobita X-Patchwork-Id: 10559371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB269157B for ; Wed, 8 Aug 2018 00:32:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AEEE2A0C2 for ; Wed, 8 Aug 2018 00:32:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DBEC2A10C; Wed, 8 Aug 2018 00:32:25 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,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 0B1BC2A0C2 for ; Wed, 8 Aug 2018 00:32:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726159AbeHHCtV (ORCPT ); Tue, 7 Aug 2018 22:49:21 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:40350 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbeHHCtV (ORCPT ); Tue, 7 Aug 2018 22:49:21 -0400 Received: by mail-pl0-f67.google.com with SMTP id s17-v6so205707plp.7 for ; Tue, 07 Aug 2018 17:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6m03qMGfm0BtrdED+VOXCpfP8TkCmMSU9uI6uYGHKTk=; b=Ol8gPvy2U9Lls5FxOkHgOEQZ7KMwgAsnkdYOUjOeWNDg+XxGjVvUHOAivLQfDltdy7 3PJ2za0J1cmlOHj2MnC/6YvADvpbK9C7ZGOhVc3zNtZLaLd6eVqg8jP1Z0KWuF9lqaQQ UmlPiXpe4glvvcnRa1+PmqcsR2RW/imyc1GjN+EFpiJeyFkuBiWV/GLS5elbCffalX1C n4qJ2yvXyk4CXjy5JI/MvHTi479q7EtDbpjQq8QyhSpdTlzesNBj0Z1ViHJzDXa2cyu2 qQVnSknFwhJr1ZltyEQHjN4dceuPt62JKdot1AADFeE+u9dt6ZDt1FllHrAwXzCU/SbP I8gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6m03qMGfm0BtrdED+VOXCpfP8TkCmMSU9uI6uYGHKTk=; b=MCRYfxUJfo52M+pNil7r3eYIhjw9uJoHJjy8Ca66QqqDSP6L9qwOObYDUwmfrilL9/ +cX6LFdbjdEVCdk81nhXE63jneoc8MsecegQpJ0phpoGbiA0K0mt035NgBKeWoupCVXq F+WcllB6dOv1uYoxWioi7sKAs2RTIu3oXG++FuXx5kBj1o9/mn49CUL3CT9eG7542E+U OVoBipm6Pv0Ou/cfqsw8guDlNyO9s+jJ31OM2bw8qVCReX2TzGGy23HCaYpfihSHc00j HTimvyBaotorsmPOMQQYhyt6k44ZGUK4yjXazkJQHTcwEZob0YXMh/ds7X1iZ+/8vOkn 0BXw== X-Gm-Message-State: AOUpUlFia3qgpSwddB4hmbEjUsA0q4QCdq3xxQZxQ4TM5b/qUal/Fpw1 72xqUrut2BQGn2K5oUAQRh1jzFdE X-Google-Smtp-Source: AA+uWPyU/d+C2OWmaWzOT00j8Nk9QckQsLUY86u7mUUSsoviacJZjJoWsf1YZNJlLvicWT5SdnB43w== X-Received: by 2002:a17:902:50ec:: with SMTP id c41-v6mr469822plj.269.1533688343212; Tue, 07 Aug 2018 17:32:23 -0700 (PDT) Received: from localhost.localdomain ([50.225.62.109]) by smtp.gmail.com with ESMTPSA id l70-v6sm3588885pge.64.2018.08.07.17.32.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 17:32:22 -0700 (PDT) From: Tatsunosuke Tobita X-Google-Original-From: Tatsunosuke Tobita To: linux-input@vger.kernel.org Cc: Tatsunosuke Tobita Subject: [PATCH] Input: Set INPUT_PROP_-property for HID_UP_DIGITIZERS Date: Wed, 8 Aug 2018 09:31:43 +0900 Message-Id: <1533688303-2912-1-git-send-email-tobita.tatsunosuke@wacom.co.jp> X-Mailer: git-send-email 1.9.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 Some system may want to know if a detected digitizer device is either an integrated or an external device. In order to distinguish such condition, setting either INPUT_PROP_DIRECT or INPUT_PROP_POINTER is required, checking the member, "application", in "hid_field" structure. Signed-off-by: Tatsunosuke Tobita Signed-off-by: Tatsunosuke Tobita --- drivers/hid/hid-input.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 930652c..3e98537 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -758,6 +758,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel break; case HID_UP_DIGITIZER: + if ((field->application & 0xff) == 0x01) /* Digitizer */ + __set_bit(INPUT_PROP_POINTER, input->propbit); + else if ((field->application & 0xff) == 0x02) /* Pen */ + __set_bit(INPUT_PROP_DIRECT, input->propbit); + switch (usage->hid & 0xff) { case 0x00: /* Undefined */ goto ignore;