Contents

registerPowerDriver

Registers a set of power states that the driver supports.

Declaration

virtual IOReturn registerPowerDriver( 
 IOService *controllingDriver, 
 IOPMPowerState *powerStates, 
 unsigned longnumberOfStates );

Parameters

  • controllingDriver:

    A pointer to the calling driver, usually this.

  • powerStates:

    A driver-defined array of power states that the driver and device support. Power states are defined in pwr_mgt/IOPMpowerState.h.

  • numberOfStates:

    The number of power states in the array.

Return Value

IOPMNoErr. All errors are logged via kprintf.

Overview

A driver defines its array of supported power states with power management in its power management initialization (its start routine). If successful, power management will call the driver to instruct it to change its power state through setPowerState. Most drivers do not need to override registerPowerDriver. A nub may override registerPowerDriver if it needs to arrange its children in the power plane differently than the default placement, but this is uncommon.

See Also

Miscellaneous