Skip to contentSkip to conversation

power: supply: surface_battery: handle battery event 0x1a

PATCH In review Ramón Jesús Miranda 2 participants 2 messages Oct 23 – Nov 3

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: surface_battery: handle battery event 0x1a

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
---
 drivers/power/supply/surface_battery.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/power/supply/surface_battery.c +2 -0
index c759add..a3fa899 100644
@@ -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.
Signature · 1 line
2.56.0
maintainer
#1 lore raw

Am 23.10.2026 um 19:32 schrieb Ramón Jesús Miranda:

Quoted 21 lines

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
---
  drivers/power/supply/surface_battery.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/power/supply/surface_battery.c +0 -0
index c759add..a3fa899 100644

drivers/power/supply/surface_battery.c enum sam_event_cid_bat { · line 29

Quoted 4 lines
drivers/power/supply/surface_battery.c +1 -0
@@ -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,

I don't particularly like it being named 0x1A. Do we know what exactly triggers this event?

Best,
Max

Quoted 11 lines
drivers/power/supply/surface_battery.c +1 -0
  	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.