Received: by 10.213.65.68 with SMTP id h4csp2290410imn; Mon, 9 Apr 2018 00:32:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx48fOj/eF6e+N0XmnLNe7Pny+8dsj9IGj1+CpKud7uGiD8J88gRS6TFv9XFLFSAFS4fpiUVJ X-Received: by 10.99.0.213 with SMTP id 204mr17305869pga.256.1523259151502; Mon, 09 Apr 2018 00:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523259151; cv=none; d=google.com; s=arc-20160816; b=vUwpnHX7I73Dm9DaoueWEicAme8sMcmcVJFT+0wn9OkPzthwjzzHNEXndFffSu9QbU eNYhrOluBtZncOZ5sTiXj7cYn/Ajs7WnYzn7jdV1zoUYNqE4433qDWzcl39duguG+zLI Gvv6Ms7eiVuq2fF90qrTTAwrMgmkAzrOeIUEhzMsGML+MUDGuUCEOXwMTdlvdQDkk6PS wgNXGMvcuB3xFMkib5p9i1LAu3mdWMx585Xz3DgN/UjgEKFX9PsECMpdeW6BM0k9cFgy POWab7kyqpB+DyqcoeiLaAk8hXTDRq6oavwLaq15cshcPxqyBROt+BKr8+PpfXcn2GVQ SNEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=6C/6baU9DaP2aywV2yzuJpRZRYMvaG+loDdnGHv2q3g=; b=j4yDwq1F7/owIaqeNnUrFnzsrmIsc3DriCYL2Rh2zTRvUbI16UB6gfl/veZOyWIvHT BKK5z/QdXWb1IDm8VLkSlUcDZWZkV0kOnbpLO5wvcDALmxFREHIxArvPV9om25NSAepn CVUPKz5Vm2rlXYxRQuA3GmaaeVDidq7xdHDSm1+05bHDuXXPCrCL11GY4x476oM44wQE vEAQtNh91/ebjsD2G55WUE1vrYEkjo/CS1gj9nYIBlVipRfyocF8zIO31g4fgRoV/3K4 TRBgqbHnhaxRlmG4ll6lUfJa2rJVZezdZjH0lYro9by8iWAUlKSa8Hw/1jA2FMkFvt8O RH1g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5-v6si4385652pli.423.2018.04.09.00.31.54; Mon, 09 Apr 2018 00:32:31 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752291AbeDIH0u (ORCPT + 99 others); Mon, 9 Apr 2018 03:26:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:37874 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751767AbeDIH0s (ORCPT ); Mon, 9 Apr 2018 03:26:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A36CCADC4; Mon, 9 Apr 2018 07:26:46 +0000 (UTC) Date: Mon, 9 Apr 2018 09:26:45 +0200 (CEST) From: Jiri Kosina To: Dmitry Torokhov cc: Martin , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: input: fix battery level reporting on BT mice In-Reply-To: <20180403175220.GA148162@dtor-ws> Message-ID: References: <20180403175220.GA148162@dtor-ws> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Apr 2018, Dmitry Torokhov wrote: > The commit 581c4484769e ("HID: input: map digitizer battery usage") > assumed that devices having input (qas opposed to feature) report for > battery strength would report the data on their own, without the need to > be polled by the kernel; unfortunately it is not so. Many wireless mice > do not send unsolicited reports with battery strength data and have to > be polled explicitly. As a complication, stylus devices on digitizers > are not normally connected to the base and thus can not be polled - the > base can only determine battery strength in the stylus when it is in > proximity. > > To solve this issue, we add a special flag that tells the kernel > to avoid polling the device (and expect unsolicited reports) and set it > when report field with physical usage of digitizer stylus (HID_DG_STYLUS). > Unless this flag is set, and we have not seen the unsolicited reports, > the kernel will attempt to poll the device when userspace attempts to > read "capacity" and "state" attributes of power_supply object > corresponding to the devices battery. > > Fixes: 581c4484769e ("HID: input: map digitizer battery usage") > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=198095 > Cc: stable@vger.kernel.org > Signed-off-by: Dmitry Torokhov Applied for 4.17, thanks. -- Jiri Kosina SUSE Labs