mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ramón Jesús Miranda" <ramonjesusmiranda@gmail.com>
To: Maximilian Luz <luzmaximilian@gmail.com>,
	Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Ramón Jesús Miranda" <ramonjesusmiranda@gmail.com>
Subject: [PATCH] power: supply: surface_battery: handle battery event 0x1a
Date: Fri, 23 Oct 2026 17:32:15 +0000	[thread overview]
Message-ID: <20261023173215.6233-1-ramonjesusmiranda@gmail.com> (raw)

On the Microsoft Surface Pro 11 (Snapdragon X Elite / X1E80100), the
Surface Aggregator Module (SAM) emits battery target category (0x02) event
CID 0x1a alongside standard battery status notifications. Because CID 0x1a
is currently unhandled in spwr_battery_event(), surface_battery logs:

  surface_battery: unhandled battery event (cid = 0x1a)

Add SAM_EVENT_CID_BAT_0x1A (0x1a) and trigger a battery status recheck via
spwr_battery_recheck_full(), matching the existing battery state events.

Assisted-by: Antigravity:gemini-2.5-pro
Signed-off-by: Ramón Jesús Miranda <ramonjesusmiranda@gmail.com>
---
 drivers/power/supply/surface_battery.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/power/supply/surface_battery.c b/drivers/power/supply/surface_battery.c
index c759add..a3fa899 100644
--- a/drivers/power/supply/surface_battery.c
+++ b/drivers/power/supply/surface_battery.c
@@ -26,6 +26,7 @@ enum sam_event_cid_bat {
 	SAM_EVENT_CID_BAT_BST         = 0x16,
 	SAM_EVENT_CID_BAT_ADP         = 0x17,
 	SAM_EVENT_CID_BAT_PROT        = 0x18,
+	SAM_EVENT_CID_BAT_0x1A        = 0x1a,
 	SAM_EVENT_CID_BAT_DPTF        = 0x53,
 };
 
@@ -368,6 +369,7 @@ static u32 spwr_notify_bat(struct ssam_event_notifier *nf, const struct ssam_eve
 		break;
 
 	case SAM_EVENT_CID_BAT_PROT:
+	case SAM_EVENT_CID_BAT_0x1A:
 		/*
 		 * TODO: Implement support for battery protection status change
 		 *       event.
-- 
2.56.0


                 reply	other threads:[~2026-10-23 17:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261023173215.6233-1-ramonjesusmiranda@gmail.com \
    --to=ramonjesusmiranda@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=luzmaximilian@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sre@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

all inboxes | Powered by JetHome®