From patchwork Sat Apr 20 11:21:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 10910233 X-Patchwork-Delegate: jikos@jikos.cz 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 C26C717E0 for ; Sat, 20 Apr 2019 11:22:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B279C28D25 for ; Sat, 20 Apr 2019 11:22:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6CFF28D94; Sat, 20 Apr 2019 11:22:32 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 5462128D25 for ; Sat, 20 Apr 2019 11:22:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728024AbfDTLWb (ORCPT ); Sat, 20 Apr 2019 07:22:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37588 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbfDTLWb (ORCPT ); Sat, 20 Apr 2019 07:22:31 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 703D47F7B1; Sat, 20 Apr 2019 11:22:31 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-20.ams2.redhat.com [10.36.116.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53BB419C5A; Sat, 20 Apr 2019 11:22:30 +0000 (UTC) From: Hans de Goede To: Jiri Kosina , Benjamin Tissoires Cc: Hans de Goede , Nestor Lopez Casado , linux-input@vger.kernel.org Subject: [PATCH v3 06/37] HID: logitech-dj: declare and use a few HID++ 1.0 constants Date: Sat, 20 Apr 2019 13:21:46 +0200 Message-Id: <20190420112217.27590-7-hdegoede@redhat.com> In-Reply-To: <20190420112217.27590-1-hdegoede@redhat.com> References: <20190420112217.27590-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 20 Apr 2019 11:22:31 +0000 (UTC) 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 From: Benjamin Tissoires For the non DJ receivers, we are going to need to re-use those constants, better have them properly defined. Signed-off-by: Benjamin Tissoires Signed-off-by: Hans de Goede --- drivers/hid/hid-logitech-dj.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index b1ae2d9c5ddc..eafe75d55664 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -74,7 +74,6 @@ /* Device Un-Paired Notification */ #define REPORT_TYPE_NOTIF_DEVICE_UNPAIRED 0x40 - /* Connection Status Notification */ #define REPORT_TYPE_NOTIF_CONNECTION_STATUS 0x42 #define CONNECTION_STATUS_PARAM_STATUS 0x00 @@ -101,6 +100,10 @@ #define MEDIA_CENTER BIT(8) #define KBD_LEDS BIT(14) +#define HIDPP_GET_LONG_REGISTER 0x83 +#define HIDPP_REG_PAIRING_INFORMATION 0xB5 +#define HIDPP_PAIRING_INFORMATION 0x20 + struct dj_report { u8 report_id; u8 device_index; @@ -703,8 +706,14 @@ static void logi_dj_ll_close(struct hid_device *hid) * Register 0xB5 is "pairing information". It is solely intended for the * receiver, so do not overwrite the device index. */ -static u8 unifying_pairing_query[] = {0x10, 0xff, 0x83, 0xb5}; -static u8 unifying_pairing_answer[] = {0x11, 0xff, 0x83, 0xb5}; +static u8 unifying_pairing_query[] = { REPORT_ID_HIDPP_SHORT, + HIDPP_RECEIVER_INDEX, + HIDPP_GET_LONG_REGISTER, + HIDPP_REG_PAIRING_INFORMATION }; +static u8 unifying_pairing_answer[] = { REPORT_ID_HIDPP_LONG, + HIDPP_RECEIVER_INDEX, + HIDPP_GET_LONG_REGISTER, + HIDPP_REG_PAIRING_INFORMATION }; static int logi_dj_ll_raw_request(struct hid_device *hid, unsigned char reportnum, __u8 *buf,