]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciPowerManagement.c
Coding style modification.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciPowerManagement.c
CommitLineData
3db51098 1/**@file\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12**/\r
ead42efc 13\r
14#include "pcibus.h"\r
15\r
16EFI_STATUS\r
17ResetPowerManagementFeature (\r
18 IN PCI_IO_DEVICE *PciIoDevice\r
19 )\r
bcd70414 20/**\r
ead42efc 21\r
22Routine Description:\r
23\r
24 This function is intended to turn off PWE assertion and\r
25 put the device to D0 state if the device supports\r
26 PCI Power Management.\r
27\r
28Arguments:\r
29\r
30Returns:\r
31 \r
32 None\r
33\r
bcd70414 34**/\r
ead42efc 35// TODO: PciIoDevice - add argument and description to function comment\r
36// TODO: EFI_UNSUPPORTED - add return value to function comment\r
37// TODO: EFI_SUCCESS - add return value to function comment\r
38{\r
39 EFI_STATUS Status;\r
40 UINT8 PowerManagementRegBlock;\r
41 UINT16 PMCSR;\r
42\r
43 PowerManagementRegBlock = 0;\r
44\r
45 Status = LocateCapabilityRegBlock (\r
46 PciIoDevice,\r
47 EFI_PCI_CAPABILITY_ID_PMI,\r
48 &PowerManagementRegBlock,\r
49 NULL\r
50 );\r
51\r
52 if (EFI_ERROR (Status)) {\r
53 return EFI_UNSUPPORTED;\r
54 }\r
55\r
56 //\r
57 // Turn off the PWE assertion and put the device into D0 State\r
58 //\r
59 PMCSR = 0x8000;\r
60\r
61 //\r
62 // Write PMCSR\r
63 //\r
64 PciIoWrite (\r
65 &PciIoDevice->PciIo,\r
66 EfiPciIoWidthUint16,\r
67 PowerManagementRegBlock + 4,\r
68 1,\r
69 &PMCSR\r
70 );\r
71\r
72 return EFI_SUCCESS;\r
73}\r