linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Notification on method execution
@ 2007-09-15 20:49 Matthew Garrett
  2007-09-16 14:38 ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Garrett @ 2007-09-15 20:49 UTC (permalink / raw)
  To: linux-acpi

For certain drivers (such as the Thinkpad ACPI driver[1]), it would be 
helpful to be able to get notifications when a method is executed. I'd 
propose adding a call like acpi_method_notify, extending the method 
field to contain an extra flag for notifications and a callback, having 
acpi_aml_execute check this before executing the methods and perhaps 
checking the return code to decide whether to continue executing the 
method or not (would potentially allow overriding methods, though I'm 
not convinced it's a good idea). Does this sound basically sane? If so, 
I'll do a patch.

[1] Various Thinkpads make predictable method calls when hotkeys are 
pressed, but make no notifications. Hooking into those methods would 
allow those keys to be caught without the requirement to repeatedly poll 
the hardware to see if there's been an update.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [RFC] Notification on method execution
  2007-09-15 20:49 [RFC] Notification on method execution Matthew Garrett
@ 2007-09-16 14:38 ` Henrique de Moraes Holschuh
  2007-09-17  1:55   ` Matthew Garrett
  0 siblings, 1 reply; 3+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-09-16 14:38 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-acpi

On Sat, 15 Sep 2007, Matthew Garrett wrote:
> For certain drivers (such as the Thinkpad ACPI driver[1]), it would be 
> helpful to be able to get notifications when a method is executed. I'd 
> propose adding a call like acpi_method_notify, extending the method 
> field to contain an extra flag for notifications and a callback, having 
> acpi_aml_execute check this before executing the methods and perhaps 
> checking the return code to decide whether to continue executing the 
> method or not (would potentially allow overriding methods, though I'm 
> not convinced it's a good idea). Does this sound basically sane? If so, 
> I'll do a patch.

Yes, I could certainly use something like this on thinkpad-acpi.  It is also
a great way to hot-fix DSDTs, although I don't think any such a hotfix is
the sort of thing I'd add to a Linux mainline driver.

However, this idea of yours looks like a hook API for the AML interpretor,
so I'd suggest you make it complete, and allow for callbacks that are called
BEFORE, AFTER, and INSTEAD of the AML method.

> [1] Various Thinkpads make predictable method calls when hotkeys are 
> pressed, but make no notifications. Hooking into those methods would 
> allow those keys to be caught without the requirement to repeatedly poll 
> the hardware to see if there's been an update.

I'm afraid the very old ones might lack the embedded controller support you
need, especially those without ACPI (but we don't support them anyway).

The entire T-series since the T40 (as long as you update the BIOS) support
all hotkeys in an event-driven fashion in the T43 style.  I am not sure of
the R5x series, but I'd be surprised if they don't support all hotkeys using
events, either.  The X-series since the X31 also support all hot keys using
events in their latest BIOSes.  The *60 and *61 series might have messes on
the volume and brightness key support due to Vista support changes to the
BIOS.

BUT it is certainly useful to have the such support. I am all for it, and
I'd be curious to know how well your trick works on a broad range of
thinkpads.  We can certainly add it to thinkpad-acpi if it is safe.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

* Re: [RFC] Notification on method execution
  2007-09-16 14:38 ` Henrique de Moraes Holschuh
@ 2007-09-17  1:55   ` Matthew Garrett
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2007-09-17  1:55 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh; +Cc: linux-acpi

On Sun, Sep 16, 2007 at 11:38:24AM -0300, Henrique de Moraes Holschuh wrote:

> I'm afraid the very old ones might lack the embedded controller support you
> need, especially those without ACPI (but we don't support them anyway).

A quick scan seems to suggest that stuff back to at least the T23 will 
work here, which I think is probably the vast majority of anything 
anyone's still using. I've hacked preliminary support into Ubuntu in 
order to get an idea of what level of bizarrness we could expect, but it 
seems to work pretty well in my initial testing. Once I've got a better 
idea how well this will work, I'll submit some patches.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

end of thread, other threads:[~2007-09-17  1:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-15 20:49 [RFC] Notification on method execution Matthew Garrett
2007-09-16 14:38 ` Henrique de Moraes Holschuh
2007-09-17  1:55   ` Matthew Garrett

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 NNTP newsgroup(s).