File: tumbler.patch

package info (click to toggle)
alsa-driver 1.0.23%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,448 kB
  • ctags: 77,491
  • sloc: ansic: 473,525; sh: 3,307; makefile: 2,661; python: 1,527; perl: 1,316; awk: 66
file content (59 lines) | stat: -rw-r--r-- 1,477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--- ../alsa-kernel/ppc/tumbler.c	2008-08-08 15:23:46.000000000 +0200
+++ tumbler.c	2008-08-08 15:29:52.000000000 +0200
@@ -1,3 +1,5 @@
+#define __NO_VERSION__
+#include "adriver.h"
 /*
  * PMac Tumbler/Snapper lowlevel functions
  *
@@ -38,6 +40,14 @@
 #include "pmac.h"
 #include "tumbler_volume.h"
 
+#include "ppc-prom-hack.h"
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+#define of_device_is_compatible(dev, s) device_is_compatible(dev, s)
+#define i2c_smbus_write_i2c_block_data(client, cmd, len, vals) \
+	i2c_smbus_write_block_data(client, cmd, len, vals)
+#endif
+
 #undef DEBUG
 
 #ifdef DEBUG
@@ -961,7 +971,11 @@
 	}
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+static struct tq_struct device_change;
+#else
 static struct work_struct device_change;
+#endif
 static struct snd_pmac *device_change_chip;
 
 static void device_change_handler(struct work_struct *work)
@@ -1033,7 +1047,11 @@
 		if (snd_BUG_ON(!mix))
 			return;
 		mix->auto_mute_notify = do_notify;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+		schedule_task(&device_change);
+#else
 		schedule_work(&device_change);
+#endif
 	}
 }
 #endif /* PMAC_SUPPORT_AUTOMUTE */
@@ -1447,7 +1465,11 @@
 	chip->resume = tumbler_resume;
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	INIT_TQUEUE(&device_change, device_change_handler, (void *)chip);
+#else
 	INIT_WORK(&device_change, device_change_handler);
+#endif
 	device_change_chip = chip;
 
 #ifdef PMAC_SUPPORT_AUTOMUTE