Skip to content

Help with getting SW_TABLET_MODE reporting working on the MSI Summit E16 Flip ? #77

@jwrdegoede

Description

@jwrdegoede

Short self introduction I'm a Linux developer mostly working on hw-enablement for Linux laptops. I'm also the subsystem maintainer for kernel drivers under: drivers/platform/x86

I have been working with a user to get SW_TABLET_MODE reporting working on their MSI Summit E16 Flip A12UCT: https://gitlab.freedesktop.org/libinput/libinput/-/issues/822

Looking at the ACPI tables of that model, their is an intel-hid ACPI device (check for HIDD in dsdt.dsl) which should report if the 2-in-1 is folded into tablet-mode or being used in laptop mode. Specifically the bit of ACPI code below should cause 0xcc / 0xcd ACPI notifies to be send which should then get picked up by the https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/intel/hid.c code and translated into SW_TABLET_MODE input events:

    Scope (_SB.PC00.LPCB)
    {
...
        Device (EC)
        {
...
            Method (_Q84, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
            {
                SCIC = 0x84
                DBG8 = 0x84
                If ((IUCE == One))
                {
                    If (MYEC)
                    {
                        CONV = ISHS /* \_SB_.PC00.LPCB.EC__.ISHS */
                        If (((OSYS >= 0x07DF) && ^^^^HIDD.BTLD))
                        {
                            If ((CONV == 0x03))
                            {
                                UPBT (0x06, Zero)
                                Notify (^^^^HIDD, 0xCC) // Hardware-Specific
                            }
                            ElseIf ((CONV == One))
                            {
                                UPBT (0x06, One)
                                Notify (^^^^HIDD, 0xCD) // Hardware-Specific
                            }
                        }
                        ElseIf (CondRefOf (\_SB.PC00.GFX0.IUEH))
                        {
                            ^^^GFX0.IUEH (0x06)
                        }
                    }
                    Else
                    {
                        UPBT (0x06, One)
                        Notify (^^^^HIDD, 0xCD) // Hardware-Specific
                    }

                    Notify (LID0, 0x80) // Status Change
                }
                Else
                {
                    Notify (LID0, 0x80) // Status Change
                }
            }

But it seems that for some reason the EC is never sending 0x84 events, so this code never gets executed by the kernel's ACPI interpreter and we never get the 0xCC / 0xCD notifies on the ACPI HIDD device.

@dmitry-s93 since you have quite a bit of experience with the MSI EC on these devices, I wonder if you have any insights in this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions