xref: /titanic_52/usr/src/uts/sparc/io/pciex/pcie_sparc.c (revision 56f33205c9ed776c3c909e07d52e94610a675740)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #include <sys/types.h>
27 #include <sys/ddi.h>
28 #include <sys/sunddi.h>
29 #include <sys/sunndi.h>
30 #include <sys/pcie_impl.h>
31 #include <sys/pcie_pwr.h>
32 
33 /* ARGSUSED */
34 void
35 pcie_init_plat(dev_info_t *dip)
36 {
37 }
38 
39 /* ARGSUSED */
40 void
41 pcie_fini_plat(dev_info_t *dip)
42 {
43 }
44 
45 int
46 pcie_plat_pwr_setup(dev_info_t *dip)
47 {
48 	if (ddi_prop_create(DDI_DEV_T_NONE, dip, DDI_PROP_CANSLEEP,
49 	    "pm-want-child-notification?", NULL, NULL) != DDI_PROP_SUCCESS) {
50 		PCIE_DBG("%s(%d): can't create pm-want-child-notification \n",
51 		    ddi_driver_name(dip), ddi_get_instance(dip));
52 		return (DDI_FAILURE);
53 	}
54 	return (DDI_SUCCESS);
55 }
56 
57 /*
58  * Undo whatever is done in pcie_plat_pwr_common_setup
59  */
60 void
61 pcie_plat_pwr_teardown(dev_info_t *dip)
62 {
63 	(void) ddi_prop_remove(DDI_DEV_T_NONE, dip,
64 	    "pm-want-child-notification?");
65 }
66