Remove whitespace.
[coreboot.git] / src / mainboard / siemens / sitemp_g1p1 / acpi / thermal.asl
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2010 Siemens AG, Inc.
5  * (Written by Josef Kellermann <joseph.kellermann@heitec.de> for Siemens AG, Inc.)
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; version 2 of the License.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19  *
20  */
21
22 /* THERMAL */
23 Scope(\_TZ) {
24         Name (KELV, 2732)
25         Name (THOT, 800)
26         Name (TCRT, 850)
27
28         ThermalZone(TZ00) {
29                 Method(_AC0,0) {        /* Active Cooling 0 (0=highest fan speed) */
30                         /* DBGO("\\_TZ\\TZ00\\_AC0\n") */
31                         Return(Add(0, 2730))
32                 }
33                 Method(_AL0,0) {        /* Returns package of cooling device to turn on */
34                         /* DBGO("\\_TZ\\TZ00\\_AL0\n") */
35                         Return(Package() {\_TZ.TZ00.FAN0})
36                 }
37                 Device (FAN0) {
38                         Name(_HID, EISAID("PNP0C0B"))
39                         Name(_PR0, Package() {PFN0})
40                 }
41
42                 PowerResource(PFN0,0,0) {
43                         Method(_STA) {
44                                 Store(0xF,Local0)
45                                 Return(Local0)
46                         }
47                         Method(_ON) {
48                                 /* DBGO("\\_TZ\\TZ00\\FAN0 _ON\n") */
49                         }
50                         Method(_OFF) {
51                                 /* DBGO("\\_TZ\\TZ00\\FAN0 _OFF\n") */
52                         }
53                 }
54
55                 // Processors used for active cooling
56                 Method (_PSL, 0, Serialized)
57                 {
58                         If (MPEN) {
59                                 Return (Package() {\_PR.CPU0, \_PR.CPU1})
60                         }
61                         Return (Package() {\_PR.CPU0})
62                 }
63
64                 Method(_HOT,0) {        /* return hot temp in tenths degree Kelvin */
65                         /* DBGO("\\_TZ\\TZ00\\_HOT\n") */
66                         Return (Add (THOT, KELV))
67                 }
68                 Method(_CRT,0) {        /* return critical temp in tenths degree Kelvin */
69                         /* DBGO("\\_TZ\\TZ00\\_CRT\n") */
70                         Return (Add (TCRT, KELV))
71                 }
72                 Method(_TMP,0) {        /* return current temp of this zone */
73                         Store (SMBR (0x07, 0x4C,, 0x00), Local0)
74                         If (LGreater (Local0, 0x10)) {
75                                 Store (Local0, Local1)
76                         }
77                         Else {
78                                 Add (Local0, THOT, Local0)
79                                 Return (Add (400, KELV))
80                         }
81
82                         Store (SMBR (0x07, 0x4C, 0x01), Local0)
83                         /* only the two MSBs in the external temperature low byte are used, resolution 0.25. We ignore it */
84                         /* Store (SMBR (0x07, 0x4C, 0x10), Local2) */
85                         If (LGreater (Local0, 0x10)) {
86                                 If (LGreater (Local0, Local1)) {
87                                         Store (Local0, Local1)
88                                 }
89
90                                 Multiply (Local1, 10, Local1)
91                                 Return (Add (Local1, KELV))
92                         }
93                         Else {
94                                 Add (Local0, THOT, Local0)
95                                 Return (Add (400 , KELV))
96                         }
97                 } /* end of _TMP */
98         } /* end of TZ00 */
99 }