Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2155959imu; Wed, 21 Nov 2018 07:29:01 -0800 (PST) X-Google-Smtp-Source: AJdET5eqYh5KuuPowcgPEeY94YM2nBKYV7EvsNpyTVqj59EoMx8QccQFBnLvNDTGajI9Y8UFHqec X-Received: by 2002:a62:401:: with SMTP id 1-v6mr7172014pfe.156.1542814141302; Wed, 21 Nov 2018 07:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542814141; cv=none; d=google.com; s=arc-20160816; b=aRDMXRgT3TUc0jCuUbayqk5OKFuCXLuWtqLRNxc+skO32cV+BrA/21YW8/dei7obhz dQvGT5bbztDppi0HDW+CDbzgOWu75vFmALbkt0o+FsLWFPWtz1qNcNpDaoko6xQnDMje mfDbWCPG719Oaa2pGbwDPq9fSMXyQqls9wOrPTt5EVKKmw16fJys0wktNx9ziquGrdO3 Zj4EX5fqRQdikONgSOW5tNkG+61aF2glp7aZkb05f/zC4VjjQ4pU2om9eyNUMkZsIRXo Q2ihJ7d39pwoT2qhI595EMO3uiVRZmWnDo1q8niuAIml97G2/FlhLs5jNMHjJp7IBPY9 1Xzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ysuvX+p+X+CfjJMuSrr0d50h6IlENEMigG7qJpVKnCQ=; b=DRGIeH5bJRsfWAf1SN78aRfhjxVEJMe2bE4K3oHmaB1Q8+LWbRoCTsEz764SxSaZ5I 2tWgQwHkIzeRQoTlJ4b4L1s9ziE9AOgfGSaBfrQvTZZq3zkRTKtstXQ3q6v/9cI1ck5s 6KqKl13r8adGmCob4WN9MpLE6pPfc0BAk71z/bIyDyXsUPqlWKT7dTbC5xx+rp3L4Y0c 2+O3C/+SkxMfzx7FnnHEPIdDeg4rQWPVdHVqi9HNyd8IkMrvPddlqXl02jof2NuubeP+ CzmmVqnBy/pUvr72QkCwh6480Sf1LMrj8TTgk4+i5d4zdZd9lct0g4+2ilTkxzDXmYL9 zZVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si46219422pgm.21.2018.11.21.07.28.45; Wed, 21 Nov 2018 07:29:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731433AbeKVCCh (ORCPT + 99 others); Wed, 21 Nov 2018 21:02:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38518 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731213AbeKVCCg (ORCPT ); Wed, 21 Nov 2018 21:02:36 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C8F989ACC; Wed, 21 Nov 2018 15:27:43 +0000 (UTC) Received: from plouf.redhat.com (ovpn-204-124.brq.redhat.com [10.40.204.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 388DE1054FD3; Wed, 21 Nov 2018 15:27:35 +0000 (UTC) From: Benjamin Tissoires To: Dmitry Torokhov , Jiri Kosina , Harry Cutts , Peter Hutterer , torvalds@linux-foundation.org Cc: Nestor Lopez Casado , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 5/7] Revert "HID: logitech: Add function to enable HID++ 1.0 "scrolling acceleration"" Date: Wed, 21 Nov 2018 16:27:10 +0100 Message-Id: <20181121152712.6770-6-benjamin.tissoires@redhat.com> In-Reply-To: <20181121152712.6770-1-benjamin.tissoires@redhat.com> References: <20181121152712.6770-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Nov 2018 15:27:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 051dc9b0579602bd63e9df74d0879b5293e71581. It turns out the current API is not that compatible with some Microsoft mice, so better start again from scratch. Signed-off-by: Benjamin Tissoires --- drivers/hid/hid-logitech-hidpp.c | 47 +++++++++----------------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 7f8218f6ff56..19cc980eebce 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -400,53 +400,32 @@ static void hidpp_prefix_name(char **name, int name_length) #define HIDPP_SET_LONG_REGISTER 0x82 #define HIDPP_GET_LONG_REGISTER 0x83 -/** - * hidpp10_set_register_bit() - Sets a single bit in a HID++ 1.0 register. - * @hidpp_dev: the device to set the register on. - * @register_address: the address of the register to modify. - * @byte: the byte of the register to modify. Should be less than 3. - * Return: 0 if successful, otherwise a negative error code. - */ -static int hidpp10_set_register_bit(struct hidpp_device *hidpp_dev, - u8 register_address, u8 byte, u8 bit) +#define HIDPP_REG_GENERAL 0x00 + +static int hidpp10_enable_battery_reporting(struct hidpp_device *hidpp_dev) { struct hidpp_report response; int ret; u8 params[3] = { 0 }; ret = hidpp_send_rap_command_sync(hidpp_dev, - REPORT_ID_HIDPP_SHORT, - HIDPP_GET_REGISTER, - register_address, - NULL, 0, &response); + REPORT_ID_HIDPP_SHORT, + HIDPP_GET_REGISTER, + HIDPP_REG_GENERAL, + NULL, 0, &response); if (ret) return ret; memcpy(params, response.rap.params, 3); - params[byte] |= BIT(bit); + /* Set the battery bit */ + params[0] |= BIT(4); return hidpp_send_rap_command_sync(hidpp_dev, - REPORT_ID_HIDPP_SHORT, - HIDPP_SET_REGISTER, - register_address, - params, 3, &response); -} - - -#define HIDPP_REG_GENERAL 0x00 - -static int hidpp10_enable_battery_reporting(struct hidpp_device *hidpp_dev) -{ - return hidpp10_set_register_bit(hidpp_dev, HIDPP_REG_GENERAL, 0, 4); -} - -#define HIDPP_REG_FEATURES 0x01 - -/* On HID++ 1.0 devices, high-res scroll was called "scrolling acceleration". */ -static int hidpp10_enable_scrolling_acceleration(struct hidpp_device *hidpp_dev) -{ - return hidpp10_set_register_bit(hidpp_dev, HIDPP_REG_FEATURES, 0, 6); + REPORT_ID_HIDPP_SHORT, + HIDPP_SET_REGISTER, + HIDPP_REG_GENERAL, + params, 3, &response); } #define HIDPP_REG_BATTERY_STATUS 0x07 -- 2.19.1