Writing Device Drivers

Power Management

These interfaces support power management functionality.

int ddi_dev_is_needed(dev_info_t *dip, int component,  	 
			int level);

ddi_dev_is_needed(9F) informs the system that a device component is needed at the specified power level. It sets the component to the required level and sets all of the devices on which it depends (see pm(7D)) to their normal power levels. If component 0 of the device is at power level 0, the ddi_dev_is_needed(9F) call will result in component 0 being returned to normal power and the device being resumed via attach(9E) before ddi_dev_is_needed(9F) returns.

int pm_create_components(dev_info_t *dip, int components);

pm_create_components(9F) creates power manageable components for a device. This function is called from the driver's attach(9F) entry point if a device has power manageable components.

void pm_destroy_components(dev_info_t *dip,);

pm_destroy_components(9F) removes power manageable components for a device. This function is called from the driver's detach(9F) entry point.

int pm_get_normal_power(dev_info_t *dip, int component);

pm_get_normal_power(9F) returns the normal power level of a device component.

void pm_set_normal_power(dev_info_t *dip,  	
			int component, int level);

pm_set_normal_power(9F) sets a device component to the specified power level.

int pm_busy_component(dev_info_t *dip, int component);

pm_busy_component(9F) sets a device component to busy. When a device component is busy, it will not be power-managed by the system.

int pm_idle_component(dev_info_t *dip, int component);

pm_idle_component(9F) sets a device component to idle. A device component that is idle is available to be power-managed by the system.