LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] platform/surface: aggregator_tabletsw: Add support for book mode
@ 2023-05-25 21:32 Maximilian Luz
  2023-05-25 21:32 ` [PATCH 1/2] platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem Maximilian Luz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Maximilian Luz @ 2023-05-25 21:32 UTC (permalink / raw
  To: Hans de Goede
  Cc: Mark Gross, platform-driver-x86, linux-kernel, Maximilian Luz

Surface devices with a type-cover have an additional "book" mode. This
mode is activated when the device is oriented in portrait mode and the
type-cover is in an open position (including completely folded back;
unlike in landscape orientation there are no special modes for any of
the intermediate positions).

Currently, this mode is unsupported by the tablet switch driver, leading
to an error message (see individual commits for the exact messages).
Since the keyboard and touchpad input gets deactivated in this mode, map
it to tablet-mode.

I've split this change into two patches, one for each of the subsystems
(KIP and POS). This a) allows proper attribution via the "Fixes" tag and
b) with that should allow them to be backported fairly easily.

Maximilian Luz (2):
  platform/surface: aggregator_tabletsw: Add support for book mode in
    KIP subsystem
  platform/surface: aggregator_tabletsw: Add support for book mode in
    POS subsystem

 drivers/platform/surface/surface_aggregator_tabletsw.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.40.1


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

* [PATCH 1/2] platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem
  2023-05-25 21:32 [PATCH 0/2] platform/surface: aggregator_tabletsw: Add support for book mode Maximilian Luz
@ 2023-05-25 21:32 ` Maximilian Luz
  2023-05-25 21:32 ` [PATCH 2/2] platform/surface: aggregator_tabletsw: Add support for book mode in POS subsystem Maximilian Luz
  2023-05-30  9:25 ` [PATCH 0/2] platform/surface: aggregator_tabletsw: Add support for book mode Hans de Goede
  2 siblings, 0 replies; 4+ messages in thread
