Writing Device Drivers

Device Power Manangement Flow of Control for Components Other Than Component Zero

As with component zero, the driver uses pm_idle_component(9F) to mark components other than zero as idle. The framework may power off an idle component other than component zero by calling the power(9E) entry point to set the component to power level zero.

When a driver finds that a needed component is powered off, the driver calls ddi_dev_is_needed(9F) on the powered off component. When a driver calls ddi_dev_is_needed(9F) for a component other than component 0 that is powered off, the framework calls power(9E) to set the new power level before ddi_dev_is_needed(9F) returns. ddi_dev_is_needed(9F) keeps the framework informed of the state of the device and arranges for devices that this component depends on to be powered up. When ddi_dev_is_needed(9F) returns, the component is idle but powered on. The driver can mark it as busy by calling pm_busy_component(9F).

Figure 8-1 Power Management Conceptual State Diagram