Skip to content

Commit 2fc6d0e

Browse files
committed
Merge branch 'psy-fixes' into psy-next
2 parents eab4e6d + 601423b commit 2fc6d0e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

drivers/power/supply/surface_battery.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,16 @@ static u32 spwr_notify_bat(struct ssam_event_notifier *nf, const struct ssam_eve
345345
struct spwr_battery_device *bat = container_of(nf, struct spwr_battery_device, notif);
346346
int status;
347347

348+
/*
349+
* We cannot use strict matching when registering the notifier as the
350+
* EC expects us to register it against instance ID 0. Strict matching
351+
* would thus drop events, as those may have non-zero instance IDs in
352+
* this subsystem. So we need to check the instance ID of the event
353+
* here manually.
354+
*/
355+
if (event->instance_id != bat->sdev->uid.instance)
356+
return 0;
357+
348358
dev_dbg(&bat->sdev->dev, "power event (cid = %#04x, iid = %#04x, tid = %#04x)\n",
349359
event->command_id, event->instance_id, event->target_id);
350360

@@ -720,8 +730,8 @@ static void spwr_battery_init(struct spwr_battery_device *bat, struct ssam_devic
720730
bat->notif.base.fn = spwr_notify_bat;
721731
bat->notif.event.reg = registry;
722732
bat->notif.event.id.target_category = sdev->uid.category;
723-
bat->notif.event.id.instance = 0;
724-
bat->notif.event.mask = SSAM_EVENT_MASK_STRICT;
733+
bat->notif.event.id.instance = 0; /* need to register with instance 0 */
734+
bat->notif.event.mask = SSAM_EVENT_MASK_TARGET;
725735
bat->notif.event.flags = SSAM_EVENT_SEQUENCED;
726736

727737
bat->psy_desc.name = bat->name;

drivers/power/supply/surface_charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct spwr_ac_device {
6666

6767
static int spwr_ac_update_unlocked(struct spwr_ac_device *ac)
6868
{
69-
u32 old = ac->state;
69+
__le32 old = ac->state;
7070
int status;
7171

7272
lockdep_assert_held(&ac->lock);

0 commit comments

Comments
 (0)