Re: Notifications about ACPI events in userspace?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 12, 2017 at 10:37:47AM +0200, Florian Echtler wrote:
> I'm currently adding support for the iMac's target display mode (TDM) to
> Linux.

Cool!


> When an external DisplayPort source is added/removed, the following ACPI
> code is invoked:
> 
>     Scope (\_SB.PCI0.LPCB.SMC)
>     {
>         Device (DPPT)
>         {
>             Name (_HID, EisaId ("APP000C"))  // _HID: Hardware ID
>             Name (_CID, "smc-dppt")  // _CID: Compatible ID
>         }
>     }
> 
>    Scope (\_SB.PCI0.LPCB.EC)
>     {
>         Method (_Q30, 0, NotSerialized)  // _Qxx: EC Query
>         {
>             Notify (\_SB.PCI0.LPCB.SMC.DPPT, 0x80) // Status Change
>         }
> 
>         Method (_Q31, 0, NotSerialized)  // _Qxx: EC Query
>         {
>             Notify (\_SB.PCI0.LPCB.SMC.DPPT, 0x81) // Information Change
>         }
>     }
> 
> 
> I've already verified that the method calls do indeed take place, by
> turning on EC debugging. The APP000C device does also exist in /sys.
> 
> However, I'm not seeing anything happening with either acpi_listen or
> kacpimon.
> Does this require any kernel changes, or could I subscribe to these
> events somehow?

You can subscribe to these events by calling acpi_install_notify_handler().
See drivers/platform/x86/apple-gmux.c for an example.  That's a driver for
APP000B, a custom chip found on dual-GPU MacBook Pros dubbed GMUX which is
responsible for multiplexing the panel between the GPUs.

I'm not sure what APP000C is, could be a similar custom controller, I'd have
to do some research first to know what it does.  Surely "DP" stands for
DisplayPort, but what does "PT" stand for?

Perhaps apple-gmux.c could serve as a template for an APP000C driver.
The code should be easy to understand, if you have questions just ask away.

Thanks,

Lukas
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux