Skip to content

Commit 061c228

Browse files
qzedjwrdegoede
authored andcommitted
platform/surface: aggregator_tabletsw: Add support for book mode in POS subsystem
Devices with a type-cover have an additional "book" mode, deactivating type-cover input and turning off its backlight. This is currently unsupported, leading to the warning surface_aggregator_tablet_mode_switch 01:26:01:00:01: unknown device posture for type-cover: 6 Therefore, add support for this state and map it to enable tablet-mode. Fixes: 37ff64c ("platform/surface: aggregator_tabletsw: Add support for Type-Cover posture source") Signed-off-by: Maximilian Luz <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 9bed667 commit 061c228

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/platform/surface/surface_aggregator_tabletsw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ enum ssam_pos_state_cover {
340340
SSAM_POS_COVER_LAPTOP = 0x03,
341341
SSAM_POS_COVER_FOLDED_CANVAS = 0x04,
342342
SSAM_POS_COVER_FOLDED_BACK = 0x05,
343+
SSAM_POS_COVER_BOOK = 0x06,
343344
};
344345

345346
enum ssam_pos_state_sls {
@@ -372,6 +373,9 @@ static const char *ssam_pos_state_name_cover(struct ssam_tablet_sw *sw, u32 stat
372373
case SSAM_POS_COVER_FOLDED_BACK:
373374
return "folded-back";
374375

376+
case SSAM_POS_COVER_BOOK:
377+
return "book";
378+
375379
default:
376380
dev_warn(&sw->sdev->dev, "unknown device posture for type-cover: %u\n", state);
377381
return "<unknown>";
@@ -421,6 +425,7 @@ static bool ssam_pos_state_is_tablet_mode_cover(struct ssam_tablet_sw *sw, u32 s
421425
case SSAM_POS_COVER_DISCONNECTED:
422426
case SSAM_POS_COVER_FOLDED_CANVAS:
423427
case SSAM_POS_COVER_FOLDED_BACK:
428+
case SSAM_POS_COVER_BOOK:
424429
return true;
425430

426431
case SSAM_POS_COVER_CLOSED:

0 commit comments

Comments
 (0)