Subject: Re: pmf(9): shutdown & D1/D2 states
To: David Young <>
From: Iain Hibbert <>
List: tech-kern
Date: 12/23/2007 22:27:51
On Sun, 23 Dec 2007, David Young wrote:

> I would like to get some feedback on changes that I would like to make
> to the power management (PM) framework, pmf(9), to support D1 and D2
> power-saving states and wake-up events, and also to distinguish device
> shutdown from device suspension.

Personally, if you are going with extending the API then I think it
becomes neater to pass a structure which can ususally be static const, eg

static const struct pmf_if ubt_pmf = {
	.pmf_suspend = ubt_suspend,
	.pmf_resume = ubt_resume,
	.pmf_snooze = ubt_snooze,
	.pmf_powernap = ubt_powernap,
	.pmf_remsleep = ubt_remsleep,


	pmf_device_register(&ubt_pmf, self);

and it makes it easier to extend later without rototilling or macro magic?