* rebased llvm/hotfix-sparcv9-not-64.diff
[t2sde.git] / package / powerpc / pbbuttonsd / non-book.patch
blob5758f6d8c33f14d04f408a217eb262446f0ef6d3
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../pbbuttonsd/non-book.patch
5 # Copyright (C) 2008 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 Workstations, such as PowerMac's, the Cube or iMacs do not have a cover,
18 and thus we must not inf. loop re-sleeping the machine.
20 - Rene Rebe <rene@exactcode.de>
22 --- pbbuttonsd-0.8.1/src/module_pmac.c 2007-07-01 13:05:17.000000000 +0200
23 +++ pbbuttonsd-0.8.1-cube/src/module_pmac.c 2008-08-24 10:40:49.000000000 +0200
24 @@ -60,6 +60,7 @@
25 int version; /* PMU version */
26 int machine; /* OpenFirmware machine code */
27 int lmuaddr; /* i2c address of LMU Controller */
28 + int cover; /* no cover, e.g. PowerMac, iMac, Cube, etc. */
29 struct modflags_pmac flags;
30 int flagschanged; /* PMU flags that have changed recently */
31 int oharevolbutton; /* level of volume button on OHARE PBs scaled to 0..100 */
32 @@ -120,6 +121,7 @@
33 #if defined(DEBUG) && SIMU_AMBIENT
34 base->ambient = 0;
35 #endif
36 + base->cover = 1; /* until we find otherwise, we assume laptop with cover */
37 base->flags.coveropen = 1; /* lid is open */
38 base->flags.sleepsupported = 0; /* sleep not supported by default */
39 base->flags.set_kbdmode = 0; /* request flags for delayed actions */
40 @@ -324,7 +326,7 @@
41 do {
42 activate_sleepmode ();
43 base->flagschanged = pmac_update_flags ();
44 - } while (base->flags.coveropen == 0);
45 + } while (base->cover && base->flags.coveropen == 0);
46 #endif
47 base->timeleft = 7200; /* reset time value so that the */
48 /* filter approximate the real value from top. Otherwise */
49 @@ -1605,6 +1612,7 @@
50 int
51 getMachineID(int pmu)
53 + struct moddata_pmac *base = &modbase_pmac;
54 char buffer[32];
55 int fd, n, machine = 0;
57 @@ -1622,6 +1630,9 @@
58 machine |= atoi(&buffer[n+1]) & 0xf;
61 + else if (strncmp("PowerMac", buffer, 8) == 0) {
62 + base->cover = 0;
63 + }
65 close(fd);