From patchwork Tue Apr 14 09:42:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fleig X-Patchwork-Id: 6214501 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 C019C9F1AC for ; Tue, 14 Apr 2015 09:43:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1A8D20117 for ; Tue, 14 Apr 2015 09:43:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED820200FF for ; Tue, 14 Apr 2015 09:42:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753302AbbDNJm7 (ORCPT ); Tue, 14 Apr 2015 05:42:59 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:34209 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752329AbbDNJm6 (ORCPT ); Tue, 14 Apr 2015 05:42:58 -0400 Received: by widjs5 with SMTP id js5so83999744wid.1 for ; Tue, 14 Apr 2015 02:42:57 -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=AJLnt1nMOJw0yzhs7r6z0V3UT0SmQati2GTa1U0t2a4=; b=GNjnbhwC/mUOPFqlNkxABlcGdj0D6LSAG1Ys2WX6lROoP6DXIp0gQoPuOotdN78l7T uBTRPBPyWFFsNwE1TsMcRBOYmUaErt38QxOFXXlhAo7V8y9aePGPwDc1SncXBnXmz6fE luc1ZdwFuDF3YQ3PTIzEYBsugPDfEsWikpV3jSSduPA3iuyy2rKLEnRm3RdISMBy6CMw XDAeSVsdrm5YNrzY34qkX3gunDvBOzV+8JdEuhwqiRku9jByvMMbvpJ9Ss7yi9JsUfbI n+xjglko4PPCfFrBvKhoHBvOezwLiECmFxIQh0A18MCbi3z2LZxgG78PPOPwVHfkhg15 cKmQ== X-Received: by 10.194.179.194 with SMTP id di2mr36726223wjc.4.1429004577382; Tue, 14 Apr 2015 02:42:57 -0700 (PDT) Received: from lski-029 ([2001:7c0:600:50:2ad2:44ff:fecc:7fa4]) by mx.google.com with ESMTPSA id nb9sm1988990wic.10.2015.04.14.02.42.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Apr 2015 02:42:56 -0700 (PDT) Date: Tue, 14 Apr 2015 11:42:56 +0200 From: Andreas Fleig Subject: [PATCH v3] Input: set INPUT_PROP_POINTING_STICK in hid-lenovo To: "linux-input@vger.kernel.org" Cc: Jiri Kosina Message-Id: <1429004576.2676.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 Reviewed-by: Benjamin Tissoires Cc: Jiri Kosina }, @@ -774,6 +792,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..dd61260 100644 --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c @@ -762,6 +762,24 @@ 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; + default: + } +} + 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)