From patchwork Wed Apr 8 09:36:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fleig X-Patchwork-Id: 6177961 X-Patchwork-Delegate: jikos@jikos.cz 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 18BF89F349 for ; Wed, 8 Apr 2015 09:36:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 477382034C for ; Wed, 8 Apr 2015 09:36:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3EAF920306 for ; Wed, 8 Apr 2015 09:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752269AbbDHJgL (ORCPT ); Wed, 8 Apr 2015 05:36:11 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:36875 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751755AbbDHJgJ (ORCPT ); Wed, 8 Apr 2015 05:36:09 -0400 Received: by wiaa2 with SMTP id a2so51043162wia.0 for ; Wed, 08 Apr 2015 02:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:message-id:mime-version:content-type; bh=CT9dfLiff8TwpPbKG8BYqvo4ur3oKfjTb8BkmzRekyk=; b=OcIKTBMhIiQmMHlrOg7+2no1f5kf7UIKKjVH2UhWFnDcl3n6TvOwMSfFmr8GWmU633 X8xyVJVOsVts8Slkuizy9T0AfNubfwdqAl4N2FQ+IBpoRNPHWbz71IJqXNLDnRkGO6P7 5v6jobmVAklNM4KAYY8+cdC/9PSzN1ezdxu1Qb0ph78zCNJmaHswQMp9FMEbI6Fwz0/o JA+RdyE4wIBywqScnMfR3/Z4zAEUG+QKEgDRNv+AHClMXFZ6+BYwThBJLGskec7BxYXT KqAquGHlb0ScbA/XlKNogN1bJCAZfmUW19XNVDQuLJmboCZZOESuR8DoNXbCZlCd6WJj FM1A== X-Received: by 10.194.103.169 with SMTP id fx9mr48761248wjb.148.1428485768710; Wed, 08 Apr 2015 02:36:08 -0700 (PDT) Received: from lski-029 ([2001:7c0:600:50:2ad2:44ff:fecc:7fa4]) by mx.google.com with ESMTPSA id w8sm14779195wja.4.2015.04.08.02.36.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 02:36:08 -0700 (PDT) Date: Wed, 08 Apr 2015 11:36:07 +0200 From: Andreas Fleig Subject: [PATCH v2] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo To: "linux-input@vger.kernel.org" Message-Id: <1428485767.14997.1@smtp.gmail.com> X-Mailer: geary/0.9.1 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Set flags INPUT_PROP_POINTER and INPUT_PROP_POINTING_STICK for the trackpoint integrated in Lenovo USB and Bluetooth keyboards. Libinput checks these flags to enable features such as middle-button-scrolling by default. Signed-off-by: Andreas Fleig }, @@ -774,6 +784,7 @@ MODULE_DEVICE_TABLE(hid, lenovo_devices); static struct hid_driver lenovo_driver = { .name = "lenovo", .id_table = lenovo_devices, + .input_configured = lenovo_input_configured, .input_mapping = lenovo_input_mapping, .probe = lenovo_probe, .remove = lenovo_remove, --- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c index c4c3f09..c4da65d 100644 --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c @@ -762,6 +762,16 @@ static void lenovo_remove(struct hid_device *hdev) hid_hw_stop(hdev); } +static void lenovo_input_configured(struct hid_device *hdev, + struct hid_input *hi) +{ + if (test_bit(EV_REL, hi->input->evbit)) { + /* set only for trackpoint device */ + __set_bit(INPUT_PROP_POINTER, hi->input->propbit); + __set_bit(INPUT_PROP_POINTING_STICK, hi->input->propbit); + } +} + static const struct hid_device_id lenovo_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) }, { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CUSBKBD)