mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
platform/surface: aggregator_tabletsw: Add support for book mode in KIP 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:0e:01:00:01: unknown KIP cover state: 6
Therefore, add support for this state and map it to enable tablet-mode.
Fixes: 9f794056db
("platform/surface: Add KIP/POS tablet-mode switch driver")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20230525213218.2797480-2-luzmaximilian@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
539e0a7f91
commit
9bed667033
1 changed files with 5 additions and 0 deletions
|
@ -210,6 +210,7 @@ enum ssam_kip_cover_state {
|
|||
SSAM_KIP_COVER_STATE_LAPTOP = 0x03,
|
||||
SSAM_KIP_COVER_STATE_FOLDED_CANVAS = 0x04,
|
||||
SSAM_KIP_COVER_STATE_FOLDED_BACK = 0x05,
|
||||
SSAM_KIP_COVER_STATE_BOOK = 0x06,
|
||||
};
|
||||
|
||||
static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw,
|
||||
|
@ -231,6 +232,9 @@ static const char *ssam_kip_cover_state_name(struct ssam_tablet_sw *sw,
|
|||
case SSAM_KIP_COVER_STATE_FOLDED_BACK:
|
||||
return "folded-back";
|
||||
|
||||
case SSAM_KIP_COVER_STATE_BOOK:
|
||||
return "book";
|
||||
|
||||
default:
|
||||
dev_warn(&sw->sdev->dev, "unknown KIP cover state: %u\n", state->state);
|
||||
return "<unknown>";
|
||||
|
@ -244,6 +248,7 @@ static bool ssam_kip_cover_state_is_tablet_mode(struct ssam_tablet_sw *sw,
|
|||
case SSAM_KIP_COVER_STATE_DISCONNECTED:
|
||||
case SSAM_KIP_COVER_STATE_FOLDED_CANVAS:
|
||||
case SSAM_KIP_COVER_STATE_FOLDED_BACK:
|
||||
case SSAM_KIP_COVER_STATE_BOOK:
|
||||
return true;
|
||||
|
||||
case SSAM_KIP_COVER_STATE_CLOSED:
|
||||
|
|
Loading…
Reference in a new issue