Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp784573pxb; Fri, 22 Apr 2022 11:04:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHM2/3MUJcBB62jrwfNsxfGD3ni4FJ/G7IPNX7QcmvX4Ygk8iF/ZtVwfTJrzAQZtNL648n X-Received: by 2002:a17:902:70c1:b0:154:667f:e361 with SMTP id l1-20020a17090270c100b00154667fe361mr5854217plt.148.1650650688949; Fri, 22 Apr 2022 11:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650650688; cv=none; d=google.com; s=arc-20160816; b=aNGzpQm0zRP0N/uKsWyqpJzKUz26iHHqdyxxi/zQtbW3bMwwadf3j6kHemuxnkDty0 Muct28NVA3OheG2eLvIFCH7cL70KLp3A/xWNMmQdV3x0hNQ5TDYzo2emMm600prP+9Vi T+f1t7YrKLAmaivjGVnRq0qfH0lR8TfGc6kvmiZrI94ISP4bJkAYPc/Rkn9DBgxCUnOa iTIJxvf7zTDtdfZNj+mUCsHe61PgYYleGUIYrnfbf1OK8DbUta1wrQ1je7zdpG3ajbRU IMkMYft9TU+TE/5voHX4U/eYnDAVe5e7Wzys5fpqH4h7UqJHGCXAnxun6ek9vSDSG3Kn GDpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=K4RCzUO3am0bGuFHSx71cHXBY0RCwtnI9eSwaTrYeRo=; b=QXDtraqhEn/ccMO2Bj0HbtwotregRwvIFk77ykkowDxXv6ADGCHn6fWHjQVGK9GCWh 5Y/WwObbZSThjfpu67XPgzbnGnFTw61h8GnFGZIcYiC39dJakvNe50PKbthA+I3bwny1 cB21Tnvx2IFimYSvrZqYpkkDBQHUPMp2jg2JXD7drTM9DZrfGuzU3x7SNBqjq/b9QNO5 feddKsFjPBYJlHNXUijP/4lARZlrE+q+/+e0KAycdxScnM1CNMU15P2v+VXBOdVBa317 o9jFkDh/2Lg7Z5UzhZ9Qv7Xx73ycjgKjjPSQXPrigI5SXvtwH0RKDuf7xpBbPe6wX44c tRKg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f64-20020a636a43000000b00381cbf13898si8965778pgc.373.2022.04.22.11.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 11:04:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8FC4EEA37B; Fri, 22 Apr 2022 10:43:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376968AbiDTIz2 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Apr 2022 04:55:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376964AbiDTIzZ (ORCPT ); Wed, 20 Apr 2022 04:55:25 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A680A1CFD5; Wed, 20 Apr 2022 01:52:39 -0700 (PDT) Received: (Authenticated sender: hadess@hadess.net) by mail.gandi.net (Postfix) with ESMTPSA id 206004000C; Wed, 20 Apr 2022 08:52:36 +0000 (UTC) Message-ID: <7a50fc20503e43c8172c42c621e01a111bc8104f.camel@hadess.net> Subject: Re: [PATCH] HID: wacom: Correct power_supply type From: Bastien Nocera To: Jason Gerecke , Jiri Kosina Cc: Linux Input , LKML , Benjamin Tissoires , Ping Cheng , Jason Gerecke Date: Wed, 20 Apr 2022 10:52:36 +0200 In-Reply-To: References: <20220407115406.115112-1-hadess@hadess.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.0 (3.44.0-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2022-04-13 at 07:59 -0700, Jason Gerecke wrote: > Following up on my previous comment. I've been able to test this > patch > with both flavors of wireless interface. Both Bluetooth (Intuos Pro) > and dongle-based (Intuos5) appear to have mostly-correct behavior > while charging and discharging, even when the battery level gradually > drops to zero. The misbehaviors I see appear to be limited to upower > mis-categorizing the devices as an e.g. keyboard or generic battery > rather than as a tablet. This leads to some slightly confusing UI > issues (e.g. GNOME and KDE referring to the device incorrectly), but > nothing too annoying. If upower is taught to recognize tablets under > more circumstances those issues should disappear. > > Ping tells me you may have an Intuos4 Wireless, Bastien? Any > additional testing you can do with that device would be appreciated, > though even without it I'm personally comfortable enough to provide > an > ack: > > Acked-by: Jason Gerecke Only devices I have is the original Wacom Graphire Bluetooth, and a wired Intuos4 (PTK-640) which I think changed names not long after. This might be enough: https://gitlab.freedesktop.org/upower/upower/-/merge_requests/127 Please file an issue with the info discussed in the previous mail if it isn't. Cheers > > Jason > --- > Now instead of four in the eights place / > you’ve got three, ‘Cause you added one  / > (That is to say, eight) to the two,     / > But you can’t take seven from three,    / > So you look at the sixty-fours.... > > On Tue, Apr 12, 2022 at 1:53 AM Jiri Kosina wrote: > > > > On Thu, 7 Apr 2022, Bastien Nocera wrote: > > > > > POWER_SUPPLY_TYPE_USB seems to only ever be used by USB ports > > > that are > > > used to charge the machine itself (so a "system" scope), like the > > > single USB port on a phone, rather than devices. > > > > > > The wacom_sys driver is the only driver that sets its device > > > battery as > > > being a USB type, which doesn't seem correct based on its usage, > > > so > > > switch it to be a battery type like all the other USB-connected > > > devices. > > > > > > Signed-off-by: Bastien Nocera > > > --- > > >  drivers/hid/wacom_sys.c | 2 +- > > >  1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c > > > index 066c567dbaa2..620fe74f5676 100644 > > > --- a/drivers/hid/wacom_sys.c > > > +++ b/drivers/hid/wacom_sys.c > > > @@ -1777,7 +1777,7 @@ static int > > > __wacom_initialize_battery(struct wacom *wacom, > > >       bat_desc->get_property = wacom_battery_get_property; > > >       sprintf(battery->bat_name, "wacom_battery_%ld", n); > > >       bat_desc->name = battery->bat_name; > > > -     bat_desc->type = POWER_SUPPLY_TYPE_USB; > > > +     bat_desc->type = POWER_SUPPLY_TYPE_BATTERY; > > >       bat_desc->use_for_apm = 0; > > > > > >       ps_bat = devm_power_supply_register(dev, bat_desc, > > > &psy_cfg); > > > > Thanks Bastien, makes sense. CCing Jason and Ping (the Wacom driver > > maintainers) to get their Ack. > > > > -- > > Jiri Kosina > > SUSE Labs > >