On Fri, Nov 29, 2013 at 02:35:37AM +0100, Andreas Noever wrote:> 
> There are still a number of limitations:
>  (1) The system must be booted with acpi_osi=Darwin. Otherwise ACPI will cut
> power to the controller.
>  (2) After suspend the controller is gone. I think that ACPI thinks that we 
> are
> Windows and cuts power, even with acpi_osi=Darwin.

There's a few ACPI methods involved here. The first is DTLK, which is 
called by the firmware on resume. It'll cut power to the chip. So, you 
need to be able to power it back up. However, you only want to power it 
up if there's a device connected. The XRIL method will return 1 if 
there's a device connected and 0 otherwise. If there's a device 
connected, call XRPE with an argument of 1 to power it back up.

That works fine if there's no hotplugging involved, but there is so 
things get a little more complicated. Apple provide an out of band 
mechanism for receiving notifications on the device. Call the _GPE 
method and install a gpe handler for the value that you get back. This 
will be called on every device plug or unplug (possibly just plug? It's 
been a while since I tested). Call XRIL to confirm that there's a device 
attached and then call XRPE to power it up.

At least, that's my recollection. There's also the SXIO, SXIL, SXLV and 
SXFP methods that provide some kind of power management, but I'm not 
sure how those fit in.

If you want to confirm that you're supposed to be using these methods, 
call _DSM on the device with a UUID of 
C6B7B5A0-1813-1C44-B0C9-FE695EAF949B (see DTGP in the DSDT), arg1 of 1, 
arg2 of 0. If it's an Apple you'll get back return value of 1 and a 
buffer containing the string "power-save". If it's not an Apple, or if 
the device doesn't support power saving, you'll get back a zero or an 
error that the method wasn't found.


-- 
Matthew Garrett | mj...@srcf.ucam.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to