From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0799CC432BE for ; Sun, 29 Aug 2021 15:27:39 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A1A8606A5 for ; Sun, 29 Aug 2021 15:27:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8A1A8606A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1mKMiD-0003Pk-5p; Sun, 29 Aug 2021 11:27:09 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mKMiA-0003PP-NE for kernelnewbies@kernelnewbies.org; Sun, 29 Aug 2021 11:27:06 -0400 Received: by mail-wr1-x431.google.com with SMTP id b6so18547164wrh.10 for ; Sun, 29 Aug 2021 08:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=dmr/qwJCi5QQXdg0Hm85j4q99ocq83HLjDyFvTGWkZo=; b=fUpNC6GM8GQaetU5prpt9dALTl1uPZxqIMxwJl6+W1NM7s2BrAPT4iD/NSvrtwRLUW 7iZFF9in2+BTYhvUJXUAaQlAD7ZUvBGOIxrNZXQTEZKd2ZENq+wB1ek4sP9DPqt0e4gI bgG2xQJPl+KQs1l7m+1QbxmOOV58Z36RTjdoZX4RT+MKq7tIZPjhHnZLplF1eVKaad1v gK0bxiRR6yTmtPBCIY0Oy7ogpo0xi+F+sHflJVJUf+yxNjle/ssXJ3Crsd0xbYuI9yVo elFrHNKFFTSw0HXdjfet4g1Mok/cJk/pBoM3R+0CIkEGqilskgnOQ+W1KQXl0OKOMoe7 pmEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=dmr/qwJCi5QQXdg0Hm85j4q99ocq83HLjDyFvTGWkZo=; b=busTKPpqmHEe4Zvfvm7cS6oCWSV6tnJIthgR5gfMfzQIrnyuydhkGipRdZ1gRd2NQl L8Pl0iyeds0M3b2j+motNPqfqiencnHCNscktSu1VZP3eK+NKABrI2leRzXAp5TC8mCe zvxpbl2/MJ+R8TUJp02uvt8A+r3S966bk2CyMIcgdWbSJEpOXpXu2XpliMphfllg+qUe WLzU57SDInTVRfxlnSAv1wn6YT070baZUM8tH5Q/S0f8w7r3rT7fpIVjo0YphKNZV3A2 kKhdTx1KhJdYW2WdEFlaqjUcsdZu86SbDiP+Z+BgQx+yuDkTlP5Dbt9EPn1zNH6wc82I Umow== X-Gm-Message-State: AOAM532T73CEEyE5l2b4gJ9+l9iHcmM0Wd5Og+d0h6D5SuOEd1wYcbWq 3IaW14br8oNIDBJTlJNXn21KuVTBRdPvXQ== X-Google-Smtp-Source: ABdhPJwJzLhE697e07NafwE7kQO2NYU8JgYtydfbeyh6w5ZmyqcJjoxBusEtgRd1wocdpZ+uEriwQA== X-Received: by 2002:a5d:6cc9:: with SMTP id c9mr9290237wrc.158.1630250824549; Sun, 29 Aug 2021 08:27:04 -0700 (PDT) Received: from elementary ([94.73.35.151]) by smtp.gmail.com with ESMTPSA id h11sm15211153wrx.9.2021.08.29.08.27.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Aug 2021 08:27:04 -0700 (PDT) Date: Sun, 29 Aug 2021 17:27:01 +0200 From: =?iso-8859-1?Q?Jos=E9_Exp=F3sito?= To: kernelnewbies@kernelnewbies.org Subject: USB/HID: Device with multiple interfaces Message-ID: <20210829152701.GB19129@elementary> MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hi all, I'm trying to solve an issue with a mouse that only reports battery over Bluetooth. I hope you can help me. When connected over Bluetooth, the mouse registers one HID descriptor containing both mouse and power device collections. However, when it's connected over USB, I can see using lsusb that 3 interfaces are available and, unlike with Bluethoot, the HID descriptors containing mouse and power device are in different interfaces. The battery percentage is not reported in this case. So far I've been able to get the battery percentage in the driver by manually calling devm_power_supply_register and submitting an URB. My question is: since the HID descriptors with the power device collection is present but in a different interface, is there a way to associate both interfaces to the same physical device and get the battery percentage automatically? Thank you very much in advance, Jose _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies