Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp876365pxb; Thu, 21 Apr 2022 12:21:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8JWb0R74oj6dtyk1BcfMLI4Bv0kthTXbJz0Au898vNQ8QAi+qxuwm1zXQsXURzFSccYzE X-Received: by 2002:a05:6402:3482:b0:423:e3d4:2137 with SMTP id v2-20020a056402348200b00423e3d42137mr1067490edc.369.1650568869069; Thu, 21 Apr 2022 12:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650568869; cv=none; d=google.com; s=arc-20160816; b=k65f6HC7rQynZ5+G6q5opot3LrlUS1c59+f3C4tjKRibK8YeJWZ+zuVR0jk5iKihAS +9crVxFDrCoF64NU+TdwmQOqTp4VGkYmn/3lHVNcQd8xVZ/oAyY/IQ6X2ryBoV1Iuh8T pdn7EpBMe8Yj8bdJXVIBF7TuZu7e7fzaallexJvy4HcpUGyesVfz+vHlrWrIi2nVNbg+ jKDEblTw4PnRDRgd25gEAuXS4sBBvTs+5VtZZPq+OIBLeXwGF7jF9XE9YCfIOFg3pPza W7FwN9kFQK7DHHryk9MHGaU18Nt+xaHI5XNiR+ZvamaJkD8ZAxqw0tS8A21eVwyutnS9 H5Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MxcqNBuLlgwV5pkJyNK1Jc4BB+ZpSfqWM7Qi+3NQsTM=; b=Ju6Pt4JRV1MFWveWyaxBiekNMxJMif81TVLdDKfE46eAlXtGyIoDFXHw0AWnJwbDuX OCIRq9bIZztduS+VFjBTkwTlg7flxLVX0SyjjkgBVWHiY6NGAmgrRVnR7gP+bcWkYXkc CH/epzPPIissxtiT/qHR053yZbwtNBA6dBrZ5Nv1jrYEfgtM6cMJCOME/wcNJ3ZcJ40c 4dk0p4zU93HErse5b7cFZxmThel0+nVPBCHkudDtjQmqHw4bV5+XLXZEZrrWGH1l/U8N i36Y6G/L8sYL58suMnt8Md1d1JYXN5csdvaXLUdg1Ye/bvgX3A0gk+BvmtovHpI3OFUW 3E0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c77q8mWW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz26-20020a170907a05a00b006df76385ea4si4526751ejc.836.2022.04.21.12.20.45; Thu, 21 Apr 2022 12:21:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c77q8mWW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390623AbiDURQz (ORCPT + 99 others); Thu, 21 Apr 2022 13:16:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390619AbiDURQy (ORCPT ); Thu, 21 Apr 2022 13:16:54 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BFAB49F2B; Thu, 21 Apr 2022 10:14:04 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id c12so5471866plr.6; Thu, 21 Apr 2022 10:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MxcqNBuLlgwV5pkJyNK1Jc4BB+ZpSfqWM7Qi+3NQsTM=; b=c77q8mWWdNUdQ37z3lmK3BhiXUigw1TAmxjMQh5leOxbnLJJvbVGRwYl10odV6mEKZ 6LaP9Z6afKFPbruWD0TCUnjqYFk3kEsdYMYhgTKsY+nwQMZc4UdtVUScPcztpKs2RGsg iw0vOwaZzPVKKETvSQNOVblczz7vdvpKPvLD+4QM7uG0icQa9jDg2zptEPIgxhkRzqGl vNkoZX5iCq0EeZsOHGHxIop2bFa5n9xwJcCoJ+wJuqIO/cGYaK/BxmKeDTEgdOVtf12o FapYCl6B4pFuTjiEIwniSOUC5PM1u1phlJ//HlndXjbOGSGwVrV+EfAnTViDMxMmuZgk mFWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MxcqNBuLlgwV5pkJyNK1Jc4BB+ZpSfqWM7Qi+3NQsTM=; b=6R0uq3+erWtLcUGjJe7jyVUJSCJeUxnhn2wn9rvysp3HmdbgP/EeqW/963+Ijpf1B/ opjcpvqnmEIknDLbnOqRERwrGSpFsTHgVYrNLIoVib3Blgvufvvy24k+TsB9ZzrfIKof 73KTBsqwozY7m9nDFN67h9DDqXRB8V5CmFOvRhaMQjuhHQipz2m4xs04HiUn4nevVMxe UgnYM1ghxCRKt93V/SGaRDZXkAAAhAbqVn62k1pwWeSd/X/PpVI0MaD2SKn0tfQo4zXL 1uUUoxzmRzwTbrntUiBroHUFfQChCle6Xhe1vuWomsJYxTf/EB45JNT1XpSmUjFBxIR4 iKBw== X-Gm-Message-State: AOAM533jfNmdPVFVQZct5A96RuSWs57aGDiygKCtVCzmIr85NjVPXpYn iWAWht4Hl0e+TjhPF1v1b+Yf0kM1Q1OjiiDBGe8f9vuov2o= X-Received: by 2002:a17:90b:1c10:b0:1d2:a7c4:3cf with SMTP id oc16-20020a17090b1c1000b001d2a7c403cfmr718201pjb.100.1650561243688; Thu, 21 Apr 2022 10:14:03 -0700 (PDT) MIME-Version: 1.0 References: <20220407115406.115112-1-hadess@hadess.net> <7a50fc20503e43c8172c42c621e01a111bc8104f.camel@hadess.net> In-Reply-To: <7a50fc20503e43c8172c42c621e01a111bc8104f.camel@hadess.net> From: Jason Gerecke Date: Thu, 21 Apr 2022 10:13:52 -0700 Message-ID: Subject: Re: [PATCH] HID: wacom: Correct power_supply type To: Bastien Nocera Cc: Jiri Kosina , Linux Input , LKML , Benjamin Tissoires , Ping Cheng , Jason Gerecke Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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, Apr 20, 2022 at 1:52 AM Bastien Nocera wrote: > > 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. > Thanks Bastien, it seems to do the trick for Bluetooth devices but needs a little more work for the dongle-based Intuos5. I've filed a new issue with some suggestions as requested: https://gitlab.freedesktop.org/upower/upower/-/issues/182 Jason --- Now instead of four in the eights place / you=E2=80=99ve got three, =E2=80=98Cause you added one / (That is to say, eight) to the two, / But you can=E2=80=99t take seven from three, / So you look at the sixty-fours.... > Cheers > > > > > Jason > > --- > > Now instead of four in the eights place / > > you=E2=80=99ve got three, =E2=80=98Cause you added one / > > (That is to say, eight) to the two, / > > But you can=E2=80=99t 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 =3D wacom_battery_get_property; > > > > sprintf(battery->bat_name, "wacom_battery_%ld", n); > > > > bat_desc->name =3D battery->bat_name; > > > > - bat_desc->type =3D POWER_SUPPLY_TYPE_USB; > > > > + bat_desc->type =3D POWER_SUPPLY_TYPE_BATTERY; > > > > bat_desc->use_for_apm =3D 0; > > > > > > > > ps_bat =3D 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 > > > >