2 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH POWER 9E "Sep 16, 2016"
8 power \- power a device attached to the system
13 #include <sys/sunddi.h>
17 \fBint prefix\fR\fBpower\fR(\fBdev_info_t\fR \fI*dip\fR, \fBint\fR \fIcomponent\fR, \fBint\fR \fIlevel\fR);
22 Solaris DDI specific (Solaris DDI). This entry point is required. If the driver
23 writer does not supply this entry point, the value \fBNULL\fR must be used in
24 the \fBdev_ops\fR(9S) structure instead.
31 Pointer to the device's \fBdev_info\fR structure.
40 Component of the driver to be managed.
49 Desired component power level.
54 The \fBpower\fR(9E) function is the device-specific Power Management entry
55 point. This function is called when the system wants the driver to set the
56 power level of \fIcomponent\fR to \fIlevel\fR.
59 The \fIlevel\fR argument is the driver-defined power level to which the
60 component needs to be set. Except for power level \fB0\fR, which is interpreted
61 by the framework to mean "powered off," the interpretation of \fIlevel\fR is
62 entirely up to the driver.
65 The \fIcomponent\fR argument is the component of the device to be
66 power-managed. The interpretation of \fIcomponent\fR is entirely up to the
70 When a requested power transition would cause the device to lose state, the
71 driver must save the state of the device in memory. When a requested power
72 transition requires state to be restored, the driver must restore that state.
75 If a requested power transition for one component requires another component to
76 change power state before it can be completed, the driver must call
77 \fBpm_raise_power\fR(9F) to get the other component changed, and the
78 \fBpower\fR(9E) entry point must support being re-entered.
81 If the system requests an inappropriate power transition for the device (for
82 example, a request to power down a device which has just become busy), then the
83 power level should not be changed and power should return \fBDDI_FAILURE\fR.
86 The \fBpower()\fR function returns:
90 \fB\fBDDI_SUCCESS\fR\fR
93 Successfully set the power to the requested \fIlevel\fR.
99 \fB\fBDDI_FAILURE\fR\fR
102 Failed to set the power to the requested \fIlevel\fR.
107 The \fBpower()\fR function is called from user or kernel context only.
110 See \fBattributes\fR(5) for descriptions of the following attributes:
118 ATTRIBUTE TYPE ATTRIBUTE VALUE
120 Interface stability Committed
125 \fBattach\fR(9E), \fBdetach\fR(9E), \fBpm_busy_component\fR(9F),
126 \fBpm_idle_component\fR(9F), \fBpm_raise_power\fR(9F), \fBdev_ops\fR(9S)
129 \fIWriting Device Drivers\fR
132 \fIUsing Power Management\fR