mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] power: supply: surface_battery: handle battery event 0x1a
@ 2026-10-23 17:32 Ramón Jesús Miranda
  2026-11-03  7:21 ` Maximilian Luz
  0 siblings, 1 reply; 2+ messages in thread
From: Ramón Jesús Miranda @ 2026-10-23 17:32 UTC (permalink / raw)
  To: Maximilian Luz, Sebastian Reichel
  Cc: linux-pm, platform-driver-x86, linux-kernel,
	Ramón Jesús Miranda

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: supply: surface_battery: handle battery event 0x1a
  2026-10-23 17:32 [PATCH] power: supply: surface_battery: handle battery event 0x1a Ramón Jesús Miranda
@ 2026-11-03  7:21 ` Maximilian Luz
  0 siblings, 0 replies; 2+ messages in thread
From: Maximilian Luz @ 2026-11-03  7:21 UTC (permalink / raw)
  To: Ramón Jesús Miranda, Sebastian Reichel
  Cc: linux-pm, platform-driver-x86, linux-kernel

Am 23.10.2026 um 19:32 schrieb Ramón Jesús Miranda:
> 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,

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

Best,
Max

>   	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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-03  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 17:32 [PATCH] power: supply: surface_battery: handle battery event 0x1a Ramón Jesús Miranda
2026-11-03  7:21 ` Maximilian Luz

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®