Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp384704ybe; Mon, 2 Sep 2019 03:15:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsj/ODqqQDs/g+pHmsrfqphTVbjokuY0W/gdNQaD9AvUwC1dWjvVZ6Hw00VHAzanI3aZJa X-Received: by 2002:a63:4b02:: with SMTP id y2mr23980444pga.135.1567419305698; Mon, 02 Sep 2019 03:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567419305; cv=none; d=google.com; s=arc-20160816; b=VuBLZ2fnSI/5wxYV8aPXKgJAlVN3Vbq+8bAC34kB60G4cb4BwdpBePZN4pgVxVRz5Q fJA64egx7/6zHKoRLDdyClaNU8oo/79O4kVyw9ILp3uOSMa7SLi/4B+l1x33hoevobFU Wr1PjerTjEwFIYkuzSPD8Rg9NFTRwbxQxnV5Fbnr8xU5LCU2cFkcG6h0iSAgOoUDevT3 iSSUtzQl1nRQD5XWTzWrQhLLhXvGcElTn8lsuoqukBwqyD5k8zR/eWp17aV7Jc/MbncF hUhWhs9y4ZIkhTp4IBmirLA/R3jTzqpJfso3QOsmgr0CM81l3XVMxO83q+J+ibEK11gt Io8w== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=eeqQrMj2FLA8uW6pexEOtbC1JKbdd8eqNvLX/77Q7Nk=; b=wG+BgB/FNUZCoJkV/rV8pV9Btwl7W7Po3v35SUlwtKqbHiRhA12Jor0SUXTiCW7ZLj g4d/KtSliDoty8bNxPJJTmWViqXauaSaTxbg8yJWbBK3rDiAdkU5siMFmEAqhS6MiY3L TWlrUhOAKhK7bLXZIcv9uOgBAv9hYtsxDVndtS42r0+migiiFu4NaNNTbaBbbDijA9an ZbFB/Nkgj5DS1G5gAmLujJYKx8KQedU5dt2Sh/vAr/FwlMETMmg/wyj04sX5BopMzNth WrVg76AIrVKkfMRJP+Rf2IxOt7SbkqfXUDce+3ppPKBulzQPksmHKj8aaQYMcItJLSWD lnTQ== 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 f186si10898292pgc.438.2019.09.02.03.14.50; Mon, 02 Sep 2019 03:15:05 -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 S1731031AbfIBJXp (ORCPT + 99 others); Mon, 2 Sep 2019 05:23:45 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:45099 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729603AbfIBJXp (ORCPT ); Mon, 2 Sep 2019 05:23:45 -0400 X-Originating-IP: 83.155.44.161 Received: from classic (mon69-7-83-155-44-161.fbx.proxad.net [83.155.44.161]) (Authenticated sender: hadess@hadess.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 04D171BF221; Mon, 2 Sep 2019 09:23:41 +0000 (UTC) Message-ID: <99cffa73439fd0d59fa738d786545f5a6e35ab4d.camel@hadess.net> Subject: Re: [PATCH v5] hid-logitech-hidpp: read battery voltage from newer devices From: Bastien Nocera To: Pedro Vanzella , linux-input@vger.kernel.org Cc: lains@archlinux.org, Jiri Kosina , Benjamin Tissoires , linux-kernel@vger.kernel.org Date: Mon, 02 Sep 2019 11:23:41 +0200 In-Reply-To: <20190831175659.7404-1-pedro@pedrovanzella.com> References: <20190831175659.7404-1-pedro@pedrovanzella.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2019-08-31 at 13:56 -0400, Pedro Vanzella wrote: > Newer Logitech mice report their battery voltage through feature > 0x1001 > instead of the battery levels through feature 0x1000. > > When the device is brought up and we try to query the battery, figure > out if it supports the old or the new feature. If it supports the new > feature, record the feature index and read the battery voltage and > its status. FWIW, it wasn't clear to me that there were 3 bytes, and the last one would contain the battery status. I was under the impression reading this that the only thing the mouse would send back would be the voltage, so this might need a slight rewording. Did you test this with upower? Did it work as you expected? Cheers