From patchwork Tue Apr 14 10:09:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fleig X-Patchwork-Id: 6214591 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 145999F1C4 for ; Tue, 14 Apr 2015 10:10:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E22A202EB for ; Tue, 14 Apr 2015 10:10:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 49184202DD for ; Tue, 14 Apr 2015 10:10:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753810AbbDNKKA (ORCPT ); Tue, 14 Apr 2015 06:10:00 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:32936 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753704AbbDNKJ7 (ORCPT ); Tue, 14 Apr 2015 06:09:59 -0400 Received: by wgin8 with SMTP id n8so6147402wgi.0 for ; Tue, 14 Apr 2015 03:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:cc:message-id:mime-version:content-type; bh=lvgr2Pq51CTmI+Y1hR/zO/BE2Y14RDRQesys/0E8vto=; b=vwDc+7Z7UTUTANkVRb+uUQzI7AvmOXTyJGM+CJlfVRPsabjfN9hCKUJ8zOj7W4OEkC jijo7QLXbsOy7RSAcxtKKjs9VVe3Ob+t3mm70TJcA/mHF4KBW2OxXQW0ri0v3MbBlUjC ZKwYTOn5syWJPkDY+OCn4r9eFp/EjOrN3dxQ2L6qz6mAnnuzwwRC2ZT7z3j7XcRqXC2k GtA7Zcqq6U4SIwjeAzWxWI/uebQXqn8zj11GgRFLK6X0qOvTbcJEHoxORm6JDomP4Tmx 54nEkmW9LLRuFKlK5nnDdIUWi4wsAwVOas21EE8qaig/kmYgF6DeTUXKuynwubxQZKyF S8AA== X-Received: by 10.194.83.66 with SMTP id o2mr38039848wjy.55.1429006198852; Tue, 14 Apr 2015 03:09:58 -0700 (PDT) Received: from lski-029 ([2001:7c0:600:50:2ad2:44ff:fecc:7fa4]) by mx.google.com with ESMTPSA id di9sm16504430wib.16.2015.04.14.03.09.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Apr 2015 03:09:58 -0700 (PDT) Date: Tue, 14 Apr 2015 12:09:57 +0200 From: Andreas Fleig Subject: [PATCH v4] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo To: "linux-input@vger.kernel.org" Cc: Jiri Kosina Message-Id: <1429006197.2676.2@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 Reviewed-by: Benjamin Tissoires Cc: Jiri Kosina }, @@ -774,6 +791,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..59f21a0 100644 --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c @@ -762,6 +762,23 @@ 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) +{ + switch (hdev->product) { + case USB_DEVICE_ID_LENOVO_TPKBD: + case USB_DEVICE_ID_LENOVO_CUSBKBD: + case USB_DEVICE_ID_LENOVO_CBTKBD: + 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); + } + break; + } +} + 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)