Linux Input/HID development
 help / color / mirror / Atom feed
From: "Jose Villaseñor Montfort" <pepemontfort@gmail.com>
To: andfed.net@gmail.com
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
	"Jose Villaseñor Montfort" <pepemontfort@gmail.com>
Subject: Re: [PATCH] HID: magicmouse: fix battery reporting for Bluetooth Magic Trackpad USB-C
Date: Tue, 14 Jul 2026 21:56:01 -0600	[thread overview]
Message-ID: <20260715035601.489009-1-pepemontfort@gmail.com> (raw)
In-Reply-To: <20260706175507.47288-1-andfed.net@gmail.com>

Hi Andrei,

Thanks for tackling this -- I hit the same bug on the Magic Trackpad 2
(USB-C, 004c:0324) over Bluetooth and posted a fix a few days earlier:

  [PATCH] HID: input: read battery capacity from its actual report offset
  https://lore.kernel.org/linux-input/20260702192139.114809-1-pepemontfort@gmail.com/

The two approaches fix the problem in different places:

  - Mine fixes the root cause in the generic query path.
    hidinput_query_battery_capacity() hard-codes buf[1] and ignores the
    battery field's offset within the report. I store the field offset at
    setup and read from it, so any device whose state-of-charge byte is
    not the first field -- like this trackpad, which prefixes it with a
    status byte -- is parsed correctly, with no per-device quirk.

  - Yours keeps the generic path as-is and routes this specific device
    around it via HID_BATTERY_QUIRK_AVOID_QUERY plus a probe-time fetch.

If the generic query is fixed, the AVOID_QUERY quirk shouldn't be needed
for this device. I'm happy to go with whichever the maintainers prefer;
if the generic fix is acceptable I'll respin it with a Fixes: tag and a
stable Cc, as you did. Your note about the connect-time report being
dropped under driver_input_lock is a good catch either way.

Thanks,
Jose

      parent reply	other threads:[~2026-07-15  3:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 17:55 [PATCH] HID: magicmouse: fix battery reporting for Bluetooth Magic Trackpad USB-C Andrei Fed
2026-07-06 18:13 ` sashiko-bot
2026-07-15  3:56 ` Jose Villaseñor Montfort [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260715035601.489009-1-pepemontfort@gmail.com \
    --to=pepemontfort@gmail.com \
    --cc=andfed.net@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox