From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC3A9363C6A for ; Tue, 14 Jul 2026 10:12:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784023966; cv=none; b=Cwhzd9UmAdCgfLOX52qF/fiaCFDvEu8QH6EyN/EfWmav7OBX5hjbwwjmoiLv7jJM0EJ4vaRWXJVB9zBXWX2Swx3SRlkNRRH88IRDZZk3UaY8/0vz/3+xqlY6x3+9Xe+xQvHULx7X7GrTOYTmtukxwEuIyZkbIDblNsUWygwtng8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784023966; c=relaxed/simple; bh=u/T9HwF475h8G5NygkEKCoQSP1f90u86IK13PlHmt0w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lYgbkPZQqhveLza4rtJo/m5sza3BCgHiIwr8pgowMr2k8j0nrzpJVct/Vx5QZp7qleSRFycLXa5lcJTF2oezqs3gdxHiMQ2/vk3uTGshQT9U6qghmoPsw2sWqm0q1SNyovLIqQ7R1aixVKmrr4povpQiANJunGiG7O1Q/7X+JKU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Uoi0Qzxx; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Uoi0Qzxx" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-92e99ef0902so273292085a.2 for ; Tue, 14 Jul 2026 03:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784023963; x=1784628763; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=6X1/WLn79/CUgV4H/rMT3E22JluSKjkUFHRz/amWYjQ=; b=Uoi0Qzxx7+pzfw4ji7YmqO0zY7u7DhWcwGdhTfLlVeVGKKcwU+5x7tFVKIVRp88nq/ /tOMyYj1X1eozuaBBf1tw1wSRB7q4Y29YHKrY/FCzUNZzFvAu5CEHAzoT6MJKvVJE/Id B9bOr20IuSFysb3dsAAxcfwAMQeACOi2hGJ34VJpugZfzvGZoIvRKXELrSckobGHpGwY koGoEyP+4/Ql2iQ4Q6njrZftVA8sUDPbMYsPqxfrJ4PR7ukA2OXVEV1CUmWBGF8k0F/V +Jn2n4BCaKWRJvTQ1uzXnYYm3jvWy1vSxOWxuAHAFSj6lqJECC72NyKrEMpLutOCluMt sB9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784023963; x=1784628763; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6X1/WLn79/CUgV4H/rMT3E22JluSKjkUFHRz/amWYjQ=; b=eGfsnwPVZVIO71JPbTW84JcEoui1jQa8NRwlErE8JWItYxjrqo77N1yIry7iYqtiiK tuPFHm4l7+/z9OREjDu0IFDJwAfC0vRgJhchZ+EzPY1tAC4VB0APO3Do3HTE6rgzu1Tv LKsWO1DBiZObDB/EHvLCIl7ZHWNTfKYHrrPyCzOd0Wwfbvoj/cXSb1Z3nbgUzTF+5ZEc XsG3RJbvGr+ULZw/n/01NaYDwLSh0ytiW83C89w+ex4eLo0HO6HYqjXSczaR3CMemCBZ +8iFYO2g0reU0Jgtx0lytRy0O5sJSVbsa5OgXSvNZfHFXRUcJ5YfxdVaJZnKXEgdXUSX Hhbg== X-Gm-Message-State: AOJu0YxbFluHbKIeYK9l+98lc9DSjQvB0ZIGG+qfzjdTfL6M1ziuXEya 05bbBlPIQRJZTahLCvPbiqF8VF1EAPSbNK/xfL1XDHCHDAEfDoIbKtZ6 X-Gm-Gg: AfdE7cl+mM1lkFuWmbIE6kkMunzC2J1iT64M29w0Kxp7EjnzA6r7+le3pQn6BL1iW8F y6sPZRGJ9gi/H7twjpNAwprNtWgKIipBu6+JKh4jlY2Ai+JyZBUK6l65hqKKtSZwwmgYAzgZO03 yycR34XGmw1opDlSKScSCFii9F3SHpYoinVyZI+t89shrlgGeaCYT70sVnEnKcLOOCrgetMdpGE 74E7OP/wE6qAzvW0vcnEkgMClQjtKAQ1ExatkctONavs2g9gOQuOVTBrCVaAe0YrStPVvc2PH9j n51IdnP/SYe7d0RRsYjwj6VAuDsz9Vu22+qCsyYa8K+W6GHVv/C4gdUDZ4DL+OaQSjxV7wA4BO3 ckUIiXcWGCiU6neh7qpp3uz9K1SfxDpRaps1rZjSX8hFYEpcFE0hmo9yEIoE7xrmAPkh5yMhG25 UryzbH7Ze63gIEWAzFAGUp5ouSs/s8VB7rRQ== X-Received: by 2002:a05:620a:1a15:b0:92e:62e3:3b55 with SMTP id af79cd13be357-93086c2251fmr143532485a.64.1784023963391; Tue, 14 Jul 2026 03:12:43 -0700 (PDT) Received: from FairplayBox ([2601:5cf:837e:d920::f9a2]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92ee5cfcb0dsm1463056185a.25.2026.07.14.03.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 03:12:43 -0700 (PDT) From: Alec Hall To: Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Alec Hall Subject: [PATCH 0/3] HID: Apple Magic Keyboard/Trackpad battery over Bluetooth Date: Tue, 14 Jul 2026 06:12:32 -0400 Message-ID: <20260714101235.99447-1-signshop.alec@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Apple's Magic Keyboard and Magic Trackpad 2 / Magic Mouse 2 report their battery to the host, but the kernel only surfaces it over USB; over Bluetooth the power_supply is stuck at 0%, even though these devices are used over Bluetooth nearly all the time. Both drivers already fetch the battery (a GET_REPORT for input report 0x90) but only over USB. Enabling it over Bluetooth naively hard-locks the machine: the fetch runs from a timer callback (atomic context) and the uhid transport sleeps inside hid_hw_request(). Each driver's patch therefore moves the fetch to a workqueue before enabling it over Bluetooth. The last patch teaches hid-magicmouse to report charge status from the device's status byte. Patch 3 interprets a vendor status byte whose bit meanings were determined empirically; I can rework it as a report-descriptor fixup exposing HID_BAT_CHARGING instead if reviewers prefer. Tested on a Magic Keyboard 2021 and a Magic Trackpad 2 over BlueZ (uhid). Alec Hall (3): HID: apple: report Magic Keyboard battery over Bluetooth HID: magicmouse: report battery over Bluetooth HID: magicmouse: report charge status over Bluetooth drivers/hid/hid-apple.c | 36 ++++++------- drivers/hid/hid-magicmouse.c | 99 ++++++++++++++++++++++++++---------- 2 files changed, 92 insertions(+), 43 deletions(-) base-commit: b7556c8e713c88596046a906c7c4385218d44736 -- 2.55.0