From: Maximilian Luz @ 2023-05-25 21:32 UTC (permalink / raw
  To: Hans de Goede
  Cc: Mark Gross, platform-driver-x86, linux-kernel, Maximilian Luz

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: 9f794056db5b ("platform/surface: Add KIP/POS tablet-mode switch driver")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
---
 drivers/platform/surface/surface_aggregator_tabletsw.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/platform/surface/surface_aggregator_tabletsw.c b/drivers/platform/surface/surface_aggregator_tabletsw.c
index 8f52b62d1c195..4a029f5db20a9 100644
--- a/drivers/platform/surface/surface_aggregator_tabletsw.c
+++ b/drivers/platform/surface/surface_aggregator_tabletsw.c
@@ -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:
-- 
2.40.1


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

* [PATCH 2/2] platform/surface: aggregator_tabletsw: Add support for book mode in POS subsystem
  2023-05-25 21:32 [PATCH 0/2] platform/surface: aggregator_tabletsw: Add support for book mode Maximilian Luz
  2023-05-25 21:32 ` [PATCH 1/2] platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem Maximilian Luz
@ 2023-05-25 21:32 ` Maximilian Luz
  2023-05-30  9:25 ` [PATCH 0/2] platform/surface: aggregator_tabletsw: Add support for book mode Hans de Goede
  2 siblings, 0 replies; 4+ messages in thread
From: Maximilian Luz @ 2023-05-25 21:32 UTC (permalink / raw
  To: Hans de Goede
  Cc: Mark Gross, platform-driver-x86, linux-kernel, Maximilian Luz

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: 37ff64cd81ff ("platform/surface: aggregator_tabletsw: Add support for Type-Cover posture source")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
---
 drivers/platform/surface/surface_aggregator_tabletsw.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/platform/surface/surface_aggregator_tabletsw.c b/drivers/platform/surface/surface_aggregator_tabletsw.c
index 4a029f5db20a9..c0a1a5869246e 100644
--- a/drivers/platform/surface/surface_aggregator_tabletsw.c
+++ b/drivers/platform/surface/surface_aggregator_tabletsw.c
@@ -340,6 +340,7 @@ enum ssam_pos_state_cover {
 	SSAM_POS_COVER_LAPTOP        = 0x03,
 	SSAM_POS_COVER_FOLDED_CANVAS = 0x04,
 	SSAM_POS_COVER_FOLDED_BACK   = 0x05,
+	SSAM_POS_COVER_BOOK          = 0x06,
 };
 
 enum ssam_pos_state_sls {
@@ -372,6 +373,9 @@ static const char *ssam_pos_state_name_cover(struct ssam_tablet_sw *sw, u32 stat
 	case SSAM_POS_COVER_FOLDED_BACK:
 		return "folded-back";
 
+	case SSAM_POS_COVER_BOOK:
+		return "book";
+
 	default:
 		dev_warn(&sw->sdev->dev, "unknown device posture for type-cover: %u\n", state);
 		return "<unknown>";
@@ -421,6 +425,7 @@ static bool ssam_pos_state_is_tablet_mode_cover(struct ssam_tablet_sw *sw, u32 s
 	case SSAM_POS_COVER_DISCONNECTED:
 	case SSAM_POS_COVER_FOLDED_CANVAS:
 	case SSAM_POS_COVER_FOLDED_BACK:
+	case SSAM_POS_COVER_BOOK:
 		return true;
 
 	case SSAM_POS_COVER_CLOSED:
-- 
2.40.1


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

* Re: [PATCH 0/2] platform/surface: aggregator_tabletsw: Add support for book mode
  2023-05-25 21:32 [PATCH 0/2] platform/surface: aggregator_tabletsw: Add support for book mode Maximilian Luz
  2023-05-25 21:32 ` [PATCH 1/2] platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem Maximilian Luz
  2023-05-25 21:32 ` [PATCH 2/2] platform/surface: aggregator_tabletsw: Add support for book mode in POS subsystem Maximilian Luz
@ 2023-05-30  9:25 ` Hans de Goede
  2 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2023-05-30  9:25 UTC (permalink / raw
  To: Maximilian Luz; +Cc: Mark Gross, platform-driver-x86, linux-kernel

Hi,

On 5/25/23 23:32, Maximilian Luz wrote:
> Surface devices with a type-cover have an additional "book" mode. This
> mode is activated when the device is oriented in portrait mode and the
> type-cover is in an open position (including completely folded back;
> unlike in landscape orientation there are no special modes for any of
> the intermediate positions).
> 
> Currently, this mode is unsupported by the tablet switch driver, leading
> to an error message (see individual commits for the exact messages).
> Since the keyboard and touchpad input gets deactivated in this mode, map
> it to tablet-mode.
> 
> I've split this change into two patches, one for each of the subsystems
> (KIP and POS). This a) allows proper attribution via the "Fixes" tag and
> b) with that should allow them to be backported fairly easily.

Thank you for your patch series, I've applied this series
to my fixes branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes

I will include this series in my next fixes pull-req to Linus
for the current kernel development cycle.

Regards,

Hans






> Maximilian Luz (2):
>   platform/surface: aggregator_tabletsw: Add support for book mode in
>     KIP subsystem
>   platform/surface: aggregator_tabletsw: Add support for book mode in
>     POS subsystem
> 
>  drivers/platform/surface/surface_aggregator_tabletsw.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 


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

end of thread, other threads:[~2023-05-30  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25 21:32 [PATCH 0/2] platform/surface: aggregator_tabletsw: Add support for book mode Maximilian Luz
2023-05-25 21:32 ` [PATCH 1/2] platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem Maximilian Luz
2023-05-25 21:32 ` [PATCH 2/2] platform/surface: aggregator_tabletsw: Add support for book mode in POS subsystem Maximilian Luz
2023-05-30  9:25 ` [PATCH 0/2] platform/surface: aggregator_tabletsw: Add support for book mode Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).