aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/floppy.h5
-rw-r--r--include/asm-arm/floppy.h2
-rw-r--r--include/asm-arm26/floppy.h2
-rw-r--r--include/asm-generic/bug.h13
-rw-r--r--include/asm-generic/percpu.h2
-rw-r--r--include/asm-i386/floppy.h5
-rw-r--r--include/asm-i386/mach-default/setup_arch.h (renamed from include/asm-i386/mach-default/setup_arch_pre.h)0
-rw-r--r--include/asm-i386/mach-default/setup_arch_post.h40
-rw-r--r--include/asm-i386/mach-visws/setup_arch.h (renamed from include/asm-i386/mach-visws/setup_arch_pre.h)0
-rw-r--r--include/asm-i386/mach-visws/setup_arch_post.h49
-rw-r--r--include/asm-i386/mach-voyager/setup_arch.h (renamed from include/asm-i386/mach-voyager/setup_arch_pre.h)2
-rw-r--r--include/asm-i386/mach-voyager/setup_arch_post.h73
-rw-r--r--include/asm-i386/setup.h15
-rw-r--r--include/asm-i386/uaccess.h50
-rw-r--r--include/asm-ia64/percpu.h2
-rw-r--r--include/asm-m68k/amigaints.h96
-rw-r--r--include/asm-m68k/apollohw.h4
-rw-r--r--include/asm-m68k/atari_stdma.h2
-rw-r--r--include/asm-m68k/atariints.h11
-rw-r--r--include/asm-m68k/bvme6000hw.h30
-rw-r--r--include/asm-m68k/cacheflush.h40
-rw-r--r--include/asm-m68k/dma-mapping.h90
-rw-r--r--include/asm-m68k/irq.h106
-rw-r--r--include/asm-m68k/mac_oss.h10
-rw-r--r--include/asm-m68k/machdep.h6
-rw-r--r--include/asm-m68k/macintosh.h10
-rw-r--r--include/asm-m68k/macints.h14
-rw-r--r--include/asm-m68k/mvme147hw.h44
-rw-r--r--include/asm-m68k/mvme16xhw.h40
-rw-r--r--include/asm-m68k/scatterlist.h9
-rw-r--r--include/asm-m68k/signal.h19
-rw-r--r--include/asm-m68k/sun3ints.h22
-rw-r--r--include/asm-m68k/traps.h7
-rw-r--r--include/asm-m68k/uaccess.h234
-rw-r--r--include/asm-mips/compat.h3
-rw-r--r--include/asm-mips/mach-generic/floppy.h2
-rw-r--r--include/asm-mips/mach-jazz/floppy.h2
-rw-r--r--include/asm-parisc/floppy.h6
-rw-r--r--include/asm-powerpc/backlight.h30
-rw-r--r--include/asm-powerpc/floppy.h3
-rw-r--r--include/asm-powerpc/percpu.h2
-rw-r--r--include/asm-ppc/floppy.h6
-rw-r--r--include/asm-s390/percpu.h2
-rw-r--r--include/asm-sh/floppy.h7
-rw-r--r--include/asm-sparc64/percpu.h2
-rw-r--r--include/asm-x86_64/floppy.h6
-rw-r--r--include/asm-x86_64/percpu.h2
-rw-r--r--include/linux/acct.h8
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/console.h1
-rw-r--r--include/linux/cpumask.h4
-rw-r--r--include/linux/dvb/dmx.h26
-rw-r--r--include/linux/eventpoll.h2
-rw-r--r--include/linux/ext3_fs.h31
-rw-r--r--include/linux/ext3_fs_i.h16
-rw-r--r--include/linux/fb.h23
-rw-r--r--include/linux/fcntl.h1
-rw-r--r--include/linux/fuse.h36
-rw-r--r--include/linux/hrtimer.h3
-rw-r--r--include/linux/i2c-id.h3
-rw-r--r--include/linux/ide.h3
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/kthread.h65
-rw-r--r--include/linux/ktime.h8
-rw-r--r--include/linux/list.h134
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/migrate.h11
-rw-r--r--include/linux/mm.h3
-rw-r--r--include/linux/nbd.h12
-rw-r--r--include/linux/parport.h5
-rw-r--r--include/linux/pmu.h4
-rw-r--r--include/linux/reboot.h4
-rw-r--r--include/linux/resource.h4
-rw-r--r--include/linux/rtc-v3020.h35
-rw-r--r--include/linux/rtc.h12
-rw-r--r--include/linux/sched.h11
-rw-r--r--include/linux/synclink.h5
-rw-r--r--include/linux/sysctl.h4
-rw-r--r--include/linux/ufs_fs.h104
-rw-r--r--include/linux/ufs_fs_i.h1
-rw-r--r--include/linux/videodev.h51
-rw-r--r--include/linux/videodev2.h392
-rw-r--r--include/media/cx2341x.h189
-rw-r--r--include/media/ir-common.h5
-rw-r--r--include/media/ir-kbd-i2c.h3
-rw-r--r--include/media/ovcamchip.h1
-rw-r--r--include/media/pwc-ioctl.h325
-rw-r--r--include/media/saa7115.h11
-rw-r--r--include/media/saa7146_vv.h2
-rw-r--r--include/media/tuner.h13
-rw-r--r--include/media/tvp5150.h34
-rw-r--r--include/media/v4l2-common.h32
-rw-r--r--include/media/v4l2-dev.h375
-rw-r--r--include/media/video-buf-dvb.h3
-rw-r--r--include/media/video-buf.h1
-rw-r--r--include/sound/tea575x-tuner.h3
96 files changed, 2152 insertions, 1000 deletions
diff --git a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h
index e177d4180f83..21816d35ef89 100644
--- a/include/asm-alpha/floppy.h
+++ b/include/asm-alpha/floppy.h
@@ -25,9 +25,8 @@
25#define fd_enable_irq() enable_irq(FLOPPY_IRQ) 25#define fd_enable_irq() enable_irq(FLOPPY_IRQ)
26#define fd_disable_irq() disable_irq(FLOPPY_IRQ) 26#define fd_disable_irq() disable_irq(FLOPPY_IRQ)
27#define fd_cacheflush(addr,size) /* nothing */ 27#define fd_cacheflush(addr,size) /* nothing */
28#define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt, \ 28#define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt,\
29 SA_INTERRUPT|SA_SAMPLE_RANDOM, \ 29 SA_INTERRUPT, "floppy", NULL)
30 "floppy", NULL)
31#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); 30#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL);
32 31
33#ifdef CONFIG_PCI 32#ifdef CONFIG_PCI
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h
index 6ea657c886b9..aa0c8d28d8d9 100644
--- a/include/asm-arm/floppy.h
+++ b/include/asm-arm/floppy.h
@@ -25,7 +25,7 @@
25 25
26#define fd_inb(port) inb((port)) 26#define fd_inb(port) inb((port))
27#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ 27#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
28 SA_INTERRUPT|SA_SAMPLE_RANDOM,"floppy",NULL) 28 SA_INTERRUPT,"floppy",NULL)
29#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) 29#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL)
30#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) 30#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
31#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) 31#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
diff --git a/include/asm-arm26/floppy.h b/include/asm-arm26/floppy.h
index 9e090ad7e477..a18af069ca28 100644
--- a/include/asm-arm26/floppy.h
+++ b/include/asm-arm26/floppy.h
@@ -22,7 +22,7 @@
22 22
23#define fd_inb(port) inb((port)) 23#define fd_inb(port) inb((port))
24#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ 24#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
25 SA_INTERRUPT|SA_SAMPLE_RANDOM,"floppy",NULL) 25 SA_INTERRUPT,"floppy",NULL)
26#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) 26#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL)
27#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) 27#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
28#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) 28#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 0cd9711895fa..845cb67ad8ea 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -38,4 +38,17 @@
38#endif 38#endif
39#endif 39#endif
40 40
41#define WARN_ON_ONCE(condition) \
42({ \
43 static int __warn_once = 1; \
44 int __ret = 0; \
45 \
46 if (unlikely((condition) && __warn_once)) { \
47 __warn_once = 0; \
48 WARN_ON(1); \
49 __ret = 1; \
50 } \
51 __ret; \
52})
53
41#endif 54#endif
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index c0caf433a7d7..c74521157461 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -14,6 +14,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
14/* var is in discarded region: offset to particular copy we want */ 14/* var is in discarded region: offset to particular copy we want */
15#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) 15#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
16#define __get_cpu_var(var) per_cpu(var, smp_processor_id()) 16#define __get_cpu_var(var) per_cpu(var, smp_processor_id())
17#define __raw_get_cpu_var(var) per_cpu(var, raw_smp_processor_id())
17 18
18/* A macro to avoid #include hell... */ 19/* A macro to avoid #include hell... */
19#define percpu_modcopy(pcpudst, src, size) \ 20#define percpu_modcopy(pcpudst, src, size) \
@@ -30,6 +31,7 @@ do { \
30 31
31#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 32#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
32#define __get_cpu_var(var) per_cpu__##var 33#define __get_cpu_var(var) per_cpu__##var
34#define __raw_get_cpu_var(var) per_cpu__##var
33 35
34#endif /* SMP */ 36#endif /* SMP */
35 37
diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h
index 03403045c182..9cb2793eb211 100644
--- a/include/asm-i386/floppy.h
+++ b/include/asm-i386/floppy.h
@@ -147,9 +147,8 @@ static int fd_request_irq(void)
147 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, 147 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
148 "floppy", NULL); 148 "floppy", NULL);
149 else 149 else
150 return request_irq(FLOPPY_IRQ, floppy_interrupt, 150 return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
151 SA_INTERRUPT|SA_SAMPLE_RANDOM, 151 "floppy", NULL);
152 "floppy", NULL);
153 152
154} 153}
155 154
diff --git a/include/asm-i386/mach-default/setup_arch_pre.h b/include/asm-i386/mach-default/setup_arch.h
index fb42099e7bd4..fb42099e7bd4 100644
--- a/include/asm-i386/mach-default/setup_arch_pre.h
+++ b/include/asm-i386/mach-default/setup_arch.h
diff --git a/include/asm-i386/mach-default/setup_arch_post.h b/include/asm-i386/mach-default/setup_arch_post.h
deleted file mode 100644
index 2fc4888721f6..000000000000
--- a/include/asm-i386/mach-default/setup_arch_post.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/**
2 * machine_specific_memory_setup - Hook for machine specific memory setup.
3 *
4 * Description:
5 * This is included late in kernel/setup.c so that it can make
6 * use of all of the static functions.
7 **/
8
9static char * __init machine_specific_memory_setup(void)
10{
11 char *who;
12
13
14 who = "BIOS-e820";
15
16 /*
17 * Try to copy the BIOS-supplied E820-map.
18 *
19 * Otherwise fake a memory map; one section from 0k->640k,
20 * the next section from 1mb->appropriate_mem_k
21 */
22 sanitize_e820_map(E820_MAP, &E820_MAP_NR);
23 if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
24 unsigned long mem_size;
25
26 /* compare results from other methods and take the greater */
27 if (ALT_MEM_K < EXT_MEM_K) {
28 mem_size = EXT_MEM_K;
29 who = "BIOS-88";
30 } else {
31 mem_size = ALT_MEM_K;
32 who = "BIOS-e801";
33 }
34
35 e820.nr_map = 0;
36 add_memory_region(0, LOWMEMSIZE(), E820_RAM);
37 add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
38 }
39 return who;
40}
diff --git a/include/asm-i386/mach-visws/setup_arch_pre.h b/include/asm-i386/mach-visws/setup_arch.h
index b92d6d9a4d3c..b92d6d9a4d3c 100644
--- a/include/asm-i386/mach-visws/setup_arch_pre.h
+++ b/include/asm-i386/mach-visws/setup_arch.h
diff --git a/include/asm-i386/mach-visws/setup_arch_post.h b/include/asm-i386/mach-visws/setup_arch_post.h
deleted file mode 100644
index cdbd895a54b1..000000000000
--- a/include/asm-i386/mach-visws/setup_arch_post.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/* Hook for machine specific memory setup.
2 *
3 * This is included late in kernel/setup.c so that it can make use of all of
4 * the static functions. */
5
6#define MB (1024 * 1024)
7
8unsigned long sgivwfb_mem_phys;
9unsigned long sgivwfb_mem_size;
10
11long long mem_size __initdata = 0;
12
13static char * __init machine_specific_memory_setup(void)
14{
15 long long gfx_mem_size = 8 * MB;
16
17 mem_size = ALT_MEM_K;
18
19 if (!mem_size) {
20 printk(KERN_WARNING "Bootloader didn't set memory size, upgrade it !\n");
21 mem_size = 128 * MB;
22 }
23
24 /*
25 * this hardcodes the graphics memory to 8 MB
26 * it really should be sized dynamically (or at least
27 * set as a boot param)
28 */
29 if (!sgivwfb_mem_size) {
30 printk(KERN_WARNING "Defaulting to 8 MB framebuffer size\n");
31 sgivwfb_mem_size = 8 * MB;
32 }
33
34 /*
35 * Trim to nearest MB
36 */
37 sgivwfb_mem_size &= ~((1 << 20) - 1);
38 sgivwfb_mem_phys = mem_size - gfx_mem_size;
39
40 add_memory_region(0, LOWMEMSIZE(), E820_RAM);
41 add_memory_region(HIGH_MEMORY, mem_size - sgivwfb_mem_size - HIGH_MEMORY, E820_RAM);
42 add_memory_region(sgivwfb_mem_phys, sgivwfb_mem_size, E820_RESERVED);
43
44 return "PROM";
45
46 /* Remove gcc warnings */
47 (void) sanitize_e820_map(NULL, NULL);
48 (void) copy_e820_map(NULL, 0);
49}
diff --git a/include/asm-i386/mach-voyager/setup_arch_pre.h b/include/asm-i386/mach-voyager/setup_arch.h
index 48f7e6ff49a5..84d01ad33459 100644
--- a/include/asm-i386/mach-voyager/setup_arch_pre.h
+++ b/include/asm-i386/mach-voyager/setup_arch.h
@@ -3,7 +3,7 @@
3 3
4/* Hook to call BIOS initialisation function */ 4/* Hook to call BIOS initialisation function */
5 5
6/* for voyager, pass the voyager BIOS/SUS info area to the detection 6/* for voyager, pass the voyager BIOS/SUS info area to the detection
7 * routines */ 7 * routines */
8 8
9#define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO); 9#define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO);
diff --git a/include/asm-i386/mach-voyager/setup_arch_post.h b/include/asm-i386/mach-voyager/setup_arch_post.h
deleted file mode 100644
index f6f6c2cbc75c..000000000000
--- a/include/asm-i386/mach-voyager/setup_arch_post.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/* Hook for machine specific memory setup.
2 *
3 * This is included late in kernel/setup.c so that it can make use of all of
4 * the static functions. */
5
6static char * __init machine_specific_memory_setup(void)
7{
8 char *who;
9
10 who = "NOT VOYAGER";
11
12 if(voyager_level == 5) {
13 __u32 addr, length;
14 int i;
15
16 who = "Voyager-SUS";
17
18 e820.nr_map = 0;
19 for(i=0; voyager_memory_detect(i, &addr, &length); i++) {
20 add_memory_region(addr, length, E820_RAM);
21 }
22 return who;
23 } else if(voyager_level == 4) {
24 __u32 tom;
25 __u16 catbase = inb(VOYAGER_SSPB_RELOCATION_PORT)<<8;
26 /* select the DINO config space */
27 outb(VOYAGER_DINO, VOYAGER_CAT_CONFIG_PORT);
28 /* Read DINO top of memory register */
29 tom = ((inb(catbase + 0x4) & 0xf0) << 16)
30 + ((inb(catbase + 0x5) & 0x7f) << 24);
31
32 if(inb(catbase) != VOYAGER_DINO) {
33 printk(KERN_ERR "Voyager: Failed to get DINO for L4, setting tom to EXT_MEM_K\n");
34 tom = (EXT_MEM_K)<<10;
35 }
36 who = "Voyager-TOM";
37 add_memory_region(0, 0x9f000, E820_RAM);
38 /* map from 1M to top of memory */
39 add_memory_region(1*1024*1024, tom - 1*1024*1024, E820_RAM);
40 /* FIXME: Should check the ASICs to see if I need to
41 * take out the 8M window. Just do it at the moment
42 * */
43 add_memory_region(8*1024*1024, 8*1024*1024, E820_RESERVED);
44 return who;
45 }
46
47 who = "BIOS-e820";
48
49 /*
50 * Try to copy the BIOS-supplied E820-map.
51 *
52 * Otherwise fake a memory map; one section from 0k->640k,
53 * the next section from 1mb->appropriate_mem_k
54 */
55 sanitize_e820_map(E820_MAP, &E820_MAP_NR);
56 if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
57 unsigned long mem_size;
58
59 /* compare results from other methods and take the greater */
60 if (ALT_MEM_K < EXT_MEM_K) {
61 mem_size = EXT_MEM_K;
62 who = "BIOS-88";
63 } else {
64 mem_size = ALT_MEM_K;
65 who = "BIOS-e801";
66 }
67
68 e820.nr_map = 0;
69 add_memory_region(0, LOWMEMSIZE(), E820_RAM);
70 add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
71 }
72 return who;
73}
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index ee941457b55d..f737e423029e 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -59,6 +59,21 @@ extern unsigned char boot_params[PARAM_SIZE];
59#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF)) 59#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF))
60#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) 60#define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF))
61 61
62/*
63 * Do NOT EVER look at the BIOS memory size location.
64 * It does not work on many machines.
65 */
66#define LOWMEMSIZE() (0x9f000)
67
68struct e820entry;
69
70char * __init machine_specific_memory_setup(void);
71
72int __init copy_e820_map(struct e820entry * biosmap, int nr_map);
73int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map);
74void __init add_memory_region(unsigned long long start,
75 unsigned long long size, int type);
76
62#endif /* __ASSEMBLY__ */ 77#endif /* __ASSEMBLY__ */
63 78
64#endif /* _i386_SETUP_H */ 79#endif /* _i386_SETUP_H */
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index 8462f8e0e658..54d905ebc63d 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -390,8 +390,12 @@ unsigned long __must_check __copy_to_user_ll(void __user *to,
390 const void *from, unsigned long n); 390 const void *from, unsigned long n);
391unsigned long __must_check __copy_from_user_ll(void *to, 391unsigned long __must_check __copy_from_user_ll(void *to,
392 const void __user *from, unsigned long n); 392 const void __user *from, unsigned long n);
393unsigned long __must_check __copy_from_user_ll_nozero(void *to,
394 const void __user *from, unsigned long n);
393unsigned long __must_check __copy_from_user_ll_nocache(void *to, 395unsigned long __must_check __copy_from_user_ll_nocache(void *to,
394 const void __user *from, unsigned long n); 396 const void __user *from, unsigned long n);
397unsigned long __must_check __copy_from_user_ll_nocache_nozero(void *to,
398 const void __user *from, unsigned long n);
395 399
396/* 400/*
397 * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault 401 * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault
@@ -458,10 +462,41 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
458 * 462 *
459 * If some data could not be copied, this function will pad the copied 463 * If some data could not be copied, this function will pad the copied
460 * data to the requested size using zero bytes. 464 * data to the requested size using zero bytes.
465 *
466 * An alternate version - __copy_from_user_inatomic() - may be called from
467 * atomic context and will fail rather than sleep. In this case the
468 * uncopied bytes will *NOT* be padded with zeros. See fs/filemap.h
469 * for explanation of why this is needed.
461 */ 470 */
462static __always_inline unsigned long 471static __always_inline unsigned long
463__copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) 472__copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)
464{ 473{
474 /* Avoid zeroing the tail if the copy fails..
475 * If 'n' is constant and 1, 2, or 4, we do still zero on a failure,
476 * but as the zeroing behaviour is only significant when n is not
477 * constant, that shouldn't be a problem.
478 */
479 if (__builtin_constant_p(n)) {
480 unsigned long ret;
481
482 switch (n) {
483 case 1:
484 __get_user_size(*(u8 *)to, from, 1, ret, 1);
485 return ret;
486 case 2:
487 __get_user_size(*(u16 *)to, from, 2, ret, 2);
488 return ret;
489 case 4:
490 __get_user_size(*(u32 *)to, from, 4, ret, 4);
491 return ret;
492 }
493 }
494 return __copy_from_user_ll_nozero(to, from, n);
495}
496static __always_inline unsigned long
497__copy_from_user(void *to, const void __user *from, unsigned long n)
498{
499 might_sleep();
465 if (__builtin_constant_p(n)) { 500 if (__builtin_constant_p(n)) {
466 unsigned long ret; 501 unsigned long ret;
467 502
@@ -482,9 +517,10 @@ __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)
482 517
483#define ARCH_HAS_NOCACHE_UACCESS 518#define ARCH_HAS_NOCACHE_UACCESS
484 519
485static __always_inline unsigned long __copy_from_user_inatomic_nocache(void *to, 520static __always_inline unsigned long __copy_from_user_nocache(void *to,
486 const void __user *from, unsigned long n) 521 const void __user *from, unsigned long n)
487{ 522{
523 might_sleep();
488 if (__builtin_constant_p(n)) { 524 if (__builtin_constant_p(n)) {
489 unsigned long ret; 525 unsigned long ret;
490 526
@@ -504,17 +540,9 @@ static __always_inline unsigned long __copy_from_user_inatomic_nocache(void *to,
504} 540}
505 541
506static __always_inline unsigned long 542static __always_inline unsigned long
507__copy_from_user(void *to, const void __user *from, unsigned long n) 543__copy_from_user_inatomic_nocache(void *to, const void __user *from, unsigned long n)
508{ 544{
509 might_sleep(); 545 return __copy_from_user_ll_nocache_nozero(to, from, n);
510 return __copy_from_user_inatomic(to, from, n);
511}
512
513static __always_inline unsigned long
514__copy_from_user_nocache(void *to, const void __user *from, unsigned long n)
515{
516 might_sleep();
517 return __copy_from_user_inatomic_nocache(to, from, n);
518} 546}
519 547
520unsigned long __must_check copy_to_user(void __user *to, 548unsigned long __must_check copy_to_user(void __user *to,
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h
index ae357d504fba..24d898b650c5 100644
--- a/include/asm-ia64/percpu.h
+++ b/include/asm-ia64/percpu.h
@@ -42,6 +42,7 @@ DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
42 42
43#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) 43#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
44#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset))) 44#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
45#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
45 46
46extern void percpu_modcopy(void *pcpudst, const void *src, unsigned long size); 47extern void percpu_modcopy(void *pcpudst, const void *src, unsigned long size);
47extern void setup_per_cpu_areas (void); 48extern void setup_per_cpu_areas (void);
@@ -51,6 +52,7 @@ extern void *per_cpu_init(void);
51 52
52#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 53#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
53#define __get_cpu_var(var) per_cpu__##var 54#define __get_cpu_var(var) per_cpu__##var
55#define __raw_get_cpu_var(var) per_cpu__##var
54#define per_cpu_init() (__phys_per_cpu_start) 56#define per_cpu_init() (__phys_per_cpu_start)
55 57
56#endif /* SMP */ 58#endif /* SMP */
diff --git a/include/asm-m68k/amigaints.h b/include/asm-m68k/amigaints.h
index aa968d014bb6..7c8713468fd2 100644
--- a/include/asm-m68k/amigaints.h
+++ b/include/asm-m68k/amigaints.h
@@ -13,6 +13,8 @@
13#ifndef _ASMm68k_AMIGAINTS_H_ 13#ifndef _ASMm68k_AMIGAINTS_H_
14#define _ASMm68k_AMIGAINTS_H_ 14#define _ASMm68k_AMIGAINTS_H_
15 15
16#include <asm/irq.h>
17
16/* 18/*
17** Amiga Interrupt sources. 19** Amiga Interrupt sources.
18** 20**
@@ -23,72 +25,52 @@
23#define CIA_IRQS (5) 25#define CIA_IRQS (5)
24#define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */ 26#define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */
25 27
26/* vertical blanking interrupt */ 28/* builtin serial port interrupts */
27#define IRQ_AMIGA_VERTB 0 29#define IRQ_AMIGA_TBE (IRQ_USER+0)
30#define IRQ_AMIGA_RBF (IRQ_USER+11)
28 31
29/* copper interrupt */ 32/* floppy disk interrupts */
30#define IRQ_AMIGA_COPPER 1 33#define IRQ_AMIGA_DSKBLK (IRQ_USER+1)
34#define IRQ_AMIGA_DSKSYN (IRQ_USER+12)
31 35
32/* Audio interrupts */ 36/* software interrupts */
33#define IRQ_AMIGA_AUD0 2 37#define IRQ_AMIGA_SOFT (IRQ_USER+2)
34#define IRQ_AMIGA_AUD1 3
35#define IRQ_AMIGA_AUD2 4
36#define IRQ_AMIGA_AUD3 5
37 38
38/* Blitter done interrupt */ 39/* interrupts from external hardware */
39#define IRQ_AMIGA_BLIT 6 40#define IRQ_AMIGA_PORTS IRQ_AUTO_2
41#define IRQ_AMIGA_EXTER IRQ_AUTO_6
40 42
41/* floppy disk interrupts */ 43/* copper interrupt */
42#define IRQ_AMIGA_DSKSYN 7 44#define IRQ_AMIGA_COPPER (IRQ_USER+4)
43#define IRQ_AMIGA_DSKBLK 8
44 45
45/* builtin serial port interrupts */ 46/* vertical blanking interrupt */
46#define IRQ_AMIGA_RBF 9 47#define IRQ_AMIGA_VERTB (IRQ_USER+5)
47#define IRQ_AMIGA_TBE 10
48 48
49/* software interrupts */ 49/* Blitter done interrupt */
50#define IRQ_AMIGA_SOFT 11 50#define IRQ_AMIGA_BLIT (IRQ_USER+6)
51 51
52/* interrupts from external hardware */ 52/* Audio interrupts */
53#define IRQ_AMIGA_PORTS 12 53#define IRQ_AMIGA_AUD0 (IRQ_USER+7)
54#define IRQ_AMIGA_EXTER 13 54#define IRQ_AMIGA_AUD1 (IRQ_USER+8)
55#define IRQ_AMIGA_AUD2 (IRQ_USER+9)
56#define IRQ_AMIGA_AUD3 (IRQ_USER+10)
55 57
56/* CIA interrupt sources */ 58/* CIA interrupt sources */
57#define IRQ_AMIGA_CIAA 14 59#define IRQ_AMIGA_CIAA (IRQ_USER+14)
58#define IRQ_AMIGA_CIAA_TA 14 60#define IRQ_AMIGA_CIAA_TA (IRQ_USER+14)
59#define IRQ_AMIGA_CIAA_TB 15 61#define IRQ_AMIGA_CIAA_TB (IRQ_USER+15)
60#define IRQ_AMIGA_CIAA_ALRM 16 62#define IRQ_AMIGA_CIAA_ALRM (IRQ_USER+16)
61#define IRQ_AMIGA_CIAA_SP 17 63#define IRQ_AMIGA_CIAA_SP (IRQ_USER+17)
62#define IRQ_AMIGA_CIAA_FLG 18 64#define IRQ_AMIGA_CIAA_FLG (IRQ_USER+18)
63#define IRQ_AMIGA_CIAB 19 65#define IRQ_AMIGA_CIAB (IRQ_USER+19)
64#define IRQ_AMIGA_CIAB_TA 19 66#define IRQ_AMIGA_CIAB_TA (IRQ_USER+19)
65#define IRQ_AMIGA_CIAB_TB 20 67#define IRQ_AMIGA_CIAB_TB (IRQ_USER+20)
66#define IRQ_AMIGA_CIAB_ALRM 21 68#define IRQ_AMIGA_CIAB_ALRM (IRQ_USER+21)
67#define IRQ_AMIGA_CIAB_SP 22 69#define IRQ_AMIGA_CIAB_SP (IRQ_USER+22)
68#define IRQ_AMIGA_CIAB_FLG 23 70#define IRQ_AMIGA_CIAB_FLG (IRQ_USER+23)
69
70/* auto-vector interrupts */
71#define IRQ_AMIGA_AUTO 24
72#define IRQ_AMIGA_AUTO_0 24 /* This is just a dummy */
73#define IRQ_AMIGA_AUTO_1 25
74#define IRQ_AMIGA_AUTO_2 26
75#define IRQ_AMIGA_AUTO_3 27
76#define IRQ_AMIGA_AUTO_4 28
77#define IRQ_AMIGA_AUTO_5 29
78#define IRQ_AMIGA_AUTO_6 30
79#define IRQ_AMIGA_AUTO_7 31
80
81#define IRQ_FLOPPY IRQ_AMIGA_DSKBLK
82 71
83/* INTREQR masks */
84#define IRQ1_MASK 0x0007 /* INTREQR mask for IRQ 1 */
85#define IRQ2_MASK 0x0008 /* INTREQR mask for IRQ 2 */
86#define IRQ3_MASK 0x0070 /* INTREQR mask for IRQ 3 */
87#define IRQ4_MASK 0x0780 /* INTREQR mask for IRQ 4 */
88#define IRQ5_MASK 0x1800 /* INTREQR mask for IRQ 5 */
89#define IRQ6_MASK 0x2000 /* INTREQR mask for IRQ 6 */
90#define IRQ7_MASK 0x4000 /* INTREQR mask for IRQ 7 */
91 72
73/* INTREQR masks */
92#define IF_SETCLR 0x8000 /* set/clr bit */ 74#define IF_SETCLR 0x8000 /* set/clr bit */
93#define IF_INTEN 0x4000 /* master interrupt bit in INT* registers */ 75#define IF_INTEN 0x4000 /* master interrupt bit in INT* registers */
94#define IF_EXTER 0x2000 /* external level 6 and CIA B interrupt */ 76#define IF_EXTER 0x2000 /* external level 6 and CIA B interrupt */
@@ -106,9 +88,6 @@
106#define IF_DSKBLK 0x0002 /* diskblock DMA finished */ 88#define IF_DSKBLK 0x0002 /* diskblock DMA finished */
107#define IF_TBE 0x0001 /* serial transmit buffer empty interrupt */ 89#define IF_TBE 0x0001 /* serial transmit buffer empty interrupt */
108 90
109extern void amiga_do_irq(int irq, struct pt_regs *fp);
110extern void amiga_do_irq_list(int irq, struct pt_regs *fp);
111
112/* CIA interrupt control register bits */ 91/* CIA interrupt control register bits */
113 92
114#define CIA_ICR_TA 0x01 93#define CIA_ICR_TA 0x01
@@ -125,6 +104,7 @@ extern void amiga_do_irq_list(int irq, struct pt_regs *fp);
125 104
126extern struct ciabase ciaa_base, ciab_base; 105extern struct ciabase ciaa_base, ciab_base;
127 106
107extern void cia_init_IRQ(struct ciabase *base);
128extern unsigned char cia_set_irq(struct ciabase *base, unsigned char mask); 108extern unsigned char cia_set_irq(struct ciabase *base, unsigned char mask);
129extern unsigned char cia_able_irq(struct ciabase *base, unsigned char mask); 109extern unsigned char cia_able_irq(struct ciabase *base, unsigned char mask);
130 110
diff --git a/include/asm-m68k/apollohw.h b/include/asm-m68k/apollohw.h
index 4304e1c33e17..a1373b9aa281 100644
--- a/include/asm-m68k/apollohw.h
+++ b/include/asm-m68k/apollohw.h
@@ -3,6 +3,8 @@
3#ifndef _ASMm68k_APOLLOHW_H_ 3#ifndef _ASMm68k_APOLLOHW_H_
4#define _ASMm68k_APOLLOHW_H_ 4#define _ASMm68k_APOLLOHW_H_
5 5
6#include <linux/types.h>
7
6/* 8/*
7 apollo models 9 apollo models
8*/ 10*/
@@ -101,4 +103,6 @@ extern u_long timer_physaddr;
101 103
102#define isaIO2mem(x) (((((x) & 0x3f8) << 7) | (((x) & 0xfc00) >> 6) | ((x) & 0x7)) + 0x40000 + IO_BASE) 104#define isaIO2mem(x) (((((x) & 0x3f8) << 7) | (((x) & 0xfc00) >> 6) | ((x) & 0x7)) + 0x40000 + IO_BASE)
103 105
106#define IRQ_APOLLO IRQ_USER
107
104#endif 108#endif
diff --git a/include/asm-m68k/atari_stdma.h b/include/asm-m68k/atari_stdma.h
index 64f92880ce43..b4eadf852738 100644
--- a/include/asm-m68k/atari_stdma.h
+++ b/include/asm-m68k/atari_stdma.h
@@ -3,7 +3,7 @@
3#define _atari_stdma_h 3#define _atari_stdma_h
4 4
5 5
6#include <asm/irq.h> 6#include <linux/interrupt.h>
7 7
8 8
9/***************************** Prototypes *****************************/ 9/***************************** Prototypes *****************************/
diff --git a/include/asm-m68k/atariints.h b/include/asm-m68k/atariints.h
index 42952c890593..0ed454fc24bb 100644
--- a/include/asm-m68k/atariints.h
+++ b/include/asm-m68k/atariints.h
@@ -45,17 +45,6 @@
45#define IRQ_TYPE_FAST 1 45#define IRQ_TYPE_FAST 1
46#define IRQ_TYPE_PRIO 2 46#define IRQ_TYPE_PRIO 2
47 47
48#define IRQ_SPURIOUS (0)
49
50/* auto-vector interrupts */
51#define IRQ_AUTO_1 (1)
52#define IRQ_AUTO_2 (2)
53#define IRQ_AUTO_3 (3)
54#define IRQ_AUTO_4 (4)
55#define IRQ_AUTO_5 (5)
56#define IRQ_AUTO_6 (6)
57#define IRQ_AUTO_7 (7)
58
59/* ST-MFP interrupts */ 48/* ST-MFP interrupts */
60#define IRQ_MFP_BUSY (8) 49#define IRQ_MFP_BUSY (8)
61#define IRQ_MFP_DCD (9) 50#define IRQ_MFP_DCD (9)
diff --git a/include/asm-m68k/bvme6000hw.h b/include/asm-m68k/bvme6000hw.h
index 28a859b03959..f40d2f8510ee 100644
--- a/include/asm-m68k/bvme6000hw.h
+++ b/include/asm-m68k/bvme6000hw.h
@@ -109,23 +109,23 @@ typedef struct {
109 109
110#define BVME_IRQ_TYPE_PRIO 0 110#define BVME_IRQ_TYPE_PRIO 0
111 111
112#define BVME_IRQ_PRN 0x54 112#define BVME_IRQ_PRN (IRQ_USER+20)
113#define BVME_IRQ_I596 0x1a 113#define BVME_IRQ_TIMER (IRQ_USER+25)
114#define BVME_IRQ_SCSI 0x1b 114#define BVME_IRQ_I596 IRQ_AUTO_2
115#define BVME_IRQ_TIMER 0x59 115#define BVME_IRQ_SCSI IRQ_AUTO_3
116#define BVME_IRQ_RTC 0x1e 116#define BVME_IRQ_RTC IRQ_AUTO_6
117#define BVME_IRQ_ABORT 0x1f 117#define BVME_IRQ_ABORT IRQ_AUTO_7
118 118
119/* SCC interrupts */ 119/* SCC interrupts */
120#define BVME_IRQ_SCC_BASE 0x40 120#define BVME_IRQ_SCC_BASE IRQ_USER
121#define BVME_IRQ_SCCB_TX 0x40 121#define BVME_IRQ_SCCB_TX IRQ_USER
122#define BVME_IRQ_SCCB_STAT 0x42 122#define BVME_IRQ_SCCB_STAT (IRQ_USER+2)
123#define BVME_IRQ_SCCB_RX 0x44 123#define BVME_IRQ_SCCB_RX (IRQ_USER+4)
124#define BVME_IRQ_SCCB_SPCOND 0x46 124#define BVME_IRQ_SCCB_SPCOND (IRQ_USER+6)
125#define BVME_IRQ_SCCA_TX 0x48 125#define BVME_IRQ_SCCA_TX (IRQ_USER+8)
126#define BVME_IRQ_SCCA_STAT 0x4a 126#define BVME_IRQ_SCCA_STAT (IRQ_USER+10)
127#define BVME_IRQ_SCCA_RX 0x4c 127#define BVME_IRQ_SCCA_RX (IRQ_USER+12)
128#define BVME_IRQ_SCCA_SPCOND 0x4e 128#define BVME_IRQ_SCCA_SPCOND (IRQ_USER+14)
129 129
130/* Address control registers */ 130/* Address control registers */
131 131
diff --git a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h
index 8aba971b1368..24d3ff449135 100644
--- a/include/asm-m68k/cacheflush.h
+++ b/include/asm-m68k/cacheflush.h
@@ -3,26 +3,30 @@
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5 5
6/* cache code */
7#define FLUSH_I_AND_D (0x00000808)
8#define FLUSH_I (0x00000008)
9
6/* 10/*
7 * Cache handling functions 11 * Cache handling functions
8 */ 12 */
9 13
10#define flush_icache() \ 14static inline void flush_icache(void)
11({ \ 15{
12 if (CPU_IS_040_OR_060) \ 16 if (CPU_IS_040_OR_060)
13 __asm__ __volatile__("nop\n\t" \ 17 asm volatile ( "nop\n"
14 ".chip 68040\n\t" \ 18 " .chip 68040\n"
15 "cinva %%ic\n\t" \ 19 " cpusha %bc\n"
16 ".chip 68k" : ); \ 20 " .chip 68k");
17 else { \ 21 else {
18 unsigned long _tmp; \ 22 unsigned long tmp;
19 __asm__ __volatile__("movec %%cacr,%0\n\t" \ 23 asm volatile ( "movec %%cacr,%0\n"
20 "orw %1,%0\n\t" \ 24 " or.w %1,%0\n"
21 "movec %0,%%cacr" \ 25 " movec %0,%%cacr"
22 : "=&d" (_tmp) \ 26 : "=&d" (tmp)
23 : "id" (FLUSH_I)); \ 27 : "id" (FLUSH_I));
24 } \ 28 }
25}) 29}
26 30
27/* 31/*
28 * invalidate the cache for the specified memory range. 32 * invalidate the cache for the specified memory range.
@@ -43,10 +47,6 @@ extern void cache_push(unsigned long paddr, int len);
43 */ 47 */
44extern void cache_push_v(unsigned long vaddr, int len); 48extern void cache_push_v(unsigned long vaddr, int len);
45 49
46/* cache code */
47#define FLUSH_I_AND_D (0x00000808)
48#define FLUSH_I (0x00000008)
49
50/* This is needed whenever the virtual mapping of the current 50/* This is needed whenever the virtual mapping of the current
51 process changes. */ 51 process changes. */
52#define __flush_cache_all() \ 52#define __flush_cache_all() \
diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h
index dffd59cf1364..cebbb03370ec 100644
--- a/include/asm-m68k/dma-mapping.h
+++ b/include/asm-m68k/dma-mapping.h
@@ -1,11 +1,91 @@
1#ifndef _M68K_DMA_MAPPING_H 1#ifndef _M68K_DMA_MAPPING_H
2#define _M68K_DMA_MAPPING_H 2#define _M68K_DMA_MAPPING_H
3 3
4#include <asm/cache.h>
4 5
5#ifdef CONFIG_PCI 6struct scatterlist;
6#include <asm-generic/dma-mapping.h> 7
7#else 8static inline int dma_supported(struct device *dev, u64 mask)
8#include <asm-generic/dma-mapping-broken.h> 9{
9#endif 10 return 1;
11}
12
13static inline int dma_set_mask(struct device *dev, u64 mask)
14{
15 return 0;
16}
17
18static inline int dma_get_cache_alignment(void)
19{
20 return 1 << L1_CACHE_SHIFT;
21}
22
23static inline int dma_is_consistent(dma_addr_t dma_addr)
24{
25 return 0;
26}
27
28extern void *dma_alloc_coherent(struct device *, size_t,
29 dma_addr_t *, int);
30extern void dma_free_coherent(struct device *, size_t,
31 void *, dma_addr_t);
32
33static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
34 dma_addr_t *handle, int flag)
35{
36 return dma_alloc_coherent(dev, size, handle, flag);
37}
38static inline void dma_free_noncoherent(struct device *dev, size_t size,
39 void *addr, dma_addr_t handle)
40{
41 dma_free_coherent(dev, size, addr, handle);
42}
43static inline void dma_cache_sync(void *vaddr, size_t size,
44 enum dma_data_direction dir)
45{
46 /* we use coherent allocation, so not much to do here. */
47}
48
49extern dma_addr_t dma_map_single(struct device *, void *, size_t,
50 enum dma_data_direction);
51static inline void dma_unmap_single(struct device *dev, dma_addr_t addr,
52 size_t size, enum dma_data_direction dir)
53{
54}
55
56extern dma_addr_t dma_map_page(struct device *, struct page *,
57 unsigned long, size_t size,
58 enum dma_data_direction);
59static inline void dma_unmap_page(struct device *dev, dma_addr_t address,
60 size_t size, enum dma_data_direction dir)
61{
62}
63
64extern int dma_map_sg(struct device *, struct scatterlist *, int,
65 enum dma_data_direction);
66static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
67 int nhwentries, enum dma_data_direction dir)
68{
69}
70
71extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t,
72 enum dma_data_direction);
73extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
74 enum dma_data_direction);
75
76static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
77 size_t size, enum dma_data_direction dir)
78{
79}
80
81static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
82 int nents, enum dma_data_direction dir)
83{
84}
85
86static inline int dma_mapping_error(dma_addr_t handle)
87{
88 return 0;
89}
10 90
11#endif /* _M68K_DMA_MAPPING_H */ 91#endif /* _M68K_DMA_MAPPING_H */
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h
index 9727ca9d9f26..f4ae7d8feac6 100644
--- a/include/asm-m68k/irq.h
+++ b/include/asm-m68k/irq.h
@@ -1,13 +1,9 @@
1#ifndef _M68K_IRQ_H_ 1#ifndef _M68K_IRQ_H_
2#define _M68K_IRQ_H_ 2#define _M68K_IRQ_H_
3 3
4#include <linux/interrupt.h> 4#include <linux/linkage.h>
5 5#include <linux/hardirq.h>
6/* 6#include <linux/spinlock_types.h>
7 * # of m68k interrupts
8 */
9
10#define SYS_IRQS 8
11 7
12/* 8/*
13 * This should be the same as the max(NUM_X_SOURCES) for all the 9 * This should be the same as the max(NUM_X_SOURCES) for all the
@@ -15,10 +11,20 @@
15 * Currently the Atari has 72 and the Amiga 24, but if both are 11 * Currently the Atari has 72 and the Amiga 24, but if both are
16 * supported in the kernel it is better to make room for 72. 12 * supported in the kernel it is better to make room for 72.
17 */ 13 */
18#if defined(CONFIG_ATARI) || defined(CONFIG_MAC) 14#if defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
19#define NR_IRQS (72+SYS_IRQS) 15#define NR_IRQS 200
16#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC)
17#define NR_IRQS 72
18#elif defined(CONFIG_Q40)
19#define NR_IRQS 43
20#elif defined(CONFIG_AMIGA)
21#define NR_IRQS 32
22#elif defined(CONFIG_APOLLO)
23#define NR_IRQS 24
24#elif defined(CONFIG_HP300)
25#define NR_IRQS 8
20#else 26#else
21#define NR_IRQS (24+SYS_IRQS) 27#error unknown nr of irqs
22#endif 28#endif
23 29
24/* 30/*
@@ -40,53 +46,25 @@
40 * that routine requires service. 46 * that routine requires service.
41 */ 47 */
42 48
43#define IRQ1 (1) /* level 1 interrupt */ 49#define IRQ_SPURIOUS 0
44#define IRQ2 (2) /* level 2 interrupt */
45#define IRQ3 (3) /* level 3 interrupt */
46#define IRQ4 (4) /* level 4 interrupt */
47#define IRQ5 (5) /* level 5 interrupt */
48#define IRQ6 (6) /* level 6 interrupt */
49#define IRQ7 (7) /* level 7 interrupt (non-maskable) */
50 50
51/* 51#define IRQ_AUTO_1 1 /* level 1 interrupt */
52 * "Generic" interrupt sources 52#define IRQ_AUTO_2 2 /* level 2 interrupt */
53 */ 53#define IRQ_AUTO_3 3 /* level 3 interrupt */
54 54#define IRQ_AUTO_4 4 /* level 4 interrupt */
55#define IRQ_SCHED_TIMER (8) /* interrupt source for scheduling timer */ 55#define IRQ_AUTO_5 5 /* level 5 interrupt */
56#define IRQ_AUTO_6 6 /* level 6 interrupt */
57#define IRQ_AUTO_7 7 /* level 7 interrupt (non-maskable) */
56 58
57static __inline__ int irq_canonicalize(int irq) 59#define IRQ_USER 8
58{
59 return irq;
60}
61
62/*
63 * Machine specific interrupt sources.
64 *
65 * Adding an interrupt service routine for a source with this bit
66 * set indicates a special machine specific interrupt source.
67 * The machine specific files define these sources.
68 *
69 * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
70 * introduce unnecessary overhead.
71 *
72 * All interrupt handling is actually machine specific so it is better
73 * to use function pointers, as used by the Sparc port, and select the
74 * interrupt handling functions when initializing the kernel. This way
75 * we save some unnecessary overhead at run-time.
76 * 01/11/97 - Jes
77 */
78 60
79extern void (*enable_irq)(unsigned int); 61extern unsigned int irq_canonicalize(unsigned int irq);
80extern void (*disable_irq)(unsigned int); 62extern void enable_irq(unsigned int);
63extern void disable_irq(unsigned int);
81#define disable_irq_nosync disable_irq 64#define disable_irq_nosync disable_irq
82 65
83struct pt_regs; 66struct pt_regs;
84 67
85extern int cpu_request_irq(unsigned int,
86 irqreturn_t (*)(int, void *, struct pt_regs *),
87 unsigned long, const char *, void *);
88extern void cpu_free_irq(unsigned int, void *);
89
90/* 68/*
91 * various flags for request_irq() - the Amiga now uses the standard 69 * various flags for request_irq() - the Amiga now uses the standard
92 * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ 70 * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
@@ -105,29 +83,45 @@ extern void cpu_free_irq(unsigned int, void *);
105 * interrupt source (if it supports chaining). 83 * interrupt source (if it supports chaining).
106 */ 84 */
107typedef struct irq_node { 85typedef struct irq_node {
108 irqreturn_t (*handler)(int, void *, struct pt_regs *); 86 int (*handler)(int, void *, struct pt_regs *);
109 unsigned long flags;
110 void *dev_id; 87 void *dev_id;
111 const char *devname;
112 struct irq_node *next; 88 struct irq_node *next;
89 unsigned long flags;
90 const char *devname;
113} irq_node_t; 91} irq_node_t;
114 92
115/* 93/*
116 * This structure has only 4 elements for speed reasons 94 * This structure has only 4 elements for speed reasons
117 */ 95 */
118typedef struct irq_handler { 96typedef struct irq_handler {
119 irqreturn_t (*handler)(int, void *, struct pt_regs *); 97 int (*handler)(int, void *, struct pt_regs *);
120 unsigned long flags; 98 unsigned long flags;
121 void *dev_id; 99 void *dev_id;
122 const char *devname; 100 const char *devname;
123} irq_handler_t; 101} irq_handler_t;
124 102
125/* count of spurious interrupts */ 103struct irq_controller {
126extern volatile unsigned int num_spurious; 104 const char *name;
105 spinlock_t lock;
106 int (*startup)(unsigned int irq);
107 void (*shutdown)(unsigned int irq);
108 void (*enable)(unsigned int irq);
109 void (*disable)(unsigned int irq);
110};
111
112extern int m68k_irq_startup(unsigned int);
113extern void m68k_irq_shutdown(unsigned int);
127 114
128/* 115/*
129 * This function returns a new irq_node_t 116 * This function returns a new irq_node_t
130 */ 117 */
131extern irq_node_t *new_irq_node(void); 118extern irq_node_t *new_irq_node(void);
132 119
120extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *));
121extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt,
122 void (*handler)(unsigned int, struct pt_regs *));
123extern void m68k_setup_irq_controller(struct irq_controller *, unsigned int, unsigned int);
124
125asmlinkage void m68k_handle_int(unsigned int, struct pt_regs *);
126
133#endif /* _M68K_IRQ_H_ */ 127#endif /* _M68K_IRQ_H_ */
diff --git a/include/asm-m68k/mac_oss.h b/include/asm-m68k/mac_oss.h
index 7644a639cd6c..7221f7251934 100644
--- a/include/asm-m68k/mac_oss.h
+++ b/include/asm-m68k/mac_oss.h
@@ -69,12 +69,12 @@
69 69
70#define OSS_IRQLEV_DISABLED 0 70#define OSS_IRQLEV_DISABLED 0
71#define OSS_IRQLEV_IOPISM 1 /* ADB? */ 71#define OSS_IRQLEV_IOPISM 1 /* ADB? */
72#define OSS_IRQLEV_SCSI 2 72#define OSS_IRQLEV_SCSI IRQ_AUTO_2
73#define OSS_IRQLEV_NUBUS 3 /* keep this on its own level */ 73#define OSS_IRQLEV_NUBUS IRQ_AUTO_3 /* keep this on its own level */
74#define OSS_IRQLEV_IOPSCC 4 /* matches VIA alternate mapping */ 74#define OSS_IRQLEV_IOPSCC IRQ_AUTO_4 /* matches VIA alternate mapping */
75#define OSS_IRQLEV_SOUND 5 /* matches VIA alternate mapping */ 75#define OSS_IRQLEV_SOUND IRQ_AUTO_5 /* matches VIA alternate mapping */
76#define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */ 76#define OSS_IRQLEV_60HZ 6 /* matches VIA alternate mapping */
77#define OSS_IRQLEV_VIA1 6 /* matches VIA alternate mapping */ 77#define OSS_IRQLEV_VIA1 IRQ_AUTO_6 /* matches VIA alternate mapping */
78#define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */ 78#define OSS_IRQLEV_PARITY 7 /* matches VIA alternate mapping */
79 79
80#ifndef __ASSEMBLY__ 80#ifndef __ASSEMBLY__
diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h
index 7d3fee342369..df898f27e434 100644
--- a/include/asm-m68k/machdep.h
+++ b/include/asm-m68k/machdep.h
@@ -13,14 +13,8 @@ struct buffer_head;
13extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)); 13extern void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *));
14/* machine dependent irq functions */ 14/* machine dependent irq functions */
15extern void (*mach_init_IRQ) (void); 15extern void (*mach_init_IRQ) (void);
16extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
17extern int (*mach_request_irq) (unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *),
18 unsigned long flags, const char *devname, void *dev_id);
19extern void (*mach_free_irq) (unsigned int irq, void *dev_id);
20extern void (*mach_get_model) (char *model); 16extern void (*mach_get_model) (char *model);
21extern int (*mach_get_hardware_list) (char *buffer); 17extern int (*mach_get_hardware_list) (char *buffer);
22extern int (*mach_get_irq_list) (struct seq_file *p, void *v);
23extern irqreturn_t (*mach_process_int) (int irq, struct pt_regs *fp);
24/* machine dependent timer functions */ 18/* machine dependent timer functions */
25extern unsigned long (*mach_gettimeoffset)(void); 19extern unsigned long (*mach_gettimeoffset)(void);
26extern int (*mach_hwclk)(int, struct rtc_time*); 20extern int (*mach_hwclk)(int, struct rtc_time*);
diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h
index 6fc3d19512d1..27d11da2b479 100644
--- a/include/asm-m68k/macintosh.h
+++ b/include/asm-m68k/macintosh.h
@@ -11,17 +11,7 @@
11extern void mac_reset(void); 11extern void mac_reset(void);
12extern void mac_poweroff(void); 12extern void mac_poweroff(void);
13extern void mac_init_IRQ(void); 13extern void mac_init_IRQ(void);
14extern int mac_request_irq (unsigned int, irqreturn_t (*)(int, void *,
15 struct pt_regs *),
16 unsigned long, const char *, void *);
17extern void mac_free_irq(unsigned int, void *);
18extern void mac_enable_irq(unsigned int);
19extern void mac_disable_irq(unsigned int);
20extern int mac_irq_pending(unsigned int); 14extern int mac_irq_pending(unsigned int);
21extern int show_mac_interrupts(struct seq_file *, void *);
22#if 0
23extern void mac_default_handler(int irq);
24#endif
25extern void mac_identify(void); 15extern void mac_identify(void);
26extern void mac_report_hardware(void); 16extern void mac_report_hardware(void);
27extern void mac_debugging_penguin(int); 17extern void mac_debugging_penguin(int);
diff --git a/include/asm-m68k/macints.h b/include/asm-m68k/macints.h
index fd8c3a9fea4d..679c48ab4407 100644
--- a/include/asm-m68k/macints.h
+++ b/include/asm-m68k/macints.h
@@ -59,17 +59,6 @@
59#define IRQ_SRC(irq) (irq >> 3) 59#define IRQ_SRC(irq) (irq >> 3)
60#define IRQ_IDX(irq) (irq & 7) 60#define IRQ_IDX(irq) (irq & 7)
61 61
62#define IRQ_SPURIOUS (0)
63
64/* auto-vector interrupts */
65#define IRQ_AUTO_1 (1)
66#define IRQ_AUTO_2 (2)
67#define IRQ_AUTO_3 (3)
68#define IRQ_AUTO_4 (4)
69#define IRQ_AUTO_5 (5)
70#define IRQ_AUTO_6 (6)
71#define IRQ_AUTO_7 (7)
72
73/* VIA1 interrupts */ 62/* VIA1 interrupts */
74#define IRQ_VIA1_0 (8) /* one second int. */ 63#define IRQ_VIA1_0 (8) /* one second int. */
75#define IRQ_VIA1_1 (9) /* VBlank int. */ 64#define IRQ_VIA1_1 (9) /* VBlank int. */
@@ -163,7 +152,4 @@
163#define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */ 152#define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */
164#define INT_TICKS 246 /* to make sched_time = 99.902... HZ */ 153#define INT_TICKS 246 /* to make sched_time = 99.902... HZ */
165 154
166extern irq_node_t *mac_irq_list[NUM_MAC_SOURCES];
167extern void mac_do_irq_list(int irq, struct pt_regs *);
168
169#endif /* asm/macints.h */ 155#endif /* asm/macints.h */
diff --git a/include/asm-m68k/mvme147hw.h b/include/asm-m68k/mvme147hw.h
index f245139f3671..b81043108472 100644
--- a/include/asm-m68k/mvme147hw.h
+++ b/include/asm-m68k/mvme147hw.h
@@ -1,6 +1,8 @@
1#ifndef _MVME147HW_H_ 1#ifndef _MVME147HW_H_
2#define _MVME147HW_H_ 2#define _MVME147HW_H_
3 3
4#include <asm/irq.h>
5
4typedef struct { 6typedef struct {
5 unsigned char 7 unsigned char
6 ctrl, 8 ctrl,
@@ -72,39 +74,39 @@ struct pcc_regs {
72#define PCC_LEVEL_SCSI_PORT 0x04 74#define PCC_LEVEL_SCSI_PORT 0x04
73#define PCC_LEVEL_SCSI_DMA 0x04 75#define PCC_LEVEL_SCSI_DMA 0x04
74 76
75#define PCC_IRQ_AC_FAIL 0x40 77#define PCC_IRQ_AC_FAIL (IRQ_USER+0)
76#define PCC_IRQ_BERR 0x41 78#define PCC_IRQ_BERR (IRQ_USER+1)
77#define PCC_IRQ_ABORT 0x42 79#define PCC_IRQ_ABORT (IRQ_USER+2)
78/* #define PCC_IRQ_SERIAL 0x43 */ 80/* #define PCC_IRQ_SERIAL (IRQ_USER+3) */
79#define PCC_IRQ_PRINTER 0x47 81#define PCC_IRQ_PRINTER (IRQ_USER+7)
80#define PCC_IRQ_TIMER1 0x48 82#define PCC_IRQ_TIMER1 (IRQ_USER+8)
81#define PCC_IRQ_TIMER2 0x49 83#define PCC_IRQ_TIMER2 (IRQ_USER+9)
82#define PCC_IRQ_SOFTWARE1 0x4a 84#define PCC_IRQ_SOFTWARE1 (IRQ_USER+10)
83#define PCC_IRQ_SOFTWARE2 0x4b 85#define PCC_IRQ_SOFTWARE2 (IRQ_USER+11)
84 86
85 87
86#define M147_SCC_A_ADDR 0xfffe3002 88#define M147_SCC_A_ADDR 0xfffe3002
87#define M147_SCC_B_ADDR 0xfffe3000 89#define M147_SCC_B_ADDR 0xfffe3000
88#define M147_SCC_PCLK 5000000 90#define M147_SCC_PCLK 5000000
89 91
90#define MVME147_IRQ_SCSI_PORT 0x45 92#define MVME147_IRQ_SCSI_PORT (IRQ_USER+0x45)
91#define MVME147_IRQ_SCSI_DMA 0x46 93#define MVME147_IRQ_SCSI_DMA (IRQ_USER+0x46)
92 94
93/* SCC interrupts, for MVME147 */ 95/* SCC interrupts, for MVME147 */
94 96
95#define MVME147_IRQ_TYPE_PRIO 0 97#define MVME147_IRQ_TYPE_PRIO 0
96#define MVME147_IRQ_SCC_BASE 0x60 98#define MVME147_IRQ_SCC_BASE (IRQ_USER+32)
97#define MVME147_IRQ_SCCB_TX 0x60 99#define MVME147_IRQ_SCCB_TX (IRQ_USER+32)
98#define MVME147_IRQ_SCCB_STAT 0x62 100#define MVME147_IRQ_SCCB_STAT (IRQ_USER+34)
99#define MVME147_IRQ_SCCB_RX 0x64 101#define MVME147_IRQ_SCCB_RX (IRQ_USER+36)
100#define MVME147_IRQ_SCCB_SPCOND 0x66 102#define MVME147_IRQ_SCCB_SPCOND (IRQ_USER+38)
101#define MVME147_IRQ_SCCA_TX 0x68 103#define MVME147_IRQ_SCCA_TX (IRQ_USER+40)
102#define MVME147_IRQ_SCCA_STAT 0x6a 104#define MVME147_IRQ_SCCA_STAT (IRQ_USER+42)
103#define MVME147_IRQ_SCCA_RX 0x6c 105#define MVME147_IRQ_SCCA_RX (IRQ_USER+44)
104#define MVME147_IRQ_SCCA_SPCOND 0x6e 106#define MVME147_IRQ_SCCA_SPCOND (IRQ_USER+46)
105 107
106#define MVME147_LANCE_BASE 0xfffe1800 108#define MVME147_LANCE_BASE 0xfffe1800
107#define MVME147_LANCE_IRQ 0x44 109#define MVME147_LANCE_IRQ (IRQ_USER+4)
108 110
109#define ETHERNET_ADDRESS 0xfffe0778 111#define ETHERNET_ADDRESS 0xfffe0778
110 112
diff --git a/include/asm-m68k/mvme16xhw.h b/include/asm-m68k/mvme16xhw.h
index 5d07231d2426..6117f56653d2 100644
--- a/include/asm-m68k/mvme16xhw.h
+++ b/include/asm-m68k/mvme16xhw.h
@@ -66,28 +66,28 @@ typedef struct {
66 66
67#define MVME162_IRQ_TYPE_PRIO 0 67#define MVME162_IRQ_TYPE_PRIO 0
68 68
69#define MVME167_IRQ_PRN 0x54 69#define MVME167_IRQ_PRN (IRQ_USER+20)
70#define MVME16x_IRQ_I596 0x57 70#define MVME16x_IRQ_I596 (IRQ_USER+23)
71#define MVME16x_IRQ_SCSI 0x55 71#define MVME16x_IRQ_SCSI (IRQ_USER+21)
72#define MVME16x_IRQ_FLY 0x7f 72#define MVME16x_IRQ_FLY (IRQ_USER+63)
73#define MVME167_IRQ_SER_ERR 0x5c 73#define MVME167_IRQ_SER_ERR (IRQ_USER+28)
74#define MVME167_IRQ_SER_MODEM 0x5d 74#define MVME167_IRQ_SER_MODEM (IRQ_USER+29)
75#define MVME167_IRQ_SER_TX 0x5e 75#define MVME167_IRQ_SER_TX (IRQ_USER+30)
76#define MVME167_IRQ_SER_RX 0x5f 76#define MVME167_IRQ_SER_RX (IRQ_USER+31)
77#define MVME16x_IRQ_TIMER 0x59 77#define MVME16x_IRQ_TIMER (IRQ_USER+25)
78#define MVME167_IRQ_ABORT 0x6e 78#define MVME167_IRQ_ABORT (IRQ_USER+46)
79#define MVME162_IRQ_ABORT 0x5e 79#define MVME162_IRQ_ABORT (IRQ_USER+30)
80 80
81/* SCC interrupts, for MVME162 */ 81/* SCC interrupts, for MVME162 */
82#define MVME162_IRQ_SCC_BASE 0x40 82#define MVME162_IRQ_SCC_BASE (IRQ_USER+0)
83#define MVME162_IRQ_SCCB_TX 0x40 83#define MVME162_IRQ_SCCB_TX (IRQ_USER+0)
84#define MVME162_IRQ_SCCB_STAT 0x42 84#define MVME162_IRQ_SCCB_STAT (IRQ_USER+2)
85#define MVME162_IRQ_SCCB_RX 0x44 85#define MVME162_IRQ_SCCB_RX (IRQ_USER+4)
86#define MVME162_IRQ_SCCB_SPCOND 0x46 86#define MVME162_IRQ_SCCB_SPCOND (IRQ_USER+6)
87#define MVME162_IRQ_SCCA_TX 0x48 87#define MVME162_IRQ_SCCA_TX (IRQ_USER+8)
88#define MVME162_IRQ_SCCA_STAT 0x4a 88#define MVME162_IRQ_SCCA_STAT (IRQ_USER+10)
89#define MVME162_IRQ_SCCA_RX 0x4c 89#define MVME162_IRQ_SCCA_RX (IRQ_USER+12)
90#define MVME162_IRQ_SCCA_SPCOND 0x4e 90#define MVME162_IRQ_SCCA_SPCOND (IRQ_USER+14)
91 91
92/* MVME162 version register */ 92/* MVME162 version register */
93 93
diff --git a/include/asm-m68k/scatterlist.h b/include/asm-m68k/scatterlist.h
index d7c9b5c5e6c7..8e612266da51 100644
--- a/include/asm-m68k/scatterlist.h
+++ b/include/asm-m68k/scatterlist.h
@@ -2,18 +2,17 @@
2#define _M68K_SCATTERLIST_H 2#define _M68K_SCATTERLIST_H
3 3
4struct scatterlist { 4struct scatterlist {
5 /* These two are only valid if ADDRESS member of this
6 * struct is NULL.
7 */
8 struct page *page; 5 struct page *page;
9 unsigned int offset; 6 unsigned int offset;
10
11 unsigned int length; 7 unsigned int length;
12 8
13 __u32 dvma_address; /* A place to hang host-specific addresses at. */ 9 __u32 dma_address; /* A place to hang host-specific addresses at. */
14}; 10};
15 11
16/* This is bogus and should go away. */ 12/* This is bogus and should go away. */
17#define ISA_DMA_THRESHOLD (0x00ffffff) 13#define ISA_DMA_THRESHOLD (0x00ffffff)
18 14
15#define sg_dma_address(sg) ((sg)->dma_address)
16#define sg_dma_len(sg) ((sg)->length)
17
19#endif /* !(_M68K_SCATTERLIST_H) */ 18#endif /* !(_M68K_SCATTERLIST_H) */
diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h
index b7b7ea20caab..85037a3d3e8e 100644
--- a/include/asm-m68k/signal.h
+++ b/include/asm-m68k/signal.h
@@ -156,13 +156,17 @@ typedef struct sigaltstack {
156 156
157static inline void sigaddset(sigset_t *set, int _sig) 157static inline void sigaddset(sigset_t *set, int _sig)
158{ 158{
159 __asm__("bfset %0{%1,#1}" : "=m" (*set) : "id" ((_sig - 1) ^ 31) 159 asm ("bfset %0{%1,#1}"
160 : "+od" (*set)
161 : "id" ((_sig - 1) ^ 31)
160 : "cc"); 162 : "cc");
161} 163}
162 164
163static inline void sigdelset(sigset_t *set, int _sig) 165static inline void sigdelset(sigset_t *set, int _sig)
164{ 166{
165 __asm__("bfclr %0{%1,#1}" : "=m"(*set) : "id"((_sig - 1) ^ 31) 167 asm ("bfclr %0{%1,#1}"
168 : "+od" (*set)
169 : "id" ((_sig - 1) ^ 31)
166 : "cc"); 170 : "cc");
167} 171}
168 172
@@ -175,8 +179,10 @@ static inline int __const_sigismember(sigset_t *set, int _sig)
175static inline int __gen_sigismember(sigset_t *set, int _sig) 179static inline int __gen_sigismember(sigset_t *set, int _sig)
176{ 180{
177 int ret; 181 int ret;
178 __asm__("bfextu %1{%2,#1},%0" 182 asm ("bfextu %1{%2,#1},%0"
179 : "=d"(ret) : "m"(*set), "id"((_sig-1) ^ 31)); 183 : "=d" (ret)
184 : "od" (*set), "id" ((_sig-1) ^ 31)
185 : "cc");
180 return ret; 186 return ret;
181} 187}
182 188
@@ -187,7 +193,10 @@ static inline int __gen_sigismember(sigset_t *set, int _sig)
187 193
188static inline int sigfindinword(unsigned long word) 194static inline int sigfindinword(unsigned long word)
189{ 195{
190 __asm__("bfffo %1{#0,#0},%0" : "=d"(word) : "d"(word & -word) : "cc"); 196 asm ("bfffo %1{#0,#0},%0"
197 : "=d" (word)
198 : "d" (word & -word)
199 : "cc");
191 return word ^ 31; 200 return word ^ 31;
192} 201}
193 202
diff --git a/include/asm-m68k/sun3ints.h b/include/asm-m68k/sun3ints.h
index bd038fccb64b..de91fa071b99 100644
--- a/include/asm-m68k/sun3ints.h
+++ b/include/asm-m68k/sun3ints.h
@@ -12,37 +12,25 @@
12#define SUN3INTS_H 12#define SUN3INTS_H
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <linux/kernel_stat.h>
18#include <linux/interrupt.h> 15#include <linux/interrupt.h>
19#include <linux/seq_file.h>
20#include <asm/segment.h>
21#include <asm/intersil.h> 16#include <asm/intersil.h>
22#include <asm/oplib.h> 17#include <asm/oplib.h>
18#include <asm/traps.h>
23 19
24#define SUN3_INT_VECS 192 20#define SUN3_INT_VECS 192
25 21
26void sun3_enable_irq(unsigned int irq); 22void sun3_enable_irq(unsigned int irq);
27void sun3_disable_irq(unsigned int irq); 23void sun3_disable_irq(unsigned int irq);
28int sun3_request_irq(unsigned int irq,
29 irqreturn_t (*handler)(int, void *, struct pt_regs *),
30 unsigned long flags, const char *devname, void *dev_id
31 );
32extern void sun3_init_IRQ (void); 24extern void sun3_init_IRQ (void);
33extern irqreturn_t (*sun3_default_handler[]) (int, void *, struct pt_regs *);
34extern void sun3_free_irq (unsigned int irq, void *dev_id);
35extern void sun3_enable_interrupts (void); 25extern void sun3_enable_interrupts (void);
36extern void sun3_disable_interrupts (void); 26extern void sun3_disable_interrupts (void);
37extern int show_sun3_interrupts(struct seq_file *, void *);
38extern irqreturn_t sun3_process_int(int, struct pt_regs *);
39extern volatile unsigned char* sun3_intreg; 27extern volatile unsigned char* sun3_intreg;
40 28
41/* master list of VME vectors -- don't fuck with this */ 29/* master list of VME vectors -- don't fuck with this */
42#define SUN3_VEC_FLOPPY 0x40 30#define SUN3_VEC_FLOPPY (IRQ_USER+0)
43#define SUN3_VEC_VMESCSI0 0x40 31#define SUN3_VEC_VMESCSI0 (IRQ_USER+0)
44#define SUN3_VEC_VMESCSI1 0x41 32#define SUN3_VEC_VMESCSI1 (IRQ_USER+1)
45#define SUN3_VEC_CG 0xA8 33#define SUN3_VEC_CG (IRQ_USER+104)
46 34
47 35
48#endif /* SUN3INTS_H */ 36#endif /* SUN3INTS_H */
diff --git a/include/asm-m68k/traps.h b/include/asm-m68k/traps.h
index 475056191252..8caef25624c7 100644
--- a/include/asm-m68k/traps.h
+++ b/include/asm-m68k/traps.h
@@ -13,8 +13,15 @@
13 13
14#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
15 15
16#include <linux/linkage.h>
17#include <asm/ptrace.h>
18
16typedef void (*e_vector)(void); 19typedef void (*e_vector)(void);
17 20
21asmlinkage void auto_inthandler(void);
22asmlinkage void user_inthandler(void);
23asmlinkage void bad_inthandler(void);
24
18extern e_vector vectors[]; 25extern e_vector vectors[];
19 26
20#endif 27#endif
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h
index b761ef218cea..88b1f47400e1 100644
--- a/include/asm-m68k/uaccess.h
+++ b/include/asm-m68k/uaccess.h
@@ -181,144 +181,164 @@ asm volatile ("\n" \
181unsigned long __generic_copy_from_user(void *to, const void __user *from, unsigned long n); 181unsigned long __generic_copy_from_user(void *to, const void __user *from, unsigned long n);
182unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned long n); 182unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned long n);
183 183
184#define __constant_copy_from_user_asm(res, to, from, tmp, n, s1, s2, s3)\
185 asm volatile ("\n" \
186 "1: moves."#s1" (%2)+,%3\n" \
187 " move."#s1" %3,(%1)+\n" \
188 "2: moves."#s2" (%2)+,%3\n" \
189 " move."#s2" %3,(%1)+\n" \
190 " .ifnc \""#s3"\",\"\"\n" \
191 "3: moves."#s3" (%2)+,%3\n" \
192 " move."#s3" %3,(%1)+\n" \
193 " .endif\n" \
194 "4:\n" \
195 " .section __ex_table,\"a\"\n" \
196 " .align 4\n" \
197 " .long 1b,10f\n" \
198 " .long 2b,20f\n" \
199 " .ifnc \""#s3"\",\"\"\n" \
200 " .long 3b,30f\n" \
201 " .endif\n" \
202 " .previous\n" \
203 "\n" \
204 " .section .fixup,\"ax\"\n" \
205 " .even\n" \
206 "10: clr."#s1" (%1)+\n" \
207 "20: clr."#s2" (%1)+\n" \
208 " .ifnc \""#s3"\",\"\"\n" \
209 "30: clr."#s3" (%1)+\n" \
210 " .endif\n" \
211 " moveq.l #"#n",%0\n" \
212 " jra 4b\n" \
213 " .previous\n" \
214 : "+d" (res), "+&a" (to), "+a" (from), "=&d" (tmp) \
215 : : "memory")
216
184static __always_inline unsigned long 217static __always_inline unsigned long
185__constant_copy_from_user(void *to, const void __user *from, unsigned long n) 218__constant_copy_from_user(void *to, const void __user *from, unsigned long n)
186{ 219{
187 unsigned long res = 0, tmp; 220 unsigned long res = 0, tmp;
188 221
189 /* limit the inlined version to 3 moves */
190 if (n == 11 || n > 12)
191 return __generic_copy_from_user(to, from, n);
192
193 switch (n) { 222 switch (n) {
194 case 1: 223 case 1:
195 __get_user_asm(res, *(u8 *)to, (u8 *)from, u8, b, d, 1); 224 __get_user_asm(res, *(u8 *)to, (u8 *)from, u8, b, d, 1);
196 return res; 225 break;
197 case 2: 226 case 2:
198 __get_user_asm(res, *(u16 *)to, (u16 *)from, u16, w, d, 2); 227 __get_user_asm(res, *(u16 *)to, (u16 *)from, u16, w, d, 2);
199 return res; 228 break;
229 case 3:
230 __constant_copy_from_user_asm(res, to, from, tmp, 3, w, b,);
231 break;
200 case 4: 232 case 4:
201 __get_user_asm(res, *(u32 *)to, (u32 *)from, u32, l, r, 4); 233 __get_user_asm(res, *(u32 *)to, (u32 *)from, u32, l, r, 4);
202 return res; 234 break;
235 case 5:
236 __constant_copy_from_user_asm(res, to, from, tmp, 5, l, b,);
237 break;
238 case 6:
239 __constant_copy_from_user_asm(res, to, from, tmp, 6, l, w,);
240 break;
241 case 7:
242 __constant_copy_from_user_asm(res, to, from, tmp, 7, l, w, b);
243 break;
244 case 8:
245 __constant_copy_from_user_asm(res, to, from, tmp, 8, l, l,);
246 break;
247 case 9:
248 __constant_copy_from_user_asm(res, to, from, tmp, 9, l, l, b);
249 break;
250 case 10:
251 __constant_copy_from_user_asm(res, to, from, tmp, 10, l, l, w);
252 break;
253 case 12:
254 __constant_copy_from_user_asm(res, to, from, tmp, 12, l, l, l);
255 break;
256 default:
257 /* we limit the inlined version to 3 moves */
258 return __generic_copy_from_user(to, from, n);
203 } 259 }
204 260
205 asm volatile ("\n"
206 " .ifndef .Lfrom_user\n"
207 " .set .Lfrom_user,1\n"
208 " .macro copy_from_user to,from,tmp\n"
209 " .if .Lcnt >= 4\n"
210 "1: moves.l (\\from)+,\\tmp\n"
211 " move.l \\tmp,(\\to)+\n"
212 " .set .Lcnt,.Lcnt-4\n"
213 " .elseif .Lcnt & 2\n"
214 "1: moves.w (\\from)+,\\tmp\n"
215 " move.w \\tmp,(\\to)+\n"
216 " .set .Lcnt,.Lcnt-2\n"
217 " .elseif .Lcnt & 1\n"
218 "1: moves.b (\\from)+,\\tmp\n"
219 " move.b \\tmp,(\\to)+\n"
220 " .set .Lcnt,.Lcnt-1\n"
221 " .else\n"
222 " .exitm\n"
223 " .endif\n"
224 "\n"
225 " .section __ex_table,\"a\"\n"
226 " .align 4\n"
227 " .long 1b,3f\n"
228 " .previous\n"
229 " .endm\n"
230 " .endif\n"
231 "\n"
232 " .set .Lcnt,%c4\n"
233 " copy_from_user %1,%2,%3\n"
234 " copy_from_user %1,%2,%3\n"
235 " copy_from_user %1,%2,%3\n"
236 "2:\n"
237 " .section .fixup,\"ax\"\n"
238 " .even\n"
239 "3: moveq.l %4,%0\n"
240 " move.l %5,%1\n"
241 " .rept %c4 / 4\n"
242 " clr.l (%1)+\n"
243 " .endr\n"
244 " .if %c4 & 2\n"
245 " clr.w (%1)+\n"
246 " .endif\n"
247 " .if %c4 & 1\n"
248 " clr.b (%1)+\n"
249 " .endif\n"
250 " jra 2b\n"
251 " .previous\n"
252 : "+r" (res), "+a" (to), "+a" (from), "=&d" (tmp)
253 : "i" (n), "g" (to)
254 : "memory");
255
256 return res; 261 return res;
257} 262}
258 263
264#define __constant_copy_to_user_asm(res, to, from, tmp, n, s1, s2, s3) \
265 asm volatile ("\n" \
266 " move."#s1" (%2)+,%3\n" \
267 "11: moves."#s1" %3,(%1)+\n" \
268 "12: move."#s2" (%2)+,%3\n" \
269 "21: moves."#s2" %3,(%1)+\n" \
270 "22:\n" \
271 " .ifnc \""#s3"\",\"\"\n" \
272 " move."#s3" (%2)+,%3\n" \
273 "31: moves."#s3" %3,(%1)+\n" \
274 "32:\n" \
275 " .endif\n" \
276 "4:\n" \
277 "\n" \
278 " .section __ex_table,\"a\"\n" \
279 " .align 4\n" \
280 " .long 11b,5f\n" \
281 " .long 12b,5f\n" \
282 " .long 21b,5f\n" \
283 " .long 22b,5f\n" \
284 " .ifnc \""#s3"\",\"\"\n" \
285 " .long 31b,5f\n" \
286 " .long 32b,5f\n" \
287 " .endif\n" \
288 " .previous\n" \
289 "\n" \
290 " .section .fixup,\"ax\"\n" \
291 " .even\n" \
292 "5: moveq.l #"#n",%0\n" \
293 " jra 4b\n" \
294 " .previous\n" \
295 : "+d" (res), "+a" (to), "+a" (from), "=&d" (tmp) \
296 : : "memory")
297
259static __always_inline unsigned long 298static __always_inline unsigned long
260__constant_copy_to_user(void __user *to, const void *from, unsigned long n) 299__constant_copy_to_user(void __user *to, const void *from, unsigned long n)
261{ 300{
262 unsigned long res = 0, tmp; 301 unsigned long res = 0, tmp;
263 302
264 /* limit the inlined version to 3 moves */
265 if (n == 11 || n > 12)
266 return __generic_copy_to_user(to, from, n);
267
268 switch (n) { 303 switch (n) {
269 case 1: 304 case 1:
270 __put_user_asm(res, *(u8 *)from, (u8 *)to, b, d, 1); 305 __put_user_asm(res, *(u8 *)from, (u8 *)to, b, d, 1);
271 return res; 306 break;
272 case 2: 307 case 2:
273 __put_user_asm(res, *(u16 *)from, (u16 *)to, w, d, 2); 308 __put_user_asm(res, *(u16 *)from, (u16 *)to, w, d, 2);
274 return res; 309 break;
310 case 3:
311 __constant_copy_to_user_asm(res, to, from, tmp, 3, w, b,);
312 break;
275 case 4: 313 case 4:
276 __put_user_asm(res, *(u32 *)from, (u32 *)to, l, r, 4); 314 __put_user_asm(res, *(u32 *)from, (u32 *)to, l, r, 4);
277 return res; 315 break;
316 case 5:
317 __constant_copy_to_user_asm(res, to, from, tmp, 5, l, b,);
318 break;
319 case 6:
320 __constant_copy_to_user_asm(res, to, from, tmp, 6, l, w,);
321 break;
322 case 7:
323 __constant_copy_to_user_asm(res, to, from, tmp, 7, l, w, b);
324 break;
325 case 8:
326 __constant_copy_to_user_asm(res, to, from, tmp, 8, l, l,);
327 break;
328 case 9:
329 __constant_copy_to_user_asm(res, to, from, tmp, 9, l, l, b);
330 break;
331 case 10:
332 __constant_copy_to_user_asm(res, to, from, tmp, 10, l, l, w);
333 break;
334 case 12:
335 __constant_copy_to_user_asm(res, to, from, tmp, 12, l, l, l);
336 break;
337 default:
338 /* limit the inlined version to 3 moves */
339 return __generic_copy_to_user(to, from, n);
278 } 340 }
279 341
280 asm volatile ("\n"
281 " .ifndef .Lto_user\n"
282 " .set .Lto_user,1\n"
283 " .macro copy_to_user to,from,tmp\n"
284 " .if .Lcnt >= 4\n"
285 " move.l (\\from)+,\\tmp\n"
286 "11: moves.l \\tmp,(\\to)+\n"
287 "12: .set .Lcnt,.Lcnt-4\n"
288 " .elseif .Lcnt & 2\n"
289 " move.w (\\from)+,\\tmp\n"
290 "11: moves.w \\tmp,(\\to)+\n"
291 "12: .set .Lcnt,.Lcnt-2\n"
292 " .elseif .Lcnt & 1\n"
293 " move.b (\\from)+,\\tmp\n"
294 "11: moves.b \\tmp,(\\to)+\n"
295 "12: .set .Lcnt,.Lcnt-1\n"
296 " .else\n"
297 " .exitm\n"
298 " .endif\n"
299 "\n"
300 " .section __ex_table,\"a\"\n"
301 " .align 4\n"
302 " .long 11b,3f\n"
303 " .long 12b,3f\n"
304 " .previous\n"
305 " .endm\n"
306 " .endif\n"
307 "\n"
308 " .set .Lcnt,%c4\n"
309 " copy_to_user %1,%2,%3\n"
310 " copy_to_user %1,%2,%3\n"
311 " copy_to_user %1,%2,%3\n"
312 "2:\n"
313 " .section .fixup,\"ax\"\n"
314 " .even\n"
315 "3: moveq.l %4,%0\n"
316 " jra 2b\n"
317 " .previous\n"
318 : "+r" (res), "+a" (to), "+a" (from), "=&d" (tmp)
319 : "i" (n)
320 : "memory");
321
322 return res; 342 return res;
323} 343}
324 344
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
index 986511db54a6..900f472fdd2b 100644
--- a/include/asm-mips/compat.h
+++ b/include/asm-mips/compat.h
@@ -145,8 +145,5 @@ static inline void __user *compat_alloc_user_space(long len)
145 145
146 return (void __user *) (regs->regs[29] - len); 146 return (void __user *) (regs->regs[29] - len);
147} 147}
148#if defined (__MIPSEL__)
149#define __COMPAT_ENDIAN_SWAP__ 1
150#endif
151 148
152#endif /* _ASM_COMPAT_H */ 149#endif /* _ASM_COMPAT_H */
diff --git a/include/asm-mips/mach-generic/floppy.h b/include/asm-mips/mach-generic/floppy.h
index 682a5858f8d7..83cd69e30ec3 100644
--- a/include/asm-mips/mach-generic/floppy.h
+++ b/include/asm-mips/mach-generic/floppy.h
@@ -98,7 +98,7 @@ static inline void fd_disable_irq(void)
98static inline int fd_request_irq(void) 98static inline int fd_request_irq(void)
99{ 99{
100 return request_irq(FLOPPY_IRQ, floppy_interrupt, 100 return request_irq(FLOPPY_IRQ, floppy_interrupt,
101 SA_INTERRUPT | SA_SAMPLE_RANDOM, "floppy", NULL); 101 SA_INTERRUPT, "floppy", NULL);
102} 102}
103 103
104static inline void fd_free_irq(void) 104static inline void fd_free_irq(void)
diff --git a/include/asm-mips/mach-jazz/floppy.h b/include/asm-mips/mach-jazz/floppy.h
index c9dad99b1232..9413117915f4 100644
--- a/include/asm-mips/mach-jazz/floppy.h
+++ b/include/asm-mips/mach-jazz/floppy.h
@@ -90,7 +90,7 @@ static inline void fd_disable_irq(void)
90static inline int fd_request_irq(void) 90static inline int fd_request_irq(void)
91{ 91{
92 return request_irq(FLOPPY_IRQ, floppy_interrupt, 92 return request_irq(FLOPPY_IRQ, floppy_interrupt,
93 SA_INTERRUPT | SA_SAMPLE_RANDOM, "floppy", NULL); 93 SA_INTERRUPT, "floppy", NULL);
94} 94}
95 95
96static inline void fd_free_irq(void) 96static inline void fd_free_irq(void)
diff --git a/include/asm-parisc/floppy.h b/include/asm-parisc/floppy.h
index ca3aed768cdc..458cdb2a7530 100644
--- a/include/asm-parisc/floppy.h
+++ b/include/asm-parisc/floppy.h
@@ -159,10 +159,8 @@ static int fd_request_irq(void)
159 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, 159 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
160 "floppy", NULL); 160 "floppy", NULL);
161 else 161 else
162 return request_irq(FLOPPY_IRQ, floppy_interrupt, 162 return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
163 SA_INTERRUPT|SA_SAMPLE_RANDOM, 163 "floppy", NULL);
164 "floppy", NULL);
165
166} 164}
167 165
168static unsigned long dma_mem_alloc(unsigned long size) 166static unsigned long dma_mem_alloc(unsigned long size)
diff --git a/include/asm-powerpc/backlight.h b/include/asm-powerpc/backlight.h
index 1ba1f27a0b63..a5e9e656e332 100644
--- a/include/asm-powerpc/backlight.h
+++ b/include/asm-powerpc/backlight.h
@@ -2,30 +2,30 @@
2 * Routines for handling backlight control on PowerBooks 2 * Routines for handling backlight control on PowerBooks
3 * 3 *
4 * For now, implementation resides in 4 * For now, implementation resides in
5 * arch/powerpc/platforms/powermac/pmac_support.c 5 * arch/powerpc/platforms/powermac/backlight.c
6 * 6 *
7 */ 7 */
8#ifndef __ASM_POWERPC_BACKLIGHT_H 8#ifndef __ASM_POWERPC_BACKLIGHT_H
9#define __ASM_POWERPC_BACKLIGHT_H 9#define __ASM_POWERPC_BACKLIGHT_H
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12/* Abstract values */ 12#include <linux/fb.h>
13#define BACKLIGHT_OFF 0 13#include <linux/mutex.h>
14#define BACKLIGHT_MIN 1
15#define BACKLIGHT_MAX 0xf
16 14
17struct backlight_controller { 15/* For locking instructions, see the implementation file */
18 int (*set_enable)(int enable, int level, void *data); 16extern struct backlight_device *pmac_backlight;
19 int (*set_level)(int level, void *data); 17extern struct mutex pmac_backlight_mutex;
20};
21 18
22extern void register_backlight_controller(struct backlight_controller *ctrler, void *data, char *type); 19extern void pmac_backlight_calc_curve(struct fb_info*);
23extern void unregister_backlight_controller(struct backlight_controller *ctrler, void *data); 20extern int pmac_backlight_curve_lookup(struct fb_info *info, int value);
24 21
25extern int set_backlight_enable(int enable); 22extern int pmac_has_backlight_type(const char *type);
26extern int get_backlight_enable(void); 23
27extern int set_backlight_level(int level); 24extern void pmac_backlight_key_up(void);
28extern int get_backlight_level(void); 25extern void pmac_backlight_key_down(void);
26
27extern int pmac_backlight_set_legacy_brightness(int brightness);
28extern int pmac_backlight_get_legacy_brightness(void);
29 29
30#endif /* __KERNEL__ */ 30#endif /* __KERNEL__ */
31#endif 31#endif
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h
index 7e2d169ee856..9c8d91bf5a0d 100644
--- a/include/asm-powerpc/floppy.h
+++ b/include/asm-powerpc/floppy.h
@@ -27,8 +27,7 @@
27#define fd_disable_irq() disable_irq(FLOPPY_IRQ) 27#define fd_disable_irq() disable_irq(FLOPPY_IRQ)
28#define fd_cacheflush(addr,size) /* nothing */ 28#define fd_cacheflush(addr,size) /* nothing */
29#define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt, \ 29#define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt, \
30 SA_INTERRUPT|SA_SAMPLE_RANDOM, \ 30 SA_INTERRUPT, "floppy", NULL)
31 "floppy", NULL)
32#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL); 31#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL);
33 32
34#ifdef CONFIG_PCI 33#ifdef CONFIG_PCI
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h
index 184a7a4d2fdf..faa1fc703053 100644
--- a/include/asm-powerpc/percpu.h
+++ b/include/asm-powerpc/percpu.h
@@ -22,6 +22,7 @@
22/* var is in discarded region: offset to particular copy we want */ 22/* var is in discarded region: offset to particular copy we want */
23#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) 23#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
24#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) 24#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
25#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
25 26
26/* A macro to avoid #include hell... */ 27/* A macro to avoid #include hell... */
27#define percpu_modcopy(pcpudst, src, size) \ 28#define percpu_modcopy(pcpudst, src, size) \
@@ -41,6 +42,7 @@ extern void setup_per_cpu_areas(void);
41 42
42#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 43#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
43#define __get_cpu_var(var) per_cpu__##var 44#define __get_cpu_var(var) per_cpu__##var
45#define __raw_get_cpu_var(var) per_cpu__##var
44 46
45#endif /* SMP */ 47#endif /* SMP */
46 48
diff --git a/include/asm-ppc/floppy.h b/include/asm-ppc/floppy.h
index 8ccd4a276fe9..2ba191eba448 100644
--- a/include/asm-ppc/floppy.h
+++ b/include/asm-ppc/floppy.h
@@ -99,10 +99,8 @@ static int fd_request_irq(void)
99 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, 99 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
100 "floppy", NULL); 100 "floppy", NULL);
101 else 101 else
102 return request_irq(FLOPPY_IRQ, floppy_interrupt, 102 return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
103 SA_INTERRUPT|SA_SAMPLE_RANDOM, 103 "floppy", NULL);
104 "floppy", NULL);
105
106} 104}
107 105
108static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io) 106static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index 436d216601e5..d9a8cca9b653 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -40,6 +40,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
40 __typeof__(type) per_cpu__##name 40 __typeof__(type) per_cpu__##name
41 41
42#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset) 42#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
43#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
43#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu]) 44#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
44 45
45/* A macro to avoid #include hell... */ 46/* A macro to avoid #include hell... */
@@ -57,6 +58,7 @@ do { \
57 __typeof__(type) per_cpu__##name 58 __typeof__(type) per_cpu__##name
58 59
59#define __get_cpu_var(var) __reloc_hide(var,0) 60#define __get_cpu_var(var) __reloc_hide(var,0)
61#define __raw_get_cpu_var(var) __reloc_hide(var,0)
60#define per_cpu(var,cpu) __reloc_hide(var,0) 62#define per_cpu(var,cpu) __reloc_hide(var,0)
61 63
62#endif /* SMP */ 64#endif /* SMP */
diff --git a/include/asm-sh/floppy.h b/include/asm-sh/floppy.h
index 38d7a2942476..307d9ce9f9ed 100644
--- a/include/asm-sh/floppy.h
+++ b/include/asm-sh/floppy.h
@@ -147,11 +147,10 @@ static int fd_request_irq(void)
147{ 147{
148 if(can_use_virtual_dma) 148 if(can_use_virtual_dma)
149 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, 149 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
150 "floppy", NULL); 150 "floppy", NULL);
151 else 151 else
152 return request_irq(FLOPPY_IRQ, floppy_interrupt, 152 return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
153 SA_INTERRUPT|SA_SAMPLE_RANDOM, 153 "floppy", NULL);
154 "floppy", NULL);
155 154
156} 155}
157 156
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h
index baef13b58952..a6ece06b83db 100644
--- a/include/asm-sparc64/percpu.h
+++ b/include/asm-sparc64/percpu.h
@@ -21,6 +21,7 @@ register unsigned long __local_per_cpu_offset asm("g5");
21/* var is in discarded region: offset to particular copy we want */ 21/* var is in discarded region: offset to particular copy we want */
22#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) 22#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
23#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset)) 23#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset))
24#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset))
24 25
25/* A macro to avoid #include hell... */ 26/* A macro to avoid #include hell... */
26#define percpu_modcopy(pcpudst, src, size) \ 27#define percpu_modcopy(pcpudst, src, size) \
@@ -37,6 +38,7 @@ do { \
37 38
38#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) 39#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var))
39#define __get_cpu_var(var) per_cpu__##var 40#define __get_cpu_var(var) per_cpu__##var
41#define __raw_get_cpu_var(var) per_cpu__##var
40 42
41#endif /* SMP */ 43#endif /* SMP */
42 44
diff --git a/include/asm-x86_64/floppy.h b/include/asm-x86_64/floppy.h
index 52825ce689f2..006291e89b4a 100644
--- a/include/asm-x86_64/floppy.h
+++ b/include/asm-x86_64/floppy.h
@@ -147,10 +147,8 @@ static int fd_request_irq(void)
147 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT, 147 return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
148 "floppy", NULL); 148 "floppy", NULL);
149 else 149 else
150 return request_irq(FLOPPY_IRQ, floppy_interrupt, 150 return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT,
151 SA_INTERRUPT|SA_SAMPLE_RANDOM, 151 "floppy", NULL);
152 "floppy", NULL);
153
154} 152}
155 153
156static unsigned long dma_mem_alloc(unsigned long size) 154static unsigned long dma_mem_alloc(unsigned long size)
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h
index 7f33aaf9f7b1..549eb929b2c0 100644
--- a/include/asm-x86_64/percpu.h
+++ b/include/asm-x86_64/percpu.h
@@ -21,6 +21,7 @@
21/* var is in discarded region: offset to particular copy we want */ 21/* var is in discarded region: offset to particular copy we want */
22#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) 22#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
23#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) 23#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
24#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
24 25
25/* A macro to avoid #include hell... */ 26/* A macro to avoid #include hell... */
26#define percpu_modcopy(pcpudst, src, size) \ 27#define percpu_modcopy(pcpudst, src, size) \
@@ -40,6 +41,7 @@ extern void setup_per_cpu_areas(void);
40 41
41#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 42#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
42#define __get_cpu_var(var) per_cpu__##var 43#define __get_cpu_var(var) per_cpu__##var
44#define __raw_get_cpu_var(var) per_cpu__##var
43 45
44#endif /* SMP */ 46#endif /* SMP */
45 47
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 3d54fbcf969e..e86bae7324d2 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -121,13 +121,17 @@ struct vfsmount;
121struct super_block; 121struct super_block;
122extern void acct_auto_close_mnt(struct vfsmount *m); 122extern void acct_auto_close_mnt(struct vfsmount *m);
123extern void acct_auto_close(struct super_block *sb); 123extern void acct_auto_close(struct super_block *sb);
124extern void acct_process(long exitcode); 124extern void acct_init_pacct(struct pacct_struct *pacct);
125extern void acct_collect(long exitcode, int group_dead);
126extern void acct_process(void);
125extern void acct_update_integrals(struct task_struct *tsk); 127extern void acct_update_integrals(struct task_struct *tsk);
126extern void acct_clear_integrals(struct task_struct *tsk); 128extern void acct_clear_integrals(struct task_struct *tsk);
127#else 129#else
128#define acct_auto_close_mnt(x) do { } while (0) 130#define acct_auto_close_mnt(x) do { } while (0)
129#define acct_auto_close(x) do { } while (0) 131#define acct_auto_close(x) do { } while (0)
130#define acct_process(x) do { } while (0) 132#define acct_init_pacct(x) do { } while (0)
133#define acct_collect(x,y) do { } while (0)
134#define acct_process() do { } while (0)
131#define acct_update_integrals(x) do { } while (0) 135#define acct_update_integrals(x) do { } while (0)
132#define acct_clear_integrals(task) do { } while (0) 136#define acct_clear_integrals(task) do { } while (0)
133#endif 137#endif
diff --git a/include/linux/bio.h b/include/linux/bio.h
index b60ffe32cd21..76bdaeab6f62 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -47,7 +47,7 @@
47#define BIO_BUG_ON 47#define BIO_BUG_ON
48#endif 48#endif
49 49
50#define BIO_MAX_PAGES (256) 50#define BIO_MAX_PAGES 256
51#define BIO_MAX_SIZE (BIO_MAX_PAGES << PAGE_CACHE_SHIFT) 51#define BIO_MAX_SIZE (BIO_MAX_PAGES << PAGE_CACHE_SHIFT)
52#define BIO_MAX_SECTORS (BIO_MAX_SIZE >> 9) 52#define BIO_MAX_SECTORS (BIO_MAX_SIZE >> 9)
53 53
diff --git a/include/linux/console.h b/include/linux/console.h
index 08734e660d41..d0f8a8009490 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -87,6 +87,7 @@ void give_up_console(const struct consw *sw);
87#define CON_CONSDEV (2) /* Last on the command line */ 87#define CON_CONSDEV (2) /* Last on the command line */
88#define CON_ENABLED (4) 88#define CON_ENABLED (4)
89#define CON_BOOT (8) 89#define CON_BOOT (8)
90#define CON_ANYTIME (16) /* Safe to call when cpu is offline */
90 91
91struct console 92struct console
92{ 93{
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 9cbb781d6f80..b268a3c0c376 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -317,7 +317,8 @@ static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp,
317 (cpu) < NR_CPUS; \ 317 (cpu) < NR_CPUS; \
318 (cpu) = next_cpu((cpu), (mask))) 318 (cpu) = next_cpu((cpu), (mask)))
319#else /* NR_CPUS == 1 */ 319#else /* NR_CPUS == 1 */
320#define for_each_cpu_mask(cpu, mask) for ((cpu) = 0; (cpu) < 1; (cpu)++) 320#define for_each_cpu_mask(cpu, mask) \
321 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
321#endif /* NR_CPUS */ 322#endif /* NR_CPUS */
322 323
323/* 324/*
@@ -405,7 +406,6 @@ int __any_online_cpu(const cpumask_t *mask);
405#define any_online_cpu(mask) 0 406#define any_online_cpu(mask) 0
406#endif 407#endif
407 408
408#define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
409#define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) 409#define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
410#define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) 410#define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map)
411#define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) 411#define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
index 2787b8a22ff1..c6a2353c4e68 100644
--- a/include/linux/dvb/dmx.h
+++ b/include/linux/dvb/dmx.h
@@ -88,20 +88,6 @@ typedef enum
88#define DMX_PES_PCR DMX_PES_PCR0 88#define DMX_PES_PCR DMX_PES_PCR0
89 89
90 90
91typedef enum
92{
93 DMX_SCRAMBLING_EV,
94 DMX_FRONTEND_EV
95} dmx_event_t;
96
97
98typedef enum
99{
100 DMX_SCRAMBLING_OFF,
101 DMX_SCRAMBLING_ON
102} dmx_scrambling_status_t;
103
104
105typedef struct dmx_filter 91typedef struct dmx_filter
106{ 92{
107 __u8 filter[DMX_FILTER_SIZE]; 93 __u8 filter[DMX_FILTER_SIZE];
@@ -132,17 +118,6 @@ struct dmx_pes_filter_params
132 __u32 flags; 118 __u32 flags;
133}; 119};
134 120
135
136struct dmx_event
137{
138 dmx_event_t event;
139 time_t timeStamp;
140 union
141 {
142 dmx_scrambling_status_t scrambling;
143 } u;
144};
145
146typedef struct dmx_caps { 121typedef struct dmx_caps {
147 __u32 caps; 122 __u32 caps;
148 int num_decoders; 123 int num_decoders;
@@ -171,7 +146,6 @@ struct dmx_stc {
171#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) 146#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
172#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) 147#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
173#define DMX_SET_BUFFER_SIZE _IO('o', 45) 148#define DMX_SET_BUFFER_SIZE _IO('o', 45)
174#define DMX_GET_EVENT _IOR('o', 46, struct dmx_event)
175#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) 149#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
176#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) 150#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
177#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) 151#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index 1e4bdfcf83a2..84cfa8bbdc36 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * include/linux/eventpoll.h ( Efficent event polling implementation ) 2 * include/linux/eventpoll.h ( Efficent event polling implementation )
3 * Copyright (C) 2001,...,2003 Davide Libenzi 3 * Copyright (C) 2001,...,2006 Davide Libenzi
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 757d54d8f1a5..5607e6457a65 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -710,6 +710,14 @@ struct dir_private_info {
710 __u32 next_hash; 710 __u32 next_hash;
711}; 711};
712 712
713/* calculate the first block number of the group */
714static inline ext3_fsblk_t
715ext3_group_first_block_no(struct super_block *sb, unsigned long group_no)
716{
717 return group_no * (ext3_fsblk_t)EXT3_BLOCKS_PER_GROUP(sb) +
718 le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block);
719}
720
713/* 721/*
714 * Special error return code only used by dx_probe() and its callers. 722 * Special error return code only used by dx_probe() and its callers.
715 */ 723 */
@@ -730,14 +738,16 @@ struct dir_private_info {
730/* balloc.c */ 738/* balloc.c */
731extern int ext3_bg_has_super(struct super_block *sb, int group); 739extern int ext3_bg_has_super(struct super_block *sb, int group);
732extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group); 740extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
733extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *); 741extern ext3_fsblk_t ext3_new_block (handle_t *handle, struct inode *inode,
734extern int ext3_new_blocks (handle_t *, struct inode *, unsigned long, 742 ext3_fsblk_t goal, int *errp);
735 unsigned long *, int *); 743extern ext3_fsblk_t ext3_new_blocks (handle_t *handle, struct inode *inode,
736extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long, 744 ext3_fsblk_t goal, unsigned long *count, int *errp);
737 unsigned long); 745extern void ext3_free_blocks (handle_t *handle, struct inode *inode,
738extern void ext3_free_blocks_sb (handle_t *, struct super_block *, 746 ext3_fsblk_t block, unsigned long count);
739 unsigned long, unsigned long, int *); 747extern void ext3_free_blocks_sb (handle_t *handle, struct super_block *sb,
740extern unsigned long ext3_count_free_blocks (struct super_block *); 748 ext3_fsblk_t block, unsigned long count,
749 unsigned long *pdquot_freed_blocks);
750extern ext3_fsblk_t ext3_count_free_blocks (struct super_block *);
741extern void ext3_check_blocks_bitmap (struct super_block *); 751extern void ext3_check_blocks_bitmap (struct super_block *);
742extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb, 752extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
743 unsigned int block_group, 753 unsigned int block_group,
@@ -773,7 +783,8 @@ extern unsigned long ext3_count_free (struct buffer_head *, unsigned);
773 783
774 784
775/* inode.c */ 785/* inode.c */
776int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); 786int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode,
787 struct buffer_head *bh, ext3_fsblk_t blocknr);
777struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); 788struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
778struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); 789struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
779int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, 790int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
@@ -808,7 +819,7 @@ extern int ext3_group_add(struct super_block *sb,
808 struct ext3_new_group_data *input); 819 struct ext3_new_group_data *input);
809extern int ext3_group_extend(struct super_block *sb, 820extern int ext3_group_extend(struct super_block *sb,
810 struct ext3_super_block *es, 821 struct ext3_super_block *es,
811 unsigned long n_blocks_count); 822 ext3_fsblk_t n_blocks_count);
812 823
813/* super.c */ 824/* super.c */
814extern void ext3_error (struct super_block *, const char *, const char *, ...) 825extern void ext3_error (struct super_block *, const char *, const char *, ...)
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h
index 7abf90147180..2f18b9511f21 100644
--- a/include/linux/ext3_fs_i.h
+++ b/include/linux/ext3_fs_i.h
@@ -21,9 +21,17 @@
21#include <linux/seqlock.h> 21#include <linux/seqlock.h>
22#include <linux/mutex.h> 22#include <linux/mutex.h>
23 23
24/* data type for block offset of block group */
25typedef int ext3_grpblk_t;
26
27/* data type for filesystem-wide blocks number */
28typedef unsigned long ext3_fsblk_t;
29
30#define E3FSBLK "%lu"
31
24struct ext3_reserve_window { 32struct ext3_reserve_window {
25 __u32 _rsv_start; /* First byte reserved */ 33 ext3_fsblk_t _rsv_start; /* First byte reserved */
26 __u32 _rsv_end; /* Last byte reserved or 0 */ 34 ext3_fsblk_t _rsv_end; /* Last byte reserved or 0 */
27}; 35};
28 36
29struct ext3_reserve_window_node { 37struct ext3_reserve_window_node {
@@ -50,7 +58,7 @@ struct ext3_block_alloc_info {
50 * allocated to this file. This give us the goal (target) for the next 58 * allocated to this file. This give us the goal (target) for the next
51 * allocation when we detect linearly ascending requests. 59 * allocation when we detect linearly ascending requests.
52 */ 60 */
53 __u32 last_alloc_physical_block; 61 ext3_fsblk_t last_alloc_physical_block;
54}; 62};
55 63
56#define rsv_start rsv_window._rsv_start 64#define rsv_start rsv_window._rsv_start
@@ -67,7 +75,7 @@ struct ext3_inode_info {
67 __u8 i_frag_no; 75 __u8 i_frag_no;
68 __u8 i_frag_size; 76 __u8 i_frag_size;
69#endif 77#endif
70 __u32 i_file_acl; 78 ext3_fsblk_t i_file_acl;
71 __u32 i_dir_acl; 79 __u32 i_dir_acl;
72 __u32 i_dtime; 80 __u32 i_dtime;
73 81
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 315d89740ddf..f1281687e549 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_FB_H 1#ifndef _LINUX_FB_H
2#define _LINUX_FB_H 2#define _LINUX_FB_H
3 3
4#include <linux/backlight.h>
4#include <asm/types.h> 5#include <asm/types.h>
5 6
6/* Definitions of frame buffers */ 7/* Definitions of frame buffers */
@@ -366,6 +367,12 @@ struct fb_cursor {
366 struct fb_image image; /* Cursor image */ 367 struct fb_image image; /* Cursor image */
367}; 368};
368 369
370#ifdef CONFIG_FB_BACKLIGHT
371/* Settings for the generic backlight code */
372#define FB_BACKLIGHT_LEVELS 128
373#define FB_BACKLIGHT_MAX 0xFF
374#endif
375
369#ifdef __KERNEL__ 376#ifdef __KERNEL__
370 377
371#include <linux/fs.h> 378#include <linux/fs.h>
@@ -756,6 +763,21 @@ struct fb_info {
756 struct fb_cmap cmap; /* Current cmap */ 763 struct fb_cmap cmap; /* Current cmap */
757 struct list_head modelist; /* mode list */ 764 struct list_head modelist; /* mode list */
758 struct fb_videomode *mode; /* current mode */ 765 struct fb_videomode *mode; /* current mode */
766
767#ifdef CONFIG_FB_BACKLIGHT
768 /* Lock ordering:
769 * bl_mutex (protects bl_dev and bl_curve)
770 * bl_dev->sem (backlight class)
771 */
772 struct mutex bl_mutex;
773
774 /* assigned backlight device */
775 struct backlight_device *bl_dev;
776
777 /* Backlight level curve */
778 u8 bl_curve[FB_BACKLIGHT_LEVELS];
779#endif
780
759 struct fb_ops *fbops; 781 struct fb_ops *fbops;
760 struct device *device; 782 struct device *device;
761 struct class_device *class_device; /* sysfs per device attrs */ 783 struct class_device *class_device; /* sysfs per device attrs */
@@ -895,6 +917,7 @@ extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
895extern void framebuffer_release(struct fb_info *info); 917extern void framebuffer_release(struct fb_info *info);
896extern int fb_init_class_device(struct fb_info *fb_info); 918extern int fb_init_class_device(struct fb_info *fb_info);
897extern void fb_cleanup_class_device(struct fb_info *head); 919extern void fb_cleanup_class_device(struct fb_info *head);
920extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max);
898 921
899/* drivers/video/fbmon.c */ 922/* drivers/video/fbmon.c */
900#define FB_MAXTIMINGS 0 923#define FB_MAXTIMINGS 0
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index c52a63755fdd..996f5611cd59 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -29,6 +29,7 @@
29#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ 29#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
30#define AT_REMOVEDIR 0x200 /* Remove directory instead of 30#define AT_REMOVEDIR 0x200 /* Remove directory instead of
31 unlinking file. */ 31 unlinking file. */
32#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
32 33
33#ifdef __KERNEL__ 34#ifdef __KERNEL__
34 35
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 5425b60021e3..9fc48a674b82 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -1,6 +1,6 @@
1/* 1/*
2 FUSE: Filesystem in Userspace 2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu> 3 Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu>
4 4
5 This program can be distributed under the terms of the GNU GPL. 5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING. 6 See the file COPYING.
@@ -9,18 +9,19 @@
9/* This file defines the kernel interface of FUSE */ 9/* This file defines the kernel interface of FUSE */
10 10
11#include <asm/types.h> 11#include <asm/types.h>
12#include <linux/major.h>
12 13
13/** Version number of this interface */ 14/** Version number of this interface */
14#define FUSE_KERNEL_VERSION 7 15#define FUSE_KERNEL_VERSION 7
15 16
16/** Minor version number of this interface */ 17/** Minor version number of this interface */
17#define FUSE_KERNEL_MINOR_VERSION 6 18#define FUSE_KERNEL_MINOR_VERSION 7
18 19
19/** The node ID of the root inode */ 20/** The node ID of the root inode */
20#define FUSE_ROOT_ID 1 21#define FUSE_ROOT_ID 1
21 22
22/** The major number of the fuse character device */ 23/** The major number of the fuse character device */
23#define FUSE_MAJOR 10 24#define FUSE_MAJOR MISC_MAJOR
24 25
25/** The minor number of the fuse character device */ 26/** The minor number of the fuse character device */
26#define FUSE_MINOR 229 27#define FUSE_MINOR 229
@@ -58,6 +59,13 @@ struct fuse_kstatfs {
58 __u32 spare[6]; 59 __u32 spare[6];
59}; 60};
60 61
62struct fuse_file_lock {
63 __u64 start;
64 __u64 end;
65 __u32 type;
66 __u32 pid; /* tgid */
67};
68
61/** 69/**
62 * Bitmasks for fuse_setattr_in.valid 70 * Bitmasks for fuse_setattr_in.valid
63 */ 71 */
@@ -82,6 +90,7 @@ struct fuse_kstatfs {
82 * INIT request/reply flags 90 * INIT request/reply flags
83 */ 91 */
84#define FUSE_ASYNC_READ (1 << 0) 92#define FUSE_ASYNC_READ (1 << 0)
93#define FUSE_POSIX_LOCKS (1 << 1)
85 94
86enum fuse_opcode { 95enum fuse_opcode {
87 FUSE_LOOKUP = 1, 96 FUSE_LOOKUP = 1,
@@ -112,8 +121,12 @@ enum fuse_opcode {
112 FUSE_READDIR = 28, 121 FUSE_READDIR = 28,
113 FUSE_RELEASEDIR = 29, 122 FUSE_RELEASEDIR = 29,
114 FUSE_FSYNCDIR = 30, 123 FUSE_FSYNCDIR = 30,
124 FUSE_GETLK = 31,
125 FUSE_SETLK = 32,
126 FUSE_SETLKW = 33,
115 FUSE_ACCESS = 34, 127 FUSE_ACCESS = 34,
116 FUSE_CREATE = 35 128 FUSE_CREATE = 35,
129 FUSE_INTERRUPT = 36,
117}; 130};
118 131
119/* The read buffer is required to be at least 8k, but may be much larger */ 132/* The read buffer is required to be at least 8k, but may be much larger */
@@ -199,6 +212,7 @@ struct fuse_flush_in {
199 __u64 fh; 212 __u64 fh;
200 __u32 flush_flags; 213 __u32 flush_flags;
201 __u32 padding; 214 __u32 padding;
215 __u64 lock_owner;
202}; 216};
203 217
204struct fuse_read_in { 218struct fuse_read_in {
@@ -247,6 +261,16 @@ struct fuse_getxattr_out {
247 __u32 padding; 261 __u32 padding;
248}; 262};
249 263
264struct fuse_lk_in {
265 __u64 fh;
266 __u64 owner;
267 struct fuse_file_lock lk;
268};
269
270struct fuse_lk_out {
271 struct fuse_file_lock lk;
272};
273
250struct fuse_access_in { 274struct fuse_access_in {
251 __u32 mask; 275 __u32 mask;
252 __u32 padding; 276 __u32 padding;
@@ -268,6 +292,10 @@ struct fuse_init_out {
268 __u32 max_write; 292 __u32 max_write;
269}; 293};
270 294
295struct fuse_interrupt_in {
296 __u64 unique;
297};
298
271struct fuse_in_header { 299struct fuse_in_header {
272 __u32 len; 300 __u32 len;
273 __u32 opcode; 301 __u32 opcode;
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 7d2a1b974c5e..07d7305f131e 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -40,7 +40,6 @@ struct hrtimer_base;
40 40
41/** 41/**
42 * struct hrtimer - the basic hrtimer structure 42 * struct hrtimer - the basic hrtimer structure
43 *
44 * @node: red black tree node for time ordered insertion 43 * @node: red black tree node for time ordered insertion
45 * @expires: the absolute expiry time in the hrtimers internal 44 * @expires: the absolute expiry time in the hrtimers internal
46 * representation. The time is related to the clock on 45 * representation. The time is related to the clock on
@@ -59,7 +58,6 @@ struct hrtimer {
59 58
60/** 59/**
61 * struct hrtimer_sleeper - simple sleeper structure 60 * struct hrtimer_sleeper - simple sleeper structure
62 *
63 * @timer: embedded timer structure 61 * @timer: embedded timer structure
64 * @task: task to wake up 62 * @task: task to wake up
65 * 63 *
@@ -72,7 +70,6 @@ struct hrtimer_sleeper {
72 70
73/** 71/**
74 * struct hrtimer_base - the timer base for a specific clock 72 * struct hrtimer_base - the timer base for a specific clock
75 *
76 * @index: clock type index for per_cpu support when moving a timer 73 * @index: clock type index for per_cpu support when moving a timer
77 * to a base on another cpu. 74 * to a base on another cpu.
78 * @lock: lock protecting the base and associated timers 75 * @lock: lock protecting the base and associated timers
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index c8b81f419fd8..21338bb3441d 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -112,6 +112,9 @@
112#define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */ 112#define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */
113#define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */ 113#define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */
114#define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */ 114#define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */
115#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */
116#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
117#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
115 118
116#define I2C_DRIVERID_I2CDEV 900 119#define I2C_DRIVERID_I2CDEV 900
117#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 120#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 77e66d055f5b..ef7bef207f48 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -630,6 +630,7 @@ typedef struct ide_drive_s {
630 unsigned int usage; /* current "open()" count for drive */ 630 unsigned int usage; /* current "open()" count for drive */
631 unsigned int failures; /* current failure count */ 631 unsigned int failures; /* current failure count */
632 unsigned int max_failures; /* maximum allowed failure count */ 632 unsigned int max_failures; /* maximum allowed failure count */
633 u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */
633 634
634 u64 capacity64; /* total number of sectors */ 635 u64 capacity64; /* total number of sectors */
635 636
@@ -1005,6 +1006,8 @@ extern ide_hwif_t ide_hwifs[]; /* master data repository */
1005extern int noautodma; 1006extern int noautodma;
1006 1007
1007extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); 1008extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs);
1009int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq,
1010 int uptodate, int nr_sectors);
1008 1011
1009/* 1012/*
1010 * This is used on exit from the driver to designate the next irq handler 1013 * This is used on exit from the driver to designate the next irq handler
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 8c21aaa248b4..3c5e4c2e517d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -117,6 +117,8 @@ extern int scnprintf(char * buf, size_t size, const char * fmt, ...)
117 __attribute__ ((format (printf, 3, 4))); 117 __attribute__ ((format (printf, 3, 4)));
118extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) 118extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
119 __attribute__ ((format (printf, 3, 0))); 119 __attribute__ ((format (printf, 3, 0)));
120extern char *kasprintf(gfp_t gfp, const char *fmt, ...)
121 __attribute__ ((format (printf, 2, 3)));
120 122
121extern int sscanf(const char *, const char *, ...) 123extern int sscanf(const char *, const char *, ...)
122 __attribute__ ((format (scanf, 2, 3))); 124 __attribute__ ((format (scanf, 2, 3)));
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index ebdd41fd1082..7cce5dfa092f 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -4,37 +4,19 @@
4#include <linux/err.h> 4#include <linux/err.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
6 6
7/**
8 * kthread_create: create a kthread.
9 * @threadfn: the function to run until signal_pending(current).
10 * @data: data ptr for @threadfn.
11 * @namefmt: printf-style name for the thread.
12 *
13 * Description: This helper function creates and names a kernel
14 * thread. The thread will be stopped: use wake_up_process() to start
15 * it. See also kthread_run(), kthread_create_on_cpu().
16 *
17 * When woken, the thread will run @threadfn() with @data as its
18 * argument. @threadfn can either call do_exit() directly if it is a
19 * standalone thread for which noone will call kthread_stop(), or
20 * return when 'kthread_should_stop()' is true (which means
21 * kthread_stop() has been called). The return value should be zero
22 * or a negative error number: it will be passed to kthread_stop().
23 *
24 * Returns a task_struct or ERR_PTR(-ENOMEM).
25 */
26struct task_struct *kthread_create(int (*threadfn)(void *data), 7struct task_struct *kthread_create(int (*threadfn)(void *data),
27 void *data, 8 void *data,
28 const char namefmt[], ...); 9 const char namefmt[], ...);
29 10
30/** 11/**
31 * kthread_run: create and wake a thread. 12 * kthread_run - create and wake a thread.
32 * @threadfn: the function to run until signal_pending(current). 13 * @threadfn: the function to run until signal_pending(current).
33 * @data: data ptr for @threadfn. 14 * @data: data ptr for @threadfn.
34 * @namefmt: printf-style name for the thread. 15 * @namefmt: printf-style name for the thread.
35 * 16 *
36 * Description: Convenient wrapper for kthread_create() followed by 17 * Description: Convenient wrapper for kthread_create() followed by
37 * wake_up_process(). Returns the kthread, or ERR_PTR(-ENOMEM). */ 18 * wake_up_process(). Returns the kthread or ERR_PTR(-ENOMEM).
19 */
38#define kthread_run(threadfn, data, namefmt, ...) \ 20#define kthread_run(threadfn, data, namefmt, ...) \
39({ \ 21({ \
40 struct task_struct *__k \ 22 struct task_struct *__k \
@@ -44,50 +26,9 @@ struct task_struct *kthread_create(int (*threadfn)(void *data),
44 __k; \ 26 __k; \
45}) 27})
46 28
47/**
48 * kthread_bind: bind a just-created kthread to a cpu.
49 * @k: thread created by kthread_create().
50 * @cpu: cpu (might not be online, must be possible) for @k to run on.
51 *
52 * Description: This function is equivalent to set_cpus_allowed(),
53 * except that @cpu doesn't need to be online, and the thread must be
54 * stopped (ie. just returned from kthread_create().
55 */
56void kthread_bind(struct task_struct *k, unsigned int cpu); 29void kthread_bind(struct task_struct *k, unsigned int cpu);
57
58/**
59 * kthread_stop: stop a thread created by kthread_create().
60 * @k: thread created by kthread_create().
61 *
62 * Sets kthread_should_stop() for @k to return true, wakes it, and
63 * waits for it to exit. Your threadfn() must not call do_exit()
64 * itself if you use this function! This can also be called after
65 * kthread_create() instead of calling wake_up_process(): the thread
66 * will exit without calling threadfn().
67 *
68 * Returns the result of threadfn(), or -EINTR if wake_up_process()
69 * was never called. */
70int kthread_stop(struct task_struct *k); 30int kthread_stop(struct task_struct *k);
71
72/**
73 * kthread_stop_sem: stop a thread created by kthread_create().
74 * @k: thread created by kthread_create().
75 * @s: semaphore that @k waits on while idle.
76 *
77 * Does essentially the same thing as kthread_stop() above, but wakes
78 * @k by calling up(@s).
79 *
80 * Returns the result of threadfn(), or -EINTR if wake_up_process()
81 * was never called. */
82int kthread_stop_sem(struct task_struct *k, struct semaphore *s); 31int kthread_stop_sem(struct task_struct *k, struct semaphore *s);
83
84/**
85 * kthread_should_stop: should this kthread return now?
86 *
87 * When someone calls kthread_stop on your kthread, it will be woken
88 * and this will return true. You should then return, and your return
89 * value will be passed through to kthread_stop().
90 */
91int kthread_should_stop(void); 32int kthread_should_stop(void);
92 33
93#endif /* _LINUX_KTHREAD_H */ 34#endif /* _LINUX_KTHREAD_H */
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 62bc57580707..ed3396dcc4f7 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -66,7 +66,6 @@ typedef union {
66 66
67/** 67/**
68 * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value 68 * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value
69 *
70 * @secs: seconds to set 69 * @secs: seconds to set
71 * @nsecs: nanoseconds to set 70 * @nsecs: nanoseconds to set
72 * 71 *
@@ -138,7 +137,6 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
138 137
139/** 138/**
140 * ktime_sub - subtract two ktime_t variables 139 * ktime_sub - subtract two ktime_t variables
141 *
142 * @lhs: minuend 140 * @lhs: minuend
143 * @rhs: subtrahend 141 * @rhs: subtrahend
144 * 142 *
@@ -157,7 +155,6 @@ static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
157 155
158/** 156/**
159 * ktime_add - add two ktime_t variables 157 * ktime_add - add two ktime_t variables
160 *
161 * @add1: addend1 158 * @add1: addend1
162 * @add2: addend2 159 * @add2: addend2
163 * 160 *
@@ -184,7 +181,6 @@ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
184 181
185/** 182/**
186 * ktime_add_ns - Add a scalar nanoseconds value to a ktime_t variable 183 * ktime_add_ns - Add a scalar nanoseconds value to a ktime_t variable
187 *
188 * @kt: addend 184 * @kt: addend
189 * @nsec: the scalar nsec value to add 185 * @nsec: the scalar nsec value to add
190 * 186 *
@@ -194,7 +190,6 @@ extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
194 190
195/** 191/**
196 * timespec_to_ktime - convert a timespec to ktime_t format 192 * timespec_to_ktime - convert a timespec to ktime_t format
197 *
198 * @ts: the timespec variable to convert 193 * @ts: the timespec variable to convert
199 * 194 *
200 * Returns a ktime_t variable with the converted timespec value 195 * Returns a ktime_t variable with the converted timespec value
@@ -207,7 +202,6 @@ static inline ktime_t timespec_to_ktime(const struct timespec ts)
207 202
208/** 203/**
209 * timeval_to_ktime - convert a timeval to ktime_t format 204 * timeval_to_ktime - convert a timeval to ktime_t format
210 *
211 * @tv: the timeval variable to convert 205 * @tv: the timeval variable to convert
212 * 206 *
213 * Returns a ktime_t variable with the converted timeval value 207 * Returns a ktime_t variable with the converted timeval value
@@ -220,7 +214,6 @@ static inline ktime_t timeval_to_ktime(const struct timeval tv)
220 214
221/** 215/**
222 * ktime_to_timespec - convert a ktime_t variable to timespec format 216 * ktime_to_timespec - convert a ktime_t variable to timespec format
223 *
224 * @kt: the ktime_t variable to convert 217 * @kt: the ktime_t variable to convert
225 * 218 *
226 * Returns the timespec representation of the ktime value 219 * Returns the timespec representation of the ktime value
@@ -233,7 +226,6 @@ static inline struct timespec ktime_to_timespec(const ktime_t kt)
233 226
234/** 227/**
235 * ktime_to_timeval - convert a ktime_t variable to timeval format 228 * ktime_to_timeval - convert a ktime_t variable to timeval format
236 *
237 * @kt: the ktime_t variable to convert 229 * @kt: the ktime_t variable to convert
238 * 230 *
239 * Returns the timeval representation of the ktime value 231 * Returns the timeval representation of the ktime value
diff --git a/include/linux/list.h b/include/linux/list.h
index a02642e4710a..37ca31b21bb7 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -281,16 +281,17 @@ static inline int list_empty(const struct list_head *head)
281} 281}
282 282
283/** 283/**
284 * list_empty_careful - tests whether a list is 284 * list_empty_careful - tests whether a list is empty and not being modified
285 * empty _and_ checks that no other CPU might be 285 * @head: the list to test
286 * in the process of still modifying either member 286 *
287 * Description:
288 * tests whether a list is empty _and_ checks that no other CPU might be
289 * in the process of modifying either member (next or prev)
287 * 290 *
288 * NOTE: using list_empty_careful() without synchronization 291 * NOTE: using list_empty_careful() without synchronization
289 * can only be safe if the only activity that can happen 292 * can only be safe if the only activity that can happen
290 * to the list entry is list_del_init(). Eg. it cannot be used 293 * to the list entry is list_del_init(). Eg. it cannot be used
291 * if another CPU could re-list_add() it. 294 * if another CPU could re-list_add() it.
292 *
293 * @head: the list to test.
294 */ 295 */
295static inline int list_empty_careful(const struct list_head *head) 296static inline int list_empty_careful(const struct list_head *head)
296{ 297{
@@ -350,7 +351,7 @@ static inline void list_splice_init(struct list_head *list,
350 351
351/** 352/**
352 * list_for_each - iterate over a list 353 * list_for_each - iterate over a list
353 * @pos: the &struct list_head to use as a loop counter. 354 * @pos: the &struct list_head to use as a loop cursor.
354 * @head: the head for your list. 355 * @head: the head for your list.
355 */ 356 */
356#define list_for_each(pos, head) \ 357#define list_for_each(pos, head) \
@@ -359,7 +360,7 @@ static inline void list_splice_init(struct list_head *list,
359 360
360/** 361/**
361 * __list_for_each - iterate over a list 362 * __list_for_each - iterate over a list
362 * @pos: the &struct list_head to use as a loop counter. 363 * @pos: the &struct list_head to use as a loop cursor.
363 * @head: the head for your list. 364 * @head: the head for your list.
364 * 365 *
365 * This variant differs from list_for_each() in that it's the 366 * This variant differs from list_for_each() in that it's the
@@ -372,7 +373,7 @@ static inline void list_splice_init(struct list_head *list,
372 373
373/** 374/**
374 * list_for_each_prev - iterate over a list backwards 375 * list_for_each_prev - iterate over a list backwards
375 * @pos: the &struct list_head to use as a loop counter. 376 * @pos: the &struct list_head to use as a loop cursor.
376 * @head: the head for your list. 377 * @head: the head for your list.
377 */ 378 */
378#define list_for_each_prev(pos, head) \ 379#define list_for_each_prev(pos, head) \
@@ -380,8 +381,8 @@ static inline void list_splice_init(struct list_head *list,
380 pos = pos->prev) 381 pos = pos->prev)
381 382
382/** 383/**
383 * list_for_each_safe - iterate over a list safe against removal of list entry 384 * list_for_each_safe - iterate over a list safe against removal of list entry
384 * @pos: the &struct list_head to use as a loop counter. 385 * @pos: the &struct list_head to use as a loop cursor.
385 * @n: another &struct list_head to use as temporary storage 386 * @n: another &struct list_head to use as temporary storage
386 * @head: the head for your list. 387 * @head: the head for your list.
387 */ 388 */
@@ -391,7 +392,7 @@ static inline void list_splice_init(struct list_head *list,
391 392
392/** 393/**
393 * list_for_each_entry - iterate over list of given type 394 * list_for_each_entry - iterate over list of given type
394 * @pos: the type * to use as a loop counter. 395 * @pos: the type * to use as a loop cursor.
395 * @head: the head for your list. 396 * @head: the head for your list.
396 * @member: the name of the list_struct within the struct. 397 * @member: the name of the list_struct within the struct.
397 */ 398 */
@@ -402,7 +403,7 @@ static inline void list_splice_init(struct list_head *list,
402 403
403/** 404/**
404 * list_for_each_entry_reverse - iterate backwards over list of given type. 405 * list_for_each_entry_reverse - iterate backwards over list of given type.
405 * @pos: the type * to use as a loop counter. 406 * @pos: the type * to use as a loop cursor.
406 * @head: the head for your list. 407 * @head: the head for your list.
407 * @member: the name of the list_struct within the struct. 408 * @member: the name of the list_struct within the struct.
408 */ 409 */
@@ -412,21 +413,24 @@ static inline void list_splice_init(struct list_head *list,
412 pos = list_entry(pos->member.prev, typeof(*pos), member)) 413 pos = list_entry(pos->member.prev, typeof(*pos), member))
413 414
414/** 415/**
415 * list_prepare_entry - prepare a pos entry for use as a start point in 416 * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue
416 * list_for_each_entry_continue
417 * @pos: the type * to use as a start point 417 * @pos: the type * to use as a start point
418 * @head: the head of the list 418 * @head: the head of the list
419 * @member: the name of the list_struct within the struct. 419 * @member: the name of the list_struct within the struct.
420 *
421 * Prepares a pos entry for use as a start point in list_for_each_entry_continue.
420 */ 422 */
421#define list_prepare_entry(pos, head, member) \ 423#define list_prepare_entry(pos, head, member) \
422 ((pos) ? : list_entry(head, typeof(*pos), member)) 424 ((pos) ? : list_entry(head, typeof(*pos), member))
423 425
424/** 426/**
425 * list_for_each_entry_continue - iterate over list of given type 427 * list_for_each_entry_continue - continue iteration over list of given type
426 * continuing after existing point 428 * @pos: the type * to use as a loop cursor.
427 * @pos: the type * to use as a loop counter.
428 * @head: the head for your list. 429 * @head: the head for your list.
429 * @member: the name of the list_struct within the struct. 430 * @member: the name of the list_struct within the struct.
431 *
432 * Continue to iterate over list of given type, continuing after
433 * the current position.
430 */ 434 */
431#define list_for_each_entry_continue(pos, head, member) \ 435#define list_for_each_entry_continue(pos, head, member) \
432 for (pos = list_entry(pos->member.next, typeof(*pos), member); \ 436 for (pos = list_entry(pos->member.next, typeof(*pos), member); \
@@ -434,11 +438,12 @@ static inline void list_splice_init(struct list_head *list,
434 pos = list_entry(pos->member.next, typeof(*pos), member)) 438 pos = list_entry(pos->member.next, typeof(*pos), member))
435 439
436/** 440/**
437 * list_for_each_entry_from - iterate over list of given type 441 * list_for_each_entry_from - iterate over list of given type from the current point
438 * continuing from existing point 442 * @pos: the type * to use as a loop cursor.
439 * @pos: the type * to use as a loop counter.
440 * @head: the head for your list. 443 * @head: the head for your list.
441 * @member: the name of the list_struct within the struct. 444 * @member: the name of the list_struct within the struct.
445 *
446 * Iterate over list of given type, continuing from current position.
442 */ 447 */
443#define list_for_each_entry_from(pos, head, member) \ 448#define list_for_each_entry_from(pos, head, member) \
444 for (; prefetch(pos->member.next), &pos->member != (head); \ 449 for (; prefetch(pos->member.next), &pos->member != (head); \
@@ -446,7 +451,7 @@ static inline void list_splice_init(struct list_head *list,
446 451
447/** 452/**
448 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry 453 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
449 * @pos: the type * to use as a loop counter. 454 * @pos: the type * to use as a loop cursor.
450 * @n: another type * to use as temporary storage 455 * @n: another type * to use as temporary storage
451 * @head: the head for your list. 456 * @head: the head for your list.
452 * @member: the name of the list_struct within the struct. 457 * @member: the name of the list_struct within the struct.
@@ -458,12 +463,14 @@ static inline void list_splice_init(struct list_head *list,
458 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 463 pos = n, n = list_entry(n->member.next, typeof(*n), member))
459 464
460/** 465/**
461 * list_for_each_entry_safe_continue - iterate over list of given type 466 * list_for_each_entry_safe_continue
462 * continuing after existing point safe against removal of list entry 467 * @pos: the type * to use as a loop cursor.
463 * @pos: the type * to use as a loop counter.
464 * @n: another type * to use as temporary storage 468 * @n: another type * to use as temporary storage
465 * @head: the head for your list. 469 * @head: the head for your list.
466 * @member: the name of the list_struct within the struct. 470 * @member: the name of the list_struct within the struct.
471 *
472 * Iterate over list of given type, continuing after current point,
473 * safe against removal of list entry.
467 */ 474 */
468#define list_for_each_entry_safe_continue(pos, n, head, member) \ 475#define list_for_each_entry_safe_continue(pos, n, head, member) \
469 for (pos = list_entry(pos->member.next, typeof(*pos), member), \ 476 for (pos = list_entry(pos->member.next, typeof(*pos), member), \
@@ -472,12 +479,14 @@ static inline void list_splice_init(struct list_head *list,
472 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 479 pos = n, n = list_entry(n->member.next, typeof(*n), member))
473 480
474/** 481/**
475 * list_for_each_entry_safe_from - iterate over list of given type 482 * list_for_each_entry_safe_from
476 * from existing point safe against removal of list entry 483 * @pos: the type * to use as a loop cursor.
477 * @pos: the type * to use as a loop counter.
478 * @n: another type * to use as temporary storage 484 * @n: another type * to use as temporary storage
479 * @head: the head for your list. 485 * @head: the head for your list.
480 * @member: the name of the list_struct within the struct. 486 * @member: the name of the list_struct within the struct.
487 *
488 * Iterate over list of given type from current point, safe against
489 * removal of list entry.
481 */ 490 */
482#define list_for_each_entry_safe_from(pos, n, head, member) \ 491#define list_for_each_entry_safe_from(pos, n, head, member) \
483 for (n = list_entry(pos->member.next, typeof(*pos), member); \ 492 for (n = list_entry(pos->member.next, typeof(*pos), member); \
@@ -485,12 +494,14 @@ static inline void list_splice_init(struct list_head *list,
485 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 494 pos = n, n = list_entry(n->member.next, typeof(*n), member))
486 495
487/** 496/**
488 * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against 497 * list_for_each_entry_safe_reverse
489 * removal of list entry 498 * @pos: the type * to use as a loop cursor.
490 * @pos: the type * to use as a loop counter.
491 * @n: another type * to use as temporary storage 499 * @n: another type * to use as temporary storage
492 * @head: the head for your list. 500 * @head: the head for your list.
493 * @member: the name of the list_struct within the struct. 501 * @member: the name of the list_struct within the struct.
502 *
503 * Iterate backwards over list of given type, safe against removal
504 * of list entry.
494 */ 505 */
495#define list_for_each_entry_safe_reverse(pos, n, head, member) \ 506#define list_for_each_entry_safe_reverse(pos, n, head, member) \
496 for (pos = list_entry((head)->prev, typeof(*pos), member), \ 507 for (pos = list_entry((head)->prev, typeof(*pos), member), \
@@ -500,7 +511,7 @@ static inline void list_splice_init(struct list_head *list,
500 511
501/** 512/**
502 * list_for_each_rcu - iterate over an rcu-protected list 513 * list_for_each_rcu - iterate over an rcu-protected list
503 * @pos: the &struct list_head to use as a loop counter. 514 * @pos: the &struct list_head to use as a loop cursor.
504 * @head: the head for your list. 515 * @head: the head for your list.
505 * 516 *
506 * This list-traversal primitive may safely run concurrently with 517 * This list-traversal primitive may safely run concurrently with
@@ -518,12 +529,13 @@ static inline void list_splice_init(struct list_head *list,
518 pos = pos->next) 529 pos = pos->next)
519 530
520/** 531/**
521 * list_for_each_safe_rcu - iterate over an rcu-protected list safe 532 * list_for_each_safe_rcu
522 * against removal of list entry 533 * @pos: the &struct list_head to use as a loop cursor.
523 * @pos: the &struct list_head to use as a loop counter.
524 * @n: another &struct list_head to use as temporary storage 534 * @n: another &struct list_head to use as temporary storage
525 * @head: the head for your list. 535 * @head: the head for your list.
526 * 536 *
537 * Iterate over an rcu-protected list, safe against removal of list entry.
538 *
527 * This list-traversal primitive may safely run concurrently with 539 * This list-traversal primitive may safely run concurrently with
528 * the _rcu list-mutation primitives such as list_add_rcu() 540 * the _rcu list-mutation primitives such as list_add_rcu()
529 * as long as the traversal is guarded by rcu_read_lock(). 541 * as long as the traversal is guarded by rcu_read_lock().
@@ -535,7 +547,7 @@ static inline void list_splice_init(struct list_head *list,
535 547
536/** 548/**
537 * list_for_each_entry_rcu - iterate over rcu list of given type 549 * list_for_each_entry_rcu - iterate over rcu list of given type
538 * @pos: the type * to use as a loop counter. 550 * @pos: the type * to use as a loop cursor.
539 * @head: the head for your list. 551 * @head: the head for your list.
540 * @member: the name of the list_struct within the struct. 552 * @member: the name of the list_struct within the struct.
541 * 553 *
@@ -551,11 +563,12 @@ static inline void list_splice_init(struct list_head *list,
551 563
552 564
553/** 565/**
554 * list_for_each_continue_rcu - iterate over an rcu-protected list 566 * list_for_each_continue_rcu
555 * continuing after existing point. 567 * @pos: the &struct list_head to use as a loop cursor.
556 * @pos: the &struct list_head to use as a loop counter.
557 * @head: the head for your list. 568 * @head: the head for your list.
558 * 569 *
570 * Iterate over an rcu-protected list, continuing after current point.
571 *
559 * This list-traversal primitive may safely run concurrently with 572 * This list-traversal primitive may safely run concurrently with
560 * the _rcu list-mutation primitives such as list_add_rcu() 573 * the _rcu list-mutation primitives such as list_add_rcu()
561 * as long as the traversal is guarded by rcu_read_lock(). 574 * as long as the traversal is guarded by rcu_read_lock().
@@ -681,11 +694,14 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
681 694
682 695
683/** 696/**
684 * hlist_add_head_rcu - adds the specified element to the specified hlist, 697 * hlist_add_head_rcu
685 * while permitting racing traversals.
686 * @n: the element to add to the hash list. 698 * @n: the element to add to the hash list.
687 * @h: the list to add to. 699 * @h: the list to add to.
688 * 700 *
701 * Description:
702 * Adds the specified element to the specified hlist,
703 * while permitting racing traversals.
704 *
689 * The caller must take whatever precautions are necessary 705 * The caller must take whatever precautions are necessary
690 * (such as holding appropriate locks) to avoid racing 706 * (such as holding appropriate locks) to avoid racing
691 * with another list-mutation primitive, such as hlist_add_head_rcu() 707 * with another list-mutation primitive, such as hlist_add_head_rcu()
@@ -730,11 +746,14 @@ static inline void hlist_add_after(struct hlist_node *n,
730} 746}
731 747
732/** 748/**
733 * hlist_add_before_rcu - adds the specified element to the specified hlist 749 * hlist_add_before_rcu
734 * before the specified node while permitting racing traversals.
735 * @n: the new element to add to the hash list. 750 * @n: the new element to add to the hash list.
736 * @next: the existing element to add the new element before. 751 * @next: the existing element to add the new element before.
737 * 752 *
753 * Description:
754 * Adds the specified element to the specified hlist
755 * before the specified node while permitting racing traversals.
756 *
738 * The caller must take whatever precautions are necessary 757 * The caller must take whatever precautions are necessary
739 * (such as holding appropriate locks) to avoid racing 758 * (such as holding appropriate locks) to avoid racing
740 * with another list-mutation primitive, such as hlist_add_head_rcu() 759 * with another list-mutation primitive, such as hlist_add_head_rcu()
@@ -755,11 +774,14 @@ static inline void hlist_add_before_rcu(struct hlist_node *n,
755} 774}
756 775
757/** 776/**
758 * hlist_add_after_rcu - adds the specified element to the specified hlist 777 * hlist_add_after_rcu
759 * after the specified node while permitting racing traversals.
760 * @prev: the existing element to add the new element after. 778 * @prev: the existing element to add the new element after.
761 * @n: the new element to add to the hash list. 779 * @n: the new element to add to the hash list.
762 * 780 *
781 * Description:
782 * Adds the specified element to the specified hlist
783 * after the specified node while permitting racing traversals.
784 *
763 * The caller must take whatever precautions are necessary 785 * The caller must take whatever precautions are necessary
764 * (such as holding appropriate locks) to avoid racing 786 * (such as holding appropriate locks) to avoid racing
765 * with another list-mutation primitive, such as hlist_add_head_rcu() 787 * with another list-mutation primitive, such as hlist_add_head_rcu()
@@ -792,8 +814,8 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
792 814
793/** 815/**
794 * hlist_for_each_entry - iterate over list of given type 816 * hlist_for_each_entry - iterate over list of given type
795 * @tpos: the type * to use as a loop counter. 817 * @tpos: the type * to use as a loop cursor.
796 * @pos: the &struct hlist_node to use as a loop counter. 818 * @pos: the &struct hlist_node to use as a loop cursor.
797 * @head: the head for your list. 819 * @head: the head for your list.
798 * @member: the name of the hlist_node within the struct. 820 * @member: the name of the hlist_node within the struct.
799 */ 821 */
@@ -804,9 +826,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
804 pos = pos->next) 826 pos = pos->next)
805 827
806/** 828/**
807 * hlist_for_each_entry_continue - iterate over a hlist continuing after existing point 829 * hlist_for_each_entry_continue - iterate over a hlist continuing after current point
808 * @tpos: the type * to use as a loop counter. 830 * @tpos: the type * to use as a loop cursor.
809 * @pos: the &struct hlist_node to use as a loop counter. 831 * @pos: the &struct hlist_node to use as a loop cursor.
810 * @member: the name of the hlist_node within the struct. 832 * @member: the name of the hlist_node within the struct.
811 */ 833 */
812#define hlist_for_each_entry_continue(tpos, pos, member) \ 834#define hlist_for_each_entry_continue(tpos, pos, member) \
@@ -816,9 +838,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
816 pos = pos->next) 838 pos = pos->next)
817 839
818/** 840/**
819 * hlist_for_each_entry_from - iterate over a hlist continuing from existing point 841 * hlist_for_each_entry_from - iterate over a hlist continuing from current point
820 * @tpos: the type * to use as a loop counter. 842 * @tpos: the type * to use as a loop cursor.
821 * @pos: the &struct hlist_node to use as a loop counter. 843 * @pos: the &struct hlist_node to use as a loop cursor.
822 * @member: the name of the hlist_node within the struct. 844 * @member: the name of the hlist_node within the struct.
823 */ 845 */
824#define hlist_for_each_entry_from(tpos, pos, member) \ 846#define hlist_for_each_entry_from(tpos, pos, member) \
@@ -828,8 +850,8 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
828 850
829/** 851/**
830 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry 852 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
831 * @tpos: the type * to use as a loop counter. 853 * @tpos: the type * to use as a loop cursor.
832 * @pos: the &struct hlist_node to use as a loop counter. 854 * @pos: the &struct hlist_node to use as a loop cursor.
833 * @n: another &struct hlist_node to use as temporary storage 855 * @n: another &struct hlist_node to use as temporary storage
834 * @head: the head for your list. 856 * @head: the head for your list.
835 * @member: the name of the hlist_node within the struct. 857 * @member: the name of the hlist_node within the struct.
@@ -842,8 +864,8 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
842 864
843/** 865/**
844 * hlist_for_each_entry_rcu - iterate over rcu list of given type 866 * hlist_for_each_entry_rcu - iterate over rcu list of given type
845 * @tpos: the type * to use as a loop counter. 867 * @tpos: the type * to use as a loop cursor.
846 * @pos: the &struct hlist_node to use as a loop counter. 868 * @pos: the &struct hlist_node to use as a loop cursor.
847 * @head: the head for your list. 869 * @head: the head for your list.
848 * @member: the name of the hlist_node within the struct. 870 * @member: the name of the hlist_node within the struct.
849 * 871 *
diff --git a/include/linux/loop.h b/include/linux/loop.h
index e76c7611d6cc..bf3d2345ce99 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -59,7 +59,7 @@ struct loop_device {
59 struct bio *lo_bio; 59 struct bio *lo_bio;
60 struct bio *lo_biotail; 60 struct bio *lo_biotail;
61 int lo_state; 61 int lo_state;
62 struct completion lo_done; 62 struct task_struct *lo_thread;
63 struct completion lo_bh_done; 63 struct completion lo_bh_done;
64 struct mutex lo_ctl_mutex; 64 struct mutex lo_ctl_mutex;
65 int lo_pending; 65 int lo_pending;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 5dba23a1c0d0..48148e0cdbd1 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -16,7 +16,9 @@ extern int fail_migrate_page(struct address_space *,
16 struct page *, struct page *); 16 struct page *, struct page *);
17 17
18extern int migrate_prep(void); 18extern int migrate_prep(void);
19 19extern int migrate_vmas(struct mm_struct *mm,
20 const nodemask_t *from, const nodemask_t *to,
21 unsigned long flags);
20#else 22#else
21 23
22static inline int isolate_lru_page(struct page *p, struct list_head *list) 24static inline int isolate_lru_page(struct page *p, struct list_head *list)
@@ -30,6 +32,13 @@ static inline int migrate_pages_to(struct list_head *pagelist,
30 32
31static inline int migrate_prep(void) { return -ENOSYS; } 33static inline int migrate_prep(void) { return -ENOSYS; }
32 34
35static inline int migrate_vmas(struct mm_struct *mm,
36 const nodemask_t *from, const nodemask_t *to,
37 unsigned long flags)
38{
39 return -ENOSYS;
40}
41
33/* Possible settings for the migrate_page() method in address_operations */ 42/* Possible settings for the migrate_page() method in address_operations */
34#define migrate_page NULL 43#define migrate_page NULL
35#define fail_migrate_page NULL 44#define fail_migrate_page NULL
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3b09444121d9..a929ea197e48 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -145,7 +145,6 @@ extern unsigned int kobjsize(const void *objp);
145 145
146#define VM_GROWSDOWN 0x00000100 /* general info on the segment */ 146#define VM_GROWSDOWN 0x00000100 /* general info on the segment */
147#define VM_GROWSUP 0x00000200 147#define VM_GROWSUP 0x00000200
148#define VM_SHM 0x00000000 /* Means nothing: delete it later */
149#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */ 148#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */
150#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ 149#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */
151 150
@@ -207,6 +206,8 @@ struct vm_operations_struct {
207 int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); 206 int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new);
208 struct mempolicy *(*get_policy)(struct vm_area_struct *vma, 207 struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
209 unsigned long addr); 208 unsigned long addr);
209 int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
210 const nodemask_t *to, unsigned long flags);
210#endif 211#endif
211}; 212};
212 213
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index 1d7cdd20b553..e712e7d47cc2 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -77,11 +77,11 @@ struct nbd_device {
77 * server. All data are in network byte order. 77 * server. All data are in network byte order.
78 */ 78 */
79struct nbd_request { 79struct nbd_request {
80 __u32 magic; 80 __be32 magic;
81 __u32 type; /* == READ || == WRITE */ 81 __be32 type; /* == READ || == WRITE */
82 char handle[8]; 82 char handle[8];
83 __u64 from; 83 __be64 from;
84 __u32 len; 84 __be32 len;
85} 85}
86#ifdef __GNUC__ 86#ifdef __GNUC__
87 __attribute__ ((packed)) 87 __attribute__ ((packed))
@@ -93,8 +93,8 @@ struct nbd_request {
93 * it has completed an I/O request (or an error occurs). 93 * it has completed an I/O request (or an error occurs).
94 */ 94 */
95struct nbd_reply { 95struct nbd_reply {
96 __u32 magic; 96 __be32 magic;
97 __u32 error; /* 0 = ok, else error */ 97 __be32 error; /* 0 = ok, else error */
98 char handle[8]; /* handle you got from request */ 98 char handle[8]; /* handle you got from request */
99}; 99};
100#endif 100#endif
diff --git a/include/linux/parport.h b/include/linux/parport.h
index d42737eeee06..5bf321e82c99 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -127,6 +127,10 @@ struct amiga_parport_state {
127 unsigned char statusdir;/* ciab.ddrb & 7 */ 127 unsigned char statusdir;/* ciab.ddrb & 7 */
128}; 128};
129 129
130struct ax88796_parport_state {
131 unsigned char cpr;
132};
133
130struct ip32_parport_state { 134struct ip32_parport_state {
131 unsigned int dcr; 135 unsigned int dcr;
132 unsigned int ecr; 136 unsigned int ecr;
@@ -138,6 +142,7 @@ struct parport_state {
138 /* ARC has no state. */ 142 /* ARC has no state. */
139 struct ax_parport_state ax; 143 struct ax_parport_state ax;
140 struct amiga_parport_state amiga; 144 struct amiga_parport_state amiga;
145 struct ax88796_parport_state ax88796;
141 /* Atari has not state. */ 146 /* Atari has not state. */
142 struct ip32_parport_state ip32; 147 struct ip32_parport_state ip32;
143 void *misc; 148 void *misc;
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index ecce5912f4d6..2ed807ddc08c 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -230,4 +230,8 @@ extern int pmu_battery_count;
230extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; 230extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
231extern unsigned int pmu_power_flags; 231extern unsigned int pmu_power_flags;
232 232
233/* Backlight */
234extern int disable_kernel_backlight;
235extern void pmu_backlight_init(struct device_node*);
236
233#endif /* __KERNEL__ */ 237#endif /* __KERNEL__ */
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 015297ff73fa..1dd1c707311f 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -59,13 +59,13 @@ extern void machine_crash_shutdown(struct pt_regs *);
59 * Architecture independent implemenations of sys_reboot commands. 59 * Architecture independent implemenations of sys_reboot commands.
60 */ 60 */
61 61
62extern void kernel_restart_prepare(char *cmd);
63extern void kernel_shutdown_prepare(enum system_states state); 62extern void kernel_shutdown_prepare(enum system_states state);
64 63
65extern void kernel_restart(char *cmd); 64extern void kernel_restart(char *cmd);
66extern void kernel_halt(void); 65extern void kernel_halt(void);
67extern void kernel_power_off(void); 66extern void kernel_power_off(void);
68extern void kernel_kexec(void); 67
68void ctrl_alt_del(void);
69 69
70/* 70/*
71 * Emergency restart, callable from an interrupt handler. 71 * Emergency restart, callable from an interrupt handler.
diff --git a/include/linux/resource.h b/include/linux/resource.h
index 21a86cb6acdb..ae13db714742 100644
--- a/include/linux/resource.h
+++ b/include/linux/resource.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/time.h> 4#include <linux/time.h>
5 5
6struct task_struct;
7
6/* 8/*
7 * Resource control/accounting header file for linux 9 * Resource control/accounting header file for linux
8 */ 10 */
@@ -67,4 +69,6 @@ struct rlimit {
67 */ 69 */
68#include <asm/resource.h> 70#include <asm/resource.h>
69 71
72int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
73
70#endif 74#endif
diff --git a/include/linux/rtc-v3020.h b/include/linux/rtc-v3020.h
new file mode 100644
index 000000000000..bf74e63c98fe
--- /dev/null
+++ b/include/linux/rtc-v3020.h
@@ -0,0 +1,35 @@
1/*
2 * v3020.h - Registers definition and platform data structure for the v3020 RTC.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2006, 8D Technologies inc.
9 */
10#ifndef __LINUX_V3020_H
11#define __LINUX_V3020_H
12
13/* The v3020 has only one data pin but which one
14 * is used depends on the board. */
15struct v3020_platform_data {
16 int leftshift; /* (1<<(leftshift)) & readl() */
17};
18
19#define V3020_STATUS_0 0x00
20#define V3020_STATUS_1 0x01
21#define V3020_SECONDS 0x02
22#define V3020_MINUTES 0x03
23#define V3020_HOURS 0x04
24#define V3020_MONTH_DAY 0x05
25#define V3020_MONTH 0x06
26#define V3020_YEAR 0x07
27#define V3020_WEEK_DAY 0x08
28#define V3020_WEEK 0x09
29
30#define V3020_IS_COMMAND(val) ((val)>=0x0E)
31
32#define V3020_CMD_RAM2CLOCK 0x0E
33#define V3020_CMD_CLOCK2RAM 0x0F
34
35#endif /* __LINUX_V3020_H */
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index ab61cd1199f2..36e2bf4b4315 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -102,6 +102,7 @@ struct rtc_pll_info {
102#include <linux/interrupt.h> 102#include <linux/interrupt.h>
103 103
104extern int rtc_month_days(unsigned int month, unsigned int year); 104extern int rtc_month_days(unsigned int month, unsigned int year);
105extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year);
105extern int rtc_valid_tm(struct rtc_time *tm); 106extern int rtc_valid_tm(struct rtc_time *tm);
106extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); 107extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time);
107extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); 108extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm);
@@ -155,6 +156,17 @@ struct rtc_device
155 struct rtc_task *irq_task; 156 struct rtc_task *irq_task;
156 spinlock_t irq_task_lock; 157 spinlock_t irq_task_lock;
157 int irq_freq; 158 int irq_freq;
159 int max_user_freq;
160#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
161 struct work_struct uie_task;
162 struct timer_list uie_timer;
163 /* Those fields are protected by rtc->irq_lock */
164 unsigned int oldsecs;
165 unsigned int irq_active:1;
166 unsigned int stop_uie_polling:1;
167 unsigned int uie_task_active:1;
168 unsigned int uie_timer_active:1;
169#endif
158}; 170};
159#define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) 171#define to_rtc_device(d) container_of(d, struct rtc_device, class_dev)
160 172
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 38b4791e6a5d..8d11d9310db0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -358,6 +358,14 @@ struct sighand_struct {
358 spinlock_t siglock; 358 spinlock_t siglock;
359}; 359};
360 360
361struct pacct_struct {
362 int ac_flag;
363 long ac_exitcode;
364 unsigned long ac_mem;
365 cputime_t ac_utime, ac_stime;
366 unsigned long ac_minflt, ac_majflt;
367};
368
361/* 369/*
362 * NOTE! "signal_struct" does not have it's own 370 * NOTE! "signal_struct" does not have it's own
363 * locking, because a shared signal_struct always 371 * locking, because a shared signal_struct always
@@ -449,6 +457,9 @@ struct signal_struct {
449 struct key *session_keyring; /* keyring inherited over fork */ 457 struct key *session_keyring; /* keyring inherited over fork */
450 struct key *process_keyring; /* keyring private to this process */ 458 struct key *process_keyring; /* keyring private to this process */
451#endif 459#endif
460#ifdef CONFIG_BSD_PROCESS_ACCT
461 struct pacct_struct pacct; /* per-process accounting information */
462#endif
452}; 463};
453 464
454/* Context switch must be unlocked if interrupts are to be enabled */ 465/* Context switch must be unlocked if interrupts are to be enabled */
diff --git a/include/linux/synclink.h b/include/linux/synclink.h
index 2993302f7923..0577f5284cbc 100644
--- a/include/linux/synclink.h
+++ b/include/linux/synclink.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * SyncLink Multiprotocol Serial Adapter Driver 2 * SyncLink Multiprotocol Serial Adapter Driver
3 * 3 *
4 * $Id: synclink.h,v 3.11 2006/02/06 21:20:29 paulkf Exp $ 4 * $Id: synclink.h,v 3.13 2006/05/23 18:25:06 paulkf Exp $
5 * 5 *
6 * Copyright (C) 1998-2000 by Microgate Corporation 6 * Copyright (C) 1998-2000 by Microgate Corporation
7 * 7 *
@@ -97,6 +97,8 @@
97#define HDLC_TXIDLE_ALT_MARK_SPACE 4 97#define HDLC_TXIDLE_ALT_MARK_SPACE 4
98#define HDLC_TXIDLE_SPACE 5 98#define HDLC_TXIDLE_SPACE 5
99#define HDLC_TXIDLE_MARK 6 99#define HDLC_TXIDLE_MARK 6
100#define HDLC_TXIDLE_CUSTOM_8 0x10000000
101#define HDLC_TXIDLE_CUSTOM_16 0x20000000
100 102
101#define HDLC_ENCODING_NRZ 0 103#define HDLC_ENCODING_NRZ 0
102#define HDLC_ENCODING_NRZB 1 104#define HDLC_ENCODING_NRZB 1
@@ -170,6 +172,7 @@ typedef struct _MGSL_PARAMS
170#define SYNCLINK_GT_DEVICE_ID 0x0070 172#define SYNCLINK_GT_DEVICE_ID 0x0070
171#define SYNCLINK_GT4_DEVICE_ID 0x0080 173#define SYNCLINK_GT4_DEVICE_ID 0x0080
172#define SYNCLINK_AC_DEVICE_ID 0x0090 174#define SYNCLINK_AC_DEVICE_ID 0x0090
175#define SYNCLINK_GT2_DEVICE_ID 0x00A0
173#define MGSL_MAX_SERIAL_NUMBER 30 176#define MGSL_MAX_SERIAL_NUMBER 30
174 177
175/* 178/*
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index c7132029af0f..6a60770984e9 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -55,7 +55,7 @@ enum
55 CTL_KERN=1, /* General kernel info and control */ 55 CTL_KERN=1, /* General kernel info and control */
56 CTL_VM=2, /* VM management */ 56 CTL_VM=2, /* VM management */
57 CTL_NET=3, /* Networking */ 57 CTL_NET=3, /* Networking */
58 CTL_PROC=4, /* Process info */ 58 /* was CTL_PROC */
59 CTL_FS=5, /* Filesystems */ 59 CTL_FS=5, /* Filesystems */
60 CTL_DEBUG=6, /* Debugging */ 60 CTL_DEBUG=6, /* Debugging */
61 CTL_DEV=7, /* Devices */ 61 CTL_DEV=7, /* Devices */
@@ -767,8 +767,6 @@ enum {
767 NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, 767 NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
768}; 768};
769 769
770/* CTL_PROC names: */
771
772/* CTL_FS names: */ 770/* CTL_FS names: */
773enum 771enum
774{ 772{
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 86b5b4271b5a..914f911325be 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -220,6 +220,19 @@ typedef __u16 __bitwise __fs16;
220 */ 220 */
221#define UFS_MINFREE 5 221#define UFS_MINFREE 5
222#define UFS_DEFAULTOPT UFS_OPTTIME 222#define UFS_DEFAULTOPT UFS_OPTTIME
223
224/*
225 * Debug code
226 */
227#ifdef CONFIG_UFS_DEBUG
228# define UFSD(f, a...) { \
229 printk ("UFSD (%s, %d): %s:", \
230 __FILE__, __LINE__, __FUNCTION__); \
231 printk (f, ## a); \
232 }
233#else
234# define UFSD(f, a...) /**/
235#endif
223 236
224/* 237/*
225 * Turn file system block numbers into disk block addresses. 238 * Turn file system block numbers into disk block addresses.
@@ -339,7 +352,22 @@ struct ufs2_csum_total {
339}; 352};
340 353
341/* 354/*
355 * File system flags
356 */
357#define UFS_UNCLEAN 0x01 /* file system not clean at mount (unused) */
358#define UFS_DOSOFTDEP 0x02 /* file system using soft dependencies */
359#define UFS_NEEDSFSCK 0x04 /* needs sync fsck (FreeBSD compat, unused) */
360#define UFS_INDEXDIRS 0x08 /* kernel supports indexed directories */
361#define UFS_ACLS 0x10 /* file system has ACLs enabled */
362#define UFS_MULTILABEL 0x20 /* file system is MAC multi-label */
363#define UFS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */
364
365#if 0
366/*
342 * This is the actual superblock, as it is laid out on the disk. 367 * This is the actual superblock, as it is laid out on the disk.
368 * Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and
369 * it may occupy several blocks, use
370 * struct ufs_super_block_(first,second,third) instead.
343 */ 371 */
344struct ufs_super_block { 372struct ufs_super_block {
345 __fs32 fs_link; /* UNUSED */ 373 __fs32 fs_link; /* UNUSED */
@@ -416,7 +444,7 @@ struct ufs_super_block {
416 __s8 fs_fmod; /* super block modified flag */ 444 __s8 fs_fmod; /* super block modified flag */
417 __s8 fs_clean; /* file system is clean flag */ 445 __s8 fs_clean; /* file system is clean flag */
418 __s8 fs_ronly; /* mounted read-only flag */ 446 __s8 fs_ronly; /* mounted read-only flag */
419 __s8 fs_flags; /* currently unused flag */ 447 __s8 fs_flags;
420 union { 448 union {
421 struct { 449 struct {
422 __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */ 450 __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */
@@ -485,6 +513,7 @@ struct ufs_super_block {
485 __fs32 fs_magic; /* magic number */ 513 __fs32 fs_magic; /* magic number */
486 __u8 fs_space[1]; /* list of blocks for each rotation */ 514 __u8 fs_space[1]; /* list of blocks for each rotation */
487}; 515};
516#endif/*struct ufs_super_block*/
488 517
489/* 518/*
490 * Preference for optimization. 519 * Preference for optimization.
@@ -666,7 +695,7 @@ struct ufs_buffer_head {
666}; 695};
667 696
668struct ufs_cg_private_info { 697struct ufs_cg_private_info {
669 struct ufs_cylinder_group ucg; 698 struct ufs_buffer_head c_ubh;
670 __u32 c_cgx; /* number of cylidner group */ 699 __u32 c_cgx; /* number of cylidner group */
671 __u16 c_ncyl; /* number of cyl's this cg */ 700 __u16 c_ncyl; /* number of cyl's this cg */
672 __u16 c_niblk; /* number of inode blocks this cg */ 701 __u16 c_niblk; /* number of inode blocks this cg */
@@ -686,6 +715,7 @@ struct ufs_cg_private_info {
686 715
687struct ufs_sb_private_info { 716struct ufs_sb_private_info {
688 struct ufs_buffer_head s_ubh; /* buffer containing super block */ 717 struct ufs_buffer_head s_ubh; /* buffer containing super block */
718 struct ufs2_csum_total cs_total;
689 __u32 s_sblkno; /* offset of super-blocks in filesys */ 719 __u32 s_sblkno; /* offset of super-blocks in filesys */
690 __u32 s_cblkno; /* offset of cg-block in filesys */ 720 __u32 s_cblkno; /* offset of cg-block in filesys */
691 __u32 s_iblkno; /* offset of inode-blocks in filesys */ 721 __u32 s_iblkno; /* offset of inode-blocks in filesys */
@@ -824,16 +854,54 @@ struct ufs_super_block_first {
824}; 854};
825 855
826struct ufs_super_block_second { 856struct ufs_super_block_second {
827 __s8 fs_fsmnt[212]; 857 union {
828 __fs32 fs_cgrotor; 858 struct {
829 __fs32 fs_csp[UFS_MAXCSBUFS]; 859 __s8 fs_fsmnt[212];
830 __fs32 fs_maxcluster; 860 __fs32 fs_cgrotor;
831 __fs32 fs_cpc; 861 __fs32 fs_csp[UFS_MAXCSBUFS];
832 __fs16 fs_opostbl[82]; 862 __fs32 fs_maxcluster;
833}; 863 __fs32 fs_cpc;
864 __fs16 fs_opostbl[82];
865 } fs_u1;
866 struct {
867 __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212];
868 __u8 fs_volname[UFS2_MAXVOLLEN];
869 __fs64 fs_swuid;
870 __fs32 fs_pad;
871 __fs32 fs_cgrotor;
872 __fs32 fs_ocsp[UFS2_NOCSPTRS];
873 __fs32 fs_contigdirs;
874 __fs32 fs_csp;
875 __fs32 fs_maxcluster;
876 __fs32 fs_active;
877 __fs32 fs_old_cpc;
878 __fs32 fs_maxbsize;
879 __fs64 fs_sparecon64[17];
880 __fs64 fs_sblockloc;
881 __fs64 cs_ndir;
882 __fs64 cs_nbfree;
883 } fs_u2;
884 } fs_un;
885};
834 886
835struct ufs_super_block_third { 887struct ufs_super_block_third {
836 __fs16 fs_opostbl[46]; 888 union {
889 struct {
890 __fs16 fs_opostbl[46];
891 } fs_u1;
892 struct {
893 __fs64 cs_nifree; /* number of free inodes */
894 __fs64 cs_nffree; /* number of free frags */
895 __fs64 cs_numclusters; /* number of free clusters */
896 __fs64 cs_spare[3]; /* future expansion */
897 struct ufs_timeval fs_time; /* last time written */
898 __fs64 fs_size; /* number of blocks in fs */
899 __fs64 fs_dsize; /* number of data blocks in fs */
900 __fs64 fs_csaddr; /* blk addr of cyl grp summary area */
901 __fs64 fs_pendingblocks;/* blocks in process of being freed */
902 __fs32 fs_pendinginodes;/*inodes in process of being freed */
903 } fs_u2;
904 } fs_un1;
837 union { 905 union {
838 struct { 906 struct {
839 __fs32 fs_sparecon[53];/* reserved for future constants */ 907 __fs32 fs_sparecon[53];/* reserved for future constants */
@@ -861,7 +929,7 @@ struct ufs_super_block_third {
861 __fs32 fs_qfmask[2]; /* ~usb_fmask */ 929 __fs32 fs_qfmask[2]; /* ~usb_fmask */
862 __fs32 fs_state; /* file system state time stamp */ 930 __fs32 fs_state; /* file system state time stamp */
863 } fs_44; 931 } fs_44;
864 } fs_u2; 932 } fs_un2;
865 __fs32 fs_postblformat; 933 __fs32 fs_postblformat;
866 __fs32 fs_nrpos; 934 __fs32 fs_nrpos;
867 __fs32 fs_postbloff; 935 __fs32 fs_postbloff;
@@ -875,7 +943,8 @@ struct ufs_super_block_third {
875/* balloc.c */ 943/* balloc.c */
876extern void ufs_free_fragments (struct inode *, unsigned, unsigned); 944extern void ufs_free_fragments (struct inode *, unsigned, unsigned);
877extern void ufs_free_blocks (struct inode *, unsigned, unsigned); 945extern void ufs_free_blocks (struct inode *, unsigned, unsigned);
878extern unsigned ufs_new_fragments (struct inode *, __fs32 *, unsigned, unsigned, unsigned, int *); 946extern unsigned ufs_new_fragments(struct inode *, __fs32 *, unsigned, unsigned,
947 unsigned, int *, struct page *);
879 948
880/* cylinder.c */ 949/* cylinder.c */
881extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); 950extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned);
@@ -886,11 +955,12 @@ extern struct inode_operations ufs_dir_inode_operations;
886extern int ufs_add_link (struct dentry *, struct inode *); 955extern int ufs_add_link (struct dentry *, struct inode *);
887extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); 956extern ino_t ufs_inode_by_name(struct inode *, struct dentry *);
888extern int ufs_make_empty(struct inode *, struct inode *); 957extern int ufs_make_empty(struct inode *, struct inode *);
889extern struct ufs_dir_entry * ufs_find_entry (struct dentry *, struct buffer_head **); 958extern struct ufs_dir_entry *ufs_find_entry(struct inode *, struct dentry *, struct page **);
890extern int ufs_delete_entry (struct inode *, struct ufs_dir_entry *, struct buffer_head *); 959extern int ufs_delete_entry(struct inode *, struct ufs_dir_entry *, struct page *);
891extern int ufs_empty_dir (struct inode *); 960extern int ufs_empty_dir (struct inode *);
892extern struct ufs_dir_entry * ufs_dotdot (struct inode *, struct buffer_head **); 961extern struct ufs_dir_entry *ufs_dotdot(struct inode *, struct page **);
893extern void ufs_set_link(struct inode *, struct ufs_dir_entry *, struct buffer_head *, struct inode *); 962extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
963 struct page *page, struct inode *inode);
894 964
895/* file.c */ 965/* file.c */
896extern struct inode_operations ufs_file_inode_operations; 966extern struct inode_operations ufs_file_inode_operations;
@@ -903,13 +973,11 @@ extern void ufs_free_inode (struct inode *inode);
903extern struct inode * ufs_new_inode (struct inode *, int); 973extern struct inode * ufs_new_inode (struct inode *, int);
904 974
905/* inode.c */ 975/* inode.c */
906extern u64 ufs_frag_map (struct inode *, sector_t);
907extern void ufs_read_inode (struct inode *); 976extern void ufs_read_inode (struct inode *);
908extern void ufs_put_inode (struct inode *); 977extern void ufs_put_inode (struct inode *);
909extern int ufs_write_inode (struct inode *, int); 978extern int ufs_write_inode (struct inode *, int);
910extern int ufs_sync_inode (struct inode *); 979extern int ufs_sync_inode (struct inode *);
911extern void ufs_delete_inode (struct inode *); 980extern void ufs_delete_inode (struct inode *);
912extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *);
913extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); 981extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
914extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); 982extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create);
915 983
diff --git a/include/linux/ufs_fs_i.h b/include/linux/ufs_fs_i.h
index 21665a953978..f50ce3b0cd52 100644
--- a/include/linux/ufs_fs_i.h
+++ b/include/linux/ufs_fs_i.h
@@ -27,6 +27,7 @@ struct ufs_inode_info {
27 __u32 i_oeftflag; 27 __u32 i_oeftflag;
28 __u16 i_osync; 28 __u16 i_osync;
29 __u32 i_lastfrag; 29 __u32 i_lastfrag;
30 __u32 i_dir_start_lookup;
30 struct inode vfs_inode; 31 struct inode vfs_inode;
31}; 32};
32 33
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 91140091ced2..41bc7e9603cd 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -1,49 +1,21 @@
1/*
2 * Video for Linux version 1 - OBSOLETE
3 *
4 * Header file for v4l1 drivers and applications, for
5 * Linux kernels 2.2.x or 2.4.x.
6 *
7 * Provides header for legacy drivers and applications
8 *
9 * See http://linuxtv.org for more info
10 *
11 */
1#ifndef __LINUX_VIDEODEV_H 12#ifndef __LINUX_VIDEODEV_H
2#define __LINUX_VIDEODEV_H 13#define __LINUX_VIDEODEV_H
3 14
4#include <linux/types.h>
5
6#define HAVE_V4L1 1 15#define HAVE_V4L1 1
7 16
8#include <linux/videodev2.h> 17#include <linux/videodev2.h>
9 18
10#ifdef __KERNEL__
11
12#include <linux/mm.h>
13
14extern struct video_device* video_devdata(struct file*);
15
16#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
17static inline void
18video_device_create_file(struct video_device *vfd,
19 struct class_device_attribute *attr)
20{
21 class_device_create_file(&vfd->class_dev, attr);
22}
23static inline void
24video_device_remove_file(struct video_device *vfd,
25 struct class_device_attribute *attr)
26{
27 class_device_remove_file(&vfd->class_dev, attr);
28}
29
30#if OBSOLETE_OWNER /* to be removed in 2.6.15 */
31/* helper functions to access driver private data. */
32static inline void *video_get_drvdata(struct video_device *dev)
33{
34 return dev->priv;
35}
36
37static inline void video_set_drvdata(struct video_device *dev, void *data)
38{
39 dev->priv = data;
40}
41#endif
42
43extern int video_exclusive_open(struct inode *inode, struct file *file);
44extern int video_exclusive_release(struct inode *inode, struct file *file);
45#endif /* __KERNEL__ */
46
47struct video_capability 19struct video_capability
48{ 20{
49 char name[32]; 21 char name[32];
@@ -363,6 +335,7 @@ struct video_code
363#define VID_HARDWARE_SAA7114H 37 335#define VID_HARDWARE_SAA7114H 37
364#define VID_HARDWARE_SN9C102 38 336#define VID_HARDWARE_SN9C102 38
365#define VID_HARDWARE_ARV 39 337#define VID_HARDWARE_ARV 39
338
366#endif /* __LINUX_VIDEODEV_H */ 339#endif /* __LINUX_VIDEODEV_H */
367 340
368/* 341/*
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index ad7fa9c86c10..4f428547ec09 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1,35 +1,33 @@
1#ifndef __LINUX_VIDEODEV2_H
2#define __LINUX_VIDEODEV2_H
3/* 1/*
4 * Video for Linux Two 2 * Video for Linux Two
5 * 3 *
6 * Header file for v4l or V4L2 drivers and applications, for 4 * Header file for v4l or V4L2 drivers and applications
7 * Linux kernels 2.2.x or 2.4.x. 5 * with public API.
6 * All kernel-specific stuff were moved to media/v4l2-dev.h, so
7 * no #if __KERNEL tests are allowed here
8 * 8 *
9 * See http://bytesex.org/v4l/ for API specs and other 9 * See http://linuxtv.org for more info
10 * v4l2 documentation.
11 * 10 *
12 * Author: Bill Dirks <bdirks@pacbell.net> 11 * Author: Bill Dirks <bdirks@pacbell.net>
13 * Justin Schoeman 12 * Justin Schoeman
14 * et al. 13 * et al.
15 */ 14 */
15#ifndef __LINUX_VIDEODEV2_H
16#define __LINUX_VIDEODEV2_H
16#ifdef __KERNEL__ 17#ifdef __KERNEL__
17#include <linux/time.h> /* need struct timeval */ 18#include <linux/time.h> /* need struct timeval */
18#include <linux/poll.h>
19#include <linux/device.h>
20#include <linux/mutex.h>
21#endif
22#include <linux/compiler.h> /* need __user */ 19#include <linux/compiler.h> /* need __user */
20#else
21#define __user
22#endif
23#include <linux/types.h>
23 24
24
25#define OBSOLETE_OWNER 1 /* It will be removed for 2.6.17 */
26#define HAVE_V4L2 1 25#define HAVE_V4L2 1
27 26
28/* 27/*
29 * Common stuff for both V4L1 and V4L2 28 * Common stuff for both V4L1 and V4L2
30 * Moved from videodev.h 29 * Moved from videodev.h
31 */ 30 */
32
33#define VIDEO_MAX_FRAME 32 31#define VIDEO_MAX_FRAME 32
34 32
35#define VID_TYPE_CAPTURE 1 /* Can capture */ 33#define VID_TYPE_CAPTURE 1 /* Can capture */
@@ -47,71 +45,6 @@
47#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ 45#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
48#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ 46#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
49 47
50#ifdef __KERNEL__
51
52/* Minor device allocation */
53#define MINOR_VFL_TYPE_GRABBER_MIN 0
54#define MINOR_VFL_TYPE_GRABBER_MAX 63
55#define MINOR_VFL_TYPE_RADIO_MIN 64
56#define MINOR_VFL_TYPE_RADIO_MAX 127
57#define MINOR_VFL_TYPE_VTX_MIN 192
58#define MINOR_VFL_TYPE_VTX_MAX 223
59#define MINOR_VFL_TYPE_VBI_MIN 224
60#define MINOR_VFL_TYPE_VBI_MAX 255
61
62#define VFL_TYPE_GRABBER 0
63#define VFL_TYPE_VBI 1
64#define VFL_TYPE_RADIO 2
65#define VFL_TYPE_VTX 3
66
67struct video_device
68{
69 /* device info */
70 struct device *dev;
71 char name[32];
72 int type; /* v4l1 */
73 int type2; /* v4l2 */
74 int hardware;
75 int minor;
76
77 /* device ops + callbacks */
78 const struct file_operations *fops;
79 void (*release)(struct video_device *vfd);
80
81
82#if OBSOLETE_OWNER /* to be removed in 2.6.15 */
83 /* obsolete -- fops->owner is used instead */
84 struct module *owner;
85 /* dev->driver_data will be used instead some day.
86 * Use the video_{get|set}_drvdata() helper functions,
87 * so the switch over will be transparent for you.
88 * Or use {pci|usb}_{get|set}_drvdata() directly. */
89 void *priv;
90#endif
91
92 /* for videodev.c intenal usage -- please don't touch */
93 int users; /* video_exclusive_{open|close} ... */
94 struct mutex lock; /* ... helper function uses these */
95 char devfs_name[64]; /* devfs */
96 struct class_device class_dev; /* sysfs */
97};
98
99#define VIDEO_MAJOR 81
100
101extern int video_register_device(struct video_device *, int type, int nr);
102extern void video_unregister_device(struct video_device *);
103extern int video_usercopy(struct inode *inode, struct file *file,
104 unsigned int cmd, unsigned long arg,
105 int (*func)(struct inode *inode, struct file *file,
106 unsigned int cmd, void *arg));
107
108/* helper functions to alloc / release struct video_device, the
109 later can be used for video_device->release() */
110struct video_device *video_device_alloc(void);
111void video_device_release(struct video_device *vfd);
112
113#endif
114
115/* 48/*
116 * M I S C E L L A N E O U S 49 * M I S C E L L A N E O U S
117 */ 50 */
@@ -172,6 +105,8 @@ enum v4l2_ctrl_type {
172 V4L2_CTRL_TYPE_BOOLEAN = 2, 105 V4L2_CTRL_TYPE_BOOLEAN = 2,
173 V4L2_CTRL_TYPE_MENU = 3, 106 V4L2_CTRL_TYPE_MENU = 3,
174 V4L2_CTRL_TYPE_BUTTON = 4, 107 V4L2_CTRL_TYPE_BUTTON = 4,
108 V4L2_CTRL_TYPE_INTEGER64 = 5,
109 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
175}; 110};
176 111
177enum v4l2_tuner_type { 112enum v4l2_tuner_type {
@@ -270,7 +205,6 @@ struct v4l2_capability
270/* 205/*
271 * V I D E O I M A G E F O R M A T 206 * V I D E O I M A G E F O R M A T
272 */ 207 */
273
274struct v4l2_pix_format 208struct v4l2_pix_format
275{ 209{
276 __u32 width; 210 __u32 width;
@@ -283,7 +217,7 @@ struct v4l2_pix_format
283 __u32 priv; /* private data, depends on pixelformat */ 217 __u32 priv; /* private data, depends on pixelformat */
284}; 218};
285 219
286/* Pixel format FOURCC depth Description */ 220/* Pixel format FOURCC depth Description */
287#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ 221#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */
288#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ 222#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */
289#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ 223#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */
@@ -319,7 +253,7 @@ struct v4l2_pix_format
319#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ 253#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
320#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ 254#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */
321#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ 255#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */
322#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG */ 256#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */
323 257
324/* Vendor-specific formats */ 258/* Vendor-specific formats */
325#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ 259#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */
@@ -343,7 +277,6 @@ struct v4l2_fmtdesc
343 277
344#define V4L2_FMT_FLAG_COMPRESSED 0x0001 278#define V4L2_FMT_FLAG_COMPRESSED 0x0001
345 279
346
347/* 280/*
348 * T I M E C O D E 281 * T I M E C O D E
349 */ 282 */
@@ -373,16 +306,15 @@ struct v4l2_timecode
373#define V4L2_TC_USERBITS_8BITCHARS 0x0008 306#define V4L2_TC_USERBITS_8BITCHARS 0x0008
374/* The above is based on SMPTE timecodes */ 307/* The above is based on SMPTE timecodes */
375 308
376 309#ifdef __KERNEL__
377/* 310/*
378 * M P E G C O M P R E S S I O N P A R A M E T E R S 311 * M P E G C O M P R E S S I O N P A R A M E T E R S
379 * 312 *
380 * ### WARNING: this is still work-in-progress right now, most likely 313 * ### WARNING: This experimental MPEG compression API is obsolete.
381 * ### there will be some incompatible changes. 314 * ### It is replaced by the MPEG controls API.
315 * ### This old API will disappear in the near future!
382 * 316 *
383 */ 317 */
384
385
386enum v4l2_bitrate_mode { 318enum v4l2_bitrate_mode {
387 V4L2_BITRATE_NONE = 0, /* not specified */ 319 V4L2_BITRATE_NONE = 0, /* not specified */
388 V4L2_BITRATE_CBR, /* constant bitrate */ 320 V4L2_BITRATE_CBR, /* constant bitrate */
@@ -460,6 +392,7 @@ struct v4l2_mpeg_compression {
460 /* I don't expect the above being perfect yet ;) */ 392 /* I don't expect the above being perfect yet ;) */
461 __u32 reserved_5[8]; 393 __u32 reserved_5[8];
462}; 394};
395#endif
463 396
464struct v4l2_jpegcompression 397struct v4l2_jpegcompression
465{ 398{
@@ -491,7 +424,6 @@ struct v4l2_jpegcompression
491 * allways use APP0 */ 424 * allways use APP0 */
492}; 425};
493 426
494
495/* 427/*
496 * M E M O R Y - M A P P I N G B U F F E R S 428 * M E M O R Y - M A P P I N G B U F F E R S
497 */ 429 */
@@ -573,7 +505,6 @@ struct v4l2_window
573 void __user *bitmap; 505 void __user *bitmap;
574}; 506};
575 507
576
577/* 508/*
578 * C A P T U R E P A R A M E T E R S 509 * C A P T U R E P A R A M E T E R S
579 */ 510 */
@@ -586,6 +517,7 @@ struct v4l2_captureparm
586 __u32 readbuffers; /* # of buffers for read */ 517 __u32 readbuffers; /* # of buffers for read */
587 __u32 reserved[4]; 518 __u32 reserved[4];
588}; 519};
520
589/* Flags for 'capability' and 'capturemode' fields */ 521/* Flags for 'capability' and 'capturemode' fields */
590#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ 522#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
591#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ 523#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
@@ -603,7 +535,6 @@ struct v4l2_outputparm
603/* 535/*
604 * I N P U T I M A G E C R O P P I N G 536 * I N P U T I M A G E C R O P P I N G
605 */ 537 */
606
607struct v4l2_cropcap { 538struct v4l2_cropcap {
608 enum v4l2_buf_type type; 539 enum v4l2_buf_type type;
609 struct v4l2_rect bounds; 540 struct v4l2_rect bounds;
@@ -710,7 +641,6 @@ struct v4l2_standard
710 __u32 reserved[4]; 641 __u32 reserved[4];
711}; 642};
712 643
713
714/* 644/*
715 * V I D E O I N P U T S 645 * V I D E O I N P U T S
716 */ 646 */
@@ -725,6 +655,7 @@ struct v4l2_input
725 __u32 status; 655 __u32 status;
726 __u32 reserved[4]; 656 __u32 reserved[4];
727}; 657};
658
728/* Values for the 'type' field */ 659/* Values for the 'type' field */
729#define V4L2_INPUT_TYPE_TUNER 1 660#define V4L2_INPUT_TYPE_TUNER 1
730#define V4L2_INPUT_TYPE_CAMERA 2 661#define V4L2_INPUT_TYPE_CAMERA 2
@@ -775,6 +706,34 @@ struct v4l2_control
775 __s32 value; 706 __s32 value;
776}; 707};
777 708
709struct v4l2_ext_control
710{
711 __u32 id;
712 __u32 reserved2[2];
713 union {
714 __s32 value;
715 __s64 value64;
716 void *reserved;
717 };
718};
719
720struct v4l2_ext_controls
721{
722 __u32 ctrl_class;
723 __u32 count;
724 __u32 error_idx;
725 __u32 reserved[2];
726 struct v4l2_ext_control *controls;
727};
728
729/* Values for ctrl_class field */
730#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
731#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
732
733#define V4L2_CTRL_ID_MASK (0x0fffffff)
734#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
735#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
736
778/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 737/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
779struct v4l2_queryctrl 738struct v4l2_queryctrl
780{ 739{
@@ -801,12 +760,21 @@ struct v4l2_querymenu
801/* Control flags */ 760/* Control flags */
802#define V4L2_CTRL_FLAG_DISABLED 0x0001 761#define V4L2_CTRL_FLAG_DISABLED 0x0001
803#define V4L2_CTRL_FLAG_GRABBED 0x0002 762#define V4L2_CTRL_FLAG_GRABBED 0x0002
763#define V4L2_CTRL_FLAG_READ_ONLY 0x0004
764#define V4L2_CTRL_FLAG_UPDATE 0x0008
765#define V4L2_CTRL_FLAG_INACTIVE 0x0010
766#define V4L2_CTRL_FLAG_SLIDER 0x0020
767
768/* Query flag, to be ORed with the control ID */
769#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
804 770
805/* Control IDs defined by V4L2 */ 771/* User-class control IDs defined by V4L2 */
806#define V4L2_CID_BASE 0x00980900 772#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
773#define V4L2_CID_USER_BASE V4L2_CID_BASE
807/* IDs reserved for driver specific controls */ 774/* IDs reserved for driver specific controls */
808#define V4L2_CID_PRIVATE_BASE 0x08000000 775#define V4L2_CID_PRIVATE_BASE 0x08000000
809 776
777#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
810#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) 778#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
811#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) 779#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
812#define V4L2_CID_SATURATION (V4L2_CID_BASE+2) 780#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
@@ -833,6 +801,183 @@ struct v4l2_querymenu
833#define V4L2_CID_VCENTER (V4L2_CID_BASE+23) 801#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
834#define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */ 802#define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */
835 803
804/* MPEG-class control IDs defined by V4L2 */
805#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
806#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
807
808/* MPEG streams */
809#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
810enum v4l2_mpeg_stream_type {
811 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
812 V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
813 V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
814 V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
815 V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
816 V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
817};
818#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
819#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
820#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
821#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
822#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
823#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
824
825/* MPEG audio */
826#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
827enum v4l2_mpeg_audio_sampling_freq {
828 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
829 V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
830 V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
831};
832#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
833enum v4l2_mpeg_audio_encoding {
834 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
835 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
836 V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
837};
838#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
839enum v4l2_mpeg_audio_l1_bitrate {
840 V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
841 V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
842 V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
843 V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
844 V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
845 V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
846 V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
847 V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
848 V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
849 V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
850 V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
851 V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
852 V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
853 V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
854};
855#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
856enum v4l2_mpeg_audio_l2_bitrate {
857 V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
858 V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
859 V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
860 V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
861 V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
862 V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
863 V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
864 V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
865 V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
866 V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
867 V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
868 V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
869 V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
870 V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
871};
872#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
873enum v4l2_mpeg_audio_l3_bitrate {
874 V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
875 V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
876 V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
877 V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
878 V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
879 V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
880 V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
881 V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
882 V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
883 V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
884 V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
885 V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
886 V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
887 V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
888};
889#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
890enum v4l2_mpeg_audio_mode {
891 V4L2_MPEG_AUDIO_MODE_STEREO = 0,
892 V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
893 V4L2_MPEG_AUDIO_MODE_DUAL = 2,
894 V4L2_MPEG_AUDIO_MODE_MONO = 3,
895};
896#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
897enum v4l2_mpeg_audio_mode_extension {
898 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
899 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
900 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
901 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
902};
903#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
904enum v4l2_mpeg_audio_emphasis {
905 V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
906 V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
907 V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
908};
909#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
910enum v4l2_mpeg_audio_crc {
911 V4L2_MPEG_AUDIO_CRC_NONE = 0,
912 V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
913};
914
915/* MPEG video */
916#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
917enum v4l2_mpeg_video_encoding {
918 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
919 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
920};
921#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
922enum v4l2_mpeg_video_aspect {
923 V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
924 V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
925 V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
926 V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
927};
928#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
929#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
930#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
931#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
932#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
933enum v4l2_mpeg_video_bitrate_mode {
934 V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
935 V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
936};
937#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
938#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
939#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
940
941/* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */
942#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
943#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
944enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
945 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
946 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
947};
948#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
949#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
950enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
951 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
952 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
953 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
954 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
955 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
956};
957#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
958enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
959 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
960 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
961};
962#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
963enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
964 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
965 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
966};
967#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
968#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
969enum v4l2_mpeg_cx2341x_video_median_filter_type {
970 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
971 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
972 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
973 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
974 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
975};
976#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
977#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
978#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
979#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
980
836/* 981/*
837 * T U N I N G 982 * T U N I N G
838 */ 983 */
@@ -904,6 +1049,7 @@ struct v4l2_audio
904 __u32 mode; 1049 __u32 mode;
905 __u32 reserved[2]; 1050 __u32 reserved[2];
906}; 1051};
1052
907/* Flags for the 'capability' field */ 1053/* Flags for the 'capability' field */
908#define V4L2_AUDCAP_STEREO 0x00001 1054#define V4L2_AUDCAP_STEREO 0x00001
909#define V4L2_AUDCAP_AVL 0x00002 1055#define V4L2_AUDCAP_AVL 0x00002
@@ -927,7 +1073,6 @@ struct v4l2_audioout
927 */ 1073 */
928 1074
929/* Raw VBI */ 1075/* Raw VBI */
930
931struct v4l2_vbi_format 1076struct v4l2_vbi_format
932{ 1077{
933 __u32 sampling_rate; /* in 1 Hz */ 1078 __u32 sampling_rate; /* in 1 Hz */
@@ -1034,8 +1179,6 @@ struct v4l2_streamparm
1034 } parm; 1179 } parm;
1035}; 1180};
1036 1181
1037
1038
1039/* 1182/*
1040 * I O C T L C O D E S F O R V I D E O D E V I C E S 1183 * I O C T L C O D E S F O R V I D E O D E V I C E S
1041 * 1184 *
@@ -1045,8 +1188,10 @@ struct v4l2_streamparm
1045#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) 1188#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
1046#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) 1189#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
1047#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) 1190#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
1191#ifdef __KERNEL__
1048#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) 1192#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression)
1049#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) 1193#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression)
1194#endif
1050#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) 1195#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
1051#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) 1196#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
1052#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) 1197#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
@@ -1096,7 +1241,11 @@ struct v4l2_streamparm
1096#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) 1241#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap)
1097#endif 1242#endif
1098#define VIDIOC_LOG_STATUS _IO ('V', 70) 1243#define VIDIOC_LOG_STATUS _IO ('V', 70)
1244#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
1245#define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls)
1246#define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls)
1099 1247
1248#ifdef __OLD_VIDIOC_
1100/* for compatibility, will go away some day */ 1249/* for compatibility, will go away some day */
1101#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) 1250#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)
1102#define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) 1251#define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm)
@@ -1104,57 +1253,10 @@ struct v4l2_streamparm
1104#define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) 1253#define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio)
1105#define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) 1254#define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout)
1106#define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) 1255#define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap)
1107
1108#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
1109
1110
1111#ifdef __KERNEL__
1112/*
1113 *
1114 * V 4 L 2 D R I V E R H E L P E R A P I
1115 *
1116 * Some commonly needed functions for drivers (v4l2-common.o module)
1117 */
1118#include <linux/fs.h>
1119
1120/* Video standard functions */
1121extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
1122extern int v4l2_video_std_construct(struct v4l2_standard *vs,
1123 int id, char *name);
1124
1125/* prority handling */
1126struct v4l2_prio_state {
1127 atomic_t prios[4];
1128};
1129int v4l2_prio_init(struct v4l2_prio_state *global);
1130int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
1131 enum v4l2_priority new);
1132int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
1133int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);
1134enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
1135int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
1136
1137/* names for fancy debug output */
1138extern char *v4l2_field_names[];
1139extern char *v4l2_type_names[];
1140
1141/* Compatibility layer interface -- v4l1-compat module */
1142typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
1143 unsigned int cmd, void *arg);
1144
1145#ifdef CONFIG_VIDEO_V4L1_COMPAT
1146int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
1147 int cmd, void *arg, v4l2_kioctl driver_ioctl);
1148#else
1149#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL
1150#endif 1256#endif
1151 1257
1152/* 32 Bits compatibility layer for 64 bits processors */ 1258#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
1153extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
1154 unsigned long arg);
1155
1156 1259
1157#endif /* __KERNEL__ */
1158#endif /* __LINUX_VIDEODEV2_H */ 1260#endif /* __LINUX_VIDEODEV2_H */
1159 1261
1160/* 1262/*
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h
new file mode 100644
index 000000000000..51fb06b4c394
--- /dev/null
+++ b/include/media/cx2341x.h
@@ -0,0 +1,189 @@
1/*
2 cx23415/6 header containing common defines.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef CX2341X_H
20#define CX2341X_H
21
22enum cx2341x_port {
23 CX2341X_PORT_MEMORY = 0,
24 CX2341X_PORT_STREAMING = 1,
25 CX2341X_PORT_SERIAL = 2
26};
27
28struct cx2341x_mpeg_params {
29 /* misc */
30 enum cx2341x_port port;
31 u16 width;
32 u16 height;
33 u16 is_50hz;
34
35 /* stream */
36 enum v4l2_mpeg_stream_type stream_type;
37
38 /* audio */
39 enum v4l2_mpeg_audio_sampling_freq audio_sampling_freq;
40 enum v4l2_mpeg_audio_encoding audio_encoding;
41 enum v4l2_mpeg_audio_l2_bitrate audio_l2_bitrate;
42 enum v4l2_mpeg_audio_mode audio_mode;
43 enum v4l2_mpeg_audio_mode_extension audio_mode_extension;
44 enum v4l2_mpeg_audio_emphasis audio_emphasis;
45 enum v4l2_mpeg_audio_crc audio_crc;
46 u8 audio_properties;
47
48 /* video */
49 enum v4l2_mpeg_video_encoding video_encoding;
50 enum v4l2_mpeg_video_aspect video_aspect;
51 u16 video_b_frames;
52 u16 video_gop_size;
53 u16 video_gop_closure;
54 u16 video_pulldown;
55 enum v4l2_mpeg_video_bitrate_mode video_bitrate_mode;
56 u32 video_bitrate;
57 u32 video_bitrate_peak;
58 u16 video_temporal_decimation;
59
60 /* encoding filters */
61 enum v4l2_mpeg_cx2341x_video_spatial_filter_mode video_spatial_filter_mode;
62 u16 video_spatial_filter;
63 enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type video_luma_spatial_filter_type;
64 enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type video_chroma_spatial_filter_type;
65 enum v4l2_mpeg_cx2341x_video_temporal_filter_mode video_temporal_filter_mode;
66 u16 video_temporal_filter;
67 enum v4l2_mpeg_cx2341x_video_median_filter_type video_median_filter_type;
68 u16 video_luma_median_filter_top;
69 u16 video_luma_median_filter_bottom;
70 u16 video_chroma_median_filter_top;
71 u16 video_chroma_median_filter_bottom;
72};
73
74#define CX2341X_MBOX_MAX_DATA 16
75
76extern const u32 cx2341x_mpeg_ctrls[];
77typedef int (*cx2341x_mbox_func)(void *priv, int cmd, int in, int out,
78 u32 data[CX2341X_MBOX_MAX_DATA]);
79int cx2341x_update(void *priv, cx2341x_mbox_func func,
80 const struct cx2341x_mpeg_params *old,
81 const struct cx2341x_mpeg_params *new);
82int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params,
83 struct v4l2_queryctrl *qctrl);
84const char **cx2341x_ctrl_get_menu(u32 id);
85int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params,
86 struct v4l2_ext_controls *ctrls, int cmd);
87void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p);
88void cx2341x_log_status(struct cx2341x_mpeg_params *p, int cardid);
89
90/* Firmware names */
91#define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw"
92/* Decoder firmware for the cx23415 only */
93#define CX2341X_FIRM_DEC_FILENAME "v4l-cx2341x-dec.fw"
94
95/* Firmware API commands */
96
97/* MPEG decoder API, specific to the cx23415 */
98#define CX2341X_DEC_PING_FW 0x00
99#define CX2341X_DEC_START_PLAYBACK 0x01
100#define CX2341X_DEC_STOP_PLAYBACK 0x02
101#define CX2341X_DEC_SET_PLAYBACK_SPEED 0x03
102#define CX2341X_DEC_STEP_VIDEO 0x05
103#define CX2341X_DEC_SET_DMA_BLOCK_SIZE 0x08
104#define CX2341X_DEC_GET_XFER_INFO 0x09
105#define CX2341X_DEC_GET_DMA_STATUS 0x0a
106#define CX2341X_DEC_SCHED_DMA_FROM_HOST 0x0b
107#define CX2341X_DEC_PAUSE_PLAYBACK 0x0d
108#define CX2341X_DEC_HALT_FW 0x0e
109#define CX2341X_DEC_SET_STANDARD 0x10
110#define CX2341X_DEC_GET_VERSION 0x11
111#define CX2341X_DEC_SET_STREAM_INPUT 0x14
112#define CX2341X_DEC_GET_TIMING_INFO 0x15
113#define CX2341X_DEC_SET_AUDIO_MODE 0x16
114#define CX2341X_DEC_SET_EVENT_NOTIFICATION 0x17
115#define CX2341X_DEC_SET_DISPLAY_BUFFERS 0x18
116#define CX2341X_DEC_EXTRACT_VBI 0x19
117#define CX2341X_DEC_SET_DECODER_SOURCE 0x1a
118#define CX2341X_DEC_SET_AUDIO_OUTPUT 0x1b
119#define CX2341X_DEC_SET_AV_DELAY 0x1c
120#define CX2341X_DEC_SET_PREBUFFERING 0x1e
121
122/* MPEG encoder API */
123#define CX2341X_ENC_PING_FW 0x80
124#define CX2341X_ENC_START_CAPTURE 0x81
125#define CX2341X_ENC_STOP_CAPTURE 0x82
126#define CX2341X_ENC_SET_AUDIO_ID 0x89
127#define CX2341X_ENC_SET_VIDEO_ID 0x8b
128#define CX2341X_ENC_SET_PCR_ID 0x8d
129#define CX2341X_ENC_SET_FRAME_RATE 0x8f
130#define CX2341X_ENC_SET_FRAME_SIZE 0x91
131#define CX2341X_ENC_SET_BIT_RATE 0x95
132#define CX2341X_ENC_SET_GOP_PROPERTIES 0x97
133#define CX2341X_ENC_SET_ASPECT_RATIO 0x99
134#define CX2341X_ENC_SET_DNR_FILTER_MODE 0x9b
135#define CX2341X_ENC_SET_DNR_FILTER_PROPS 0x9d
136#define CX2341X_ENC_SET_CORING_LEVELS 0x9f
137#define CX2341X_ENC_SET_SPATIAL_FILTER_TYPE 0xa1
138#define CX2341X_ENC_SET_3_2_PULLDOWN 0xb1
139#define CX2341X_ENC_SET_VBI_LINE 0xb7
140#define CX2341X_ENC_SET_STREAM_TYPE 0xb9
141#define CX2341X_ENC_SET_OUTPUT_PORT 0xbb
142#define CX2341X_ENC_SET_AUDIO_PROPERTIES 0xbd
143#define CX2341X_ENC_HALT_FW 0xc3
144#define CX2341X_ENC_GET_VERSION 0xc4
145#define CX2341X_ENC_SET_GOP_CLOSURE 0xc5
146#define CX2341X_ENC_GET_SEQ_END 0xc6
147#define CX2341X_ENC_SET_PGM_INDEX_INFO 0xc7
148#define CX2341X_ENC_SET_VBI_CONFIG 0xc8
149#define CX2341X_ENC_SET_DMA_BLOCK_SIZE 0xc9
150#define CX2341X_ENC_GET_PREV_DMA_INFO_MB_10 0xca
151#define CX2341X_ENC_GET_PREV_DMA_INFO_MB_9 0xcb
152#define CX2341X_ENC_SCHED_DMA_TO_HOST 0xcc
153#define CX2341X_ENC_INITIALIZE_INPUT 0xcd
154#define CX2341X_ENC_SET_FRAME_DROP_RATE 0xd0
155#define CX2341X_ENC_PAUSE_ENCODER 0xd2
156#define CX2341X_ENC_REFRESH_INPUT 0xd3
157#define CX2341X_ENC_SET_COPYRIGHT 0xd4
158#define CX2341X_ENC_SET_EVENT_NOTIFICATION 0xd5
159#define CX2341X_ENC_SET_NUM_VSYNC_LINES 0xd6
160#define CX2341X_ENC_SET_PLACEHOLDER 0xd7
161#define CX2341X_ENC_MUTE_VIDEO 0xd9
162#define CX2341X_ENC_MUTE_AUDIO 0xda
163#define CX2341X_ENC_UNKNOWN 0xdb
164#define CX2341X_ENC_MISC 0xdc
165
166/* OSD API, specific to the cx23415 */
167#define CX2341X_OSD_GET_FRAMEBUFFER 0x41
168#define CX2341X_OSD_GET_PIXEL_FORMAT 0x42
169#define CX2341X_OSD_SET_PIXEL_FORMAT 0x43
170#define CX2341X_OSD_GET_STATE 0x44
171#define CX2341X_OSD_SET_STATE 0x45
172#define CX2341X_OSD_GET_OSD_COORDS 0x46
173#define CX2341X_OSD_SET_OSD_COORDS 0x47
174#define CX2341X_OSD_GET_SCREEN_COORDS 0x48
175#define CX2341X_OSD_SET_SCREEN_COORDS 0x49
176#define CX2341X_OSD_GET_GLOBAL_ALPHA 0x4a
177#define CX2341X_OSD_SET_GLOBAL_ALPHA 0x4b
178#define CX2341X_OSD_SET_BLEND_COORDS 0x4c
179#define CX2341X_OSD_GET_FLICKER_STATE 0x4f
180#define CX2341X_OSD_SET_FLICKER_STATE 0x50
181#define CX2341X_OSD_BLT_COPY 0x52
182#define CX2341X_OSD_BLT_FILL 0x53
183#define CX2341X_OSD_BLT_TEXT 0x54
184#define CX2341X_OSD_SET_FRAMEBUFFER_WINDOW 0x56
185#define CX2341X_OSD_SET_CHROMA_KEY 0x60
186#define CX2341X_OSD_GET_ALPHA_CONTENT_INDEX 0x61
187#define CX2341X_OSD_SET_ALPHA_CONTENT_INDEX 0x62
188
189#endif /* CX2341X_H */
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 302d5b3946e7..7bab09b0ed45 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -73,7 +73,7 @@ extern IR_KEYTAB_TYPE ir_codes_cinergy_1400[IR_KEYTAB_SIZE];
73extern IR_KEYTAB_TYPE ir_codes_avertv_303[IR_KEYTAB_SIZE]; 73extern IR_KEYTAB_TYPE ir_codes_avertv_303[IR_KEYTAB_SIZE];
74extern IR_KEYTAB_TYPE ir_codes_dntv_live_dvbt_pro[IR_KEYTAB_SIZE]; 74extern IR_KEYTAB_TYPE ir_codes_dntv_live_dvbt_pro[IR_KEYTAB_SIZE];
75extern IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE]; 75extern IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE];
76extern IR_KEYTAB_TYPE ir_codes_em_pinnacle_usb[IR_KEYTAB_SIZE]; 76extern IR_KEYTAB_TYPE ir_codes_pinnacle_grey[IR_KEYTAB_SIZE];
77extern IR_KEYTAB_TYPE ir_codes_flyvideo[IR_KEYTAB_SIZE]; 77extern IR_KEYTAB_TYPE ir_codes_flyvideo[IR_KEYTAB_SIZE];
78extern IR_KEYTAB_TYPE ir_codes_flydvb[IR_KEYTAB_SIZE]; 78extern IR_KEYTAB_TYPE ir_codes_flydvb[IR_KEYTAB_SIZE];
79extern IR_KEYTAB_TYPE ir_codes_cinergy[IR_KEYTAB_SIZE]; 79extern IR_KEYTAB_TYPE ir_codes_cinergy[IR_KEYTAB_SIZE];
@@ -87,8 +87,9 @@ extern IR_KEYTAB_TYPE ir_codes_pctv_sedna[IR_KEYTAB_SIZE];
87extern IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE]; 87extern IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE];
88extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE]; 88extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE];
89extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE]; 89extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE];
90extern IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE]; 90extern IR_KEYTAB_TYPE ir_codes_pinnacle_color[IR_KEYTAB_SIZE];
91extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; 91extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE];
92extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE];
92 93
93#endif 94#endif
94 95
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index 730f21ed91db..a455f7ce5ee8 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -20,5 +20,6 @@ struct IR_i2c {
20 int (*get_key)(struct IR_i2c*, u32*, u32*); 20 int (*get_key)(struct IR_i2c*, u32*, u32*);
21}; 21};
22 22
23int get_key_pinnacle(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw); 23int get_key_pinnacle_grey(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
24int get_key_pinnacle_color(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
24#endif 25#endif
diff --git a/include/media/ovcamchip.h b/include/media/ovcamchip.h
index 8138983adced..0f43451f8bb3 100644
--- a/include/media/ovcamchip.h
+++ b/include/media/ovcamchip.h
@@ -15,6 +15,7 @@
15#define __LINUX_OVCAMCHIP_H 15#define __LINUX_OVCAMCHIP_H
16 16
17#include <linux/videodev.h> 17#include <linux/videodev.h>
18#include <media/v4l2-common.h>
18#include <linux/i2c.h> 19#include <linux/i2c.h>
19 20
20/* --------------------------------- */ 21/* --------------------------------- */
diff --git a/include/media/pwc-ioctl.h b/include/media/pwc-ioctl.h
new file mode 100644
index 000000000000..adc1254e887e
--- /dev/null
+++ b/include/media/pwc-ioctl.h
@@ -0,0 +1,325 @@
1#ifndef PWC_IOCTL_H
2#define PWC_IOCTL_H
3
4/* (C) 2001-2004 Nemosoft Unv.
5 (C) 2004-2006 Luc Saillard (luc@saillard.org)
6
7 NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
8 driver and thus may have bugs that are not present in the original version.
9 Please send bug reports and support requests to <luc@saillard.org>.
10 The decompression routines have been implemented by reverse-engineering the
11 Nemosoft binary pwcx module. Caveat emptor.
12
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26*/
27
28/* This is pwc-ioctl.h belonging to PWC 10.0.10
29 It contains structures and defines to communicate from user space
30 directly to the driver.
31 */
32
33/*
34 Changes
35 2001/08/03 Alvarado Added ioctl constants to access methods for
36 changing white balance and red/blue gains
37 2002/12/15 G. H. Fernandez-Toribio VIDIOCGREALSIZE
38 2003/12/13 Nemosft Unv. Some modifications to make interfacing to
39 PWCX easier
40 2006/01/01 Luc Saillard Add raw format definition
41 */
42
43/* These are private ioctl() commands, specific for the Philips webcams.
44 They contain functions not found in other webcams, and settings not
45 specified in the Video4Linux API.
46
47 The #define names are built up like follows:
48 VIDIOC VIDeo IOCtl prefix
49 PWC Philps WebCam
50 G optional: Get
51 S optional: Set
52 ... the function
53 */
54
55#include <linux/types.h>
56#include <linux/version.h>
57
58
59 /* Enumeration of image sizes */
60#define PSZ_SQCIF 0x00
61#define PSZ_QSIF 0x01
62#define PSZ_QCIF 0x02
63#define PSZ_SIF 0x03
64#define PSZ_CIF 0x04
65#define PSZ_VGA 0x05
66#define PSZ_MAX 6
67
68
69/* The frame rate is encoded in the video_window.flags parameter using
70 the upper 16 bits, since some flags are defined nowadays. The following
71 defines provide a mask and shift to filter out this value.
72 This value can also be passing using the private flag when using v4l2 and
73 VIDIOC_S_FMT ioctl.
74
75 In 'Snapshot' mode the camera freezes its automatic exposure and colour
76 balance controls.
77 */
78#define PWC_FPS_SHIFT 16
79#define PWC_FPS_MASK 0x00FF0000
80#define PWC_FPS_FRMASK 0x003F0000
81#define PWC_FPS_SNAPSHOT 0x00400000
82#define PWC_QLT_MASK 0x03000000
83#define PWC_QLT_SHIFT 24
84
85
86/* structure for transferring x & y coordinates */
87struct pwc_coord
88{
89 int x, y; /* guess what */
90 int size; /* size, or offset */
91};
92
93
94/* Used with VIDIOCPWCPROBE */
95struct pwc_probe
96{
97 char name[32];
98 int type;
99};
100
101struct pwc_serial
102{
103 char serial[30]; /* String with serial number. Contains terminating 0 */
104};
105
106/* pwc_whitebalance.mode values */
107#define PWC_WB_INDOOR 0
108#define PWC_WB_OUTDOOR 1
109#define PWC_WB_FL 2
110#define PWC_WB_MANUAL 3
111#define PWC_WB_AUTO 4
112
113/* Used with VIDIOCPWC[SG]AWB (Auto White Balance).
114 Set mode to one of the PWC_WB_* values above.
115 *red and *blue are the respective gains of these colour components inside
116 the camera; range 0..65535
117 When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read;
118 otherwise undefined.
119 'read_red' and 'read_blue' are read-only.
120*/
121struct pwc_whitebalance
122{
123 int mode;
124 int manual_red, manual_blue; /* R/W */
125 int read_red, read_blue; /* R/O */
126};
127
128/*
129 'control_speed' and 'control_delay' are used in automatic whitebalance mode,
130 and tell the camera how fast it should react to changes in lighting, and
131 with how much delay. Valid values are 0..65535.
132*/
133struct pwc_wb_speed
134{
135 int control_speed;
136 int control_delay;
137
138};
139
140/* Used with VIDIOCPWC[SG]LED */
141struct pwc_leds
142{
143 int led_on; /* Led on-time; range = 0..25000 */
144 int led_off; /* Led off-time; range = 0..25000 */
145};
146
147/* Image size (used with GREALSIZE) */
148struct pwc_imagesize
149{
150 int width;
151 int height;
152};
153
154/* Defines and structures for Motorized Pan & Tilt */
155#define PWC_MPT_PAN 0x01
156#define PWC_MPT_TILT 0x02
157#define PWC_MPT_TIMEOUT 0x04 /* for status */
158
159/* Set angles; when absolute != 0, the angle is absolute and the
160 driver calculates the relative offset for you. This can only
161 be used with VIDIOCPWCSANGLE; VIDIOCPWCGANGLE always returns
162 absolute angles.
163 */
164struct pwc_mpt_angles
165{
166 int absolute; /* write-only */
167 int pan; /* degrees * 100 */
168 int tilt; /* degress * 100 */
169};
170
171/* Range of angles of the camera, both horizontally and vertically.
172 */
173struct pwc_mpt_range
174{
175 int pan_min, pan_max; /* degrees * 100 */
176 int tilt_min, tilt_max;
177};
178
179struct pwc_mpt_status
180{
181 int status;
182 int time_pan;
183 int time_tilt;
184};
185
186
187/* This is used for out-of-kernel decompression. With it, you can get
188 all the necessary information to initialize and use the decompressor
189 routines in standalone applications.
190 */
191struct pwc_video_command
192{
193 int type; /* camera type (645, 675, 730, etc.) */
194 int release; /* release number */
195
196 int size; /* one of PSZ_* */
197 int alternate;
198 int command_len; /* length of USB video command */
199 unsigned char command_buf[13]; /* Actual USB video command */
200 int bandlength; /* >0 = compressed */
201 int frame_size; /* Size of one (un)compressed frame */
202};
203
204/* Flags for PWCX subroutines. Not all modules honour all flags. */
205#define PWCX_FLAG_PLANAR 0x0001
206#define PWCX_FLAG_BAYER 0x0008
207
208
209/* IOCTL definitions */
210
211 /* Restore user settings */
212#define VIDIOCPWCRUSER _IO('v', 192)
213 /* Save user settings */
214#define VIDIOCPWCSUSER _IO('v', 193)
215 /* Restore factory settings */
216#define VIDIOCPWCFACTORY _IO('v', 194)
217
218 /* You can manipulate the compression factor. A compression preference of 0
219 means use uncompressed modes when available; 1 is low compression, 2 is
220 medium and 3 is high compression preferred. Of course, the higher the
221 compression, the lower the bandwidth used but more chance of artefacts
222 in the image. The driver automatically chooses a higher compression when
223 the preferred mode is not available.
224 */
225 /* Set preferred compression quality (0 = uncompressed, 3 = highest compression) */
226#define VIDIOCPWCSCQUAL _IOW('v', 195, int)
227 /* Get preferred compression quality */
228#define VIDIOCPWCGCQUAL _IOR('v', 195, int)
229
230
231/* Retrieve serial number of camera */
232#define VIDIOCPWCGSERIAL _IOR('v', 198, struct pwc_serial)
233
234 /* This is a probe function; since so many devices are supported, it
235 becomes difficult to include all the names in programs that want to
236 check for the enhanced Philips stuff. So in stead, try this PROBE;
237 it returns a structure with the original name, and the corresponding
238 Philips type.
239 To use, fill the structure with zeroes, call PROBE and if that succeeds,
240 compare the name with that returned from VIDIOCGCAP; they should be the
241 same. If so, you can be assured it is a Philips (OEM) cam and the type
242 is valid.
243 */
244#define VIDIOCPWCPROBE _IOR('v', 199, struct pwc_probe)
245
246 /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */
247#define VIDIOCPWCSAGC _IOW('v', 200, int)
248 /* Get AGC; int < 0 = auto; >= 0 = fixed, range 0..65535 */
249#define VIDIOCPWCGAGC _IOR('v', 200, int)
250 /* Set shutter speed; int < 0 = auto; >= 0 = fixed, range 0..65535 */
251#define VIDIOCPWCSSHUTTER _IOW('v', 201, int)
252
253 /* Color compensation (Auto White Balance) */
254#define VIDIOCPWCSAWB _IOW('v', 202, struct pwc_whitebalance)
255#define VIDIOCPWCGAWB _IOR('v', 202, struct pwc_whitebalance)
256
257 /* Auto WB speed */
258#define VIDIOCPWCSAWBSPEED _IOW('v', 203, struct pwc_wb_speed)
259#define VIDIOCPWCGAWBSPEED _IOR('v', 203, struct pwc_wb_speed)
260
261 /* LEDs on/off/blink; int range 0..65535 */
262#define VIDIOCPWCSLED _IOW('v', 205, struct pwc_leds)
263#define VIDIOCPWCGLED _IOR('v', 205, struct pwc_leds)
264
265 /* Contour (sharpness); int < 0 = auto, 0..65536 = fixed */
266#define VIDIOCPWCSCONTOUR _IOW('v', 206, int)
267#define VIDIOCPWCGCONTOUR _IOR('v', 206, int)
268
269 /* Backlight compensation; 0 = off, otherwise on */
270#define VIDIOCPWCSBACKLIGHT _IOW('v', 207, int)
271#define VIDIOCPWCGBACKLIGHT _IOR('v', 207, int)
272
273 /* Flickerless mode; = 0 off, otherwise on */
274#define VIDIOCPWCSFLICKER _IOW('v', 208, int)
275#define VIDIOCPWCGFLICKER _IOR('v', 208, int)
276
277 /* Dynamic noise reduction; 0 off, 3 = high noise reduction */
278#define VIDIOCPWCSDYNNOISE _IOW('v', 209, int)
279#define VIDIOCPWCGDYNNOISE _IOR('v', 209, int)
280
281 /* Real image size as used by the camera; tells you whether or not there's a gray border around the image */
282#define VIDIOCPWCGREALSIZE _IOR('v', 210, struct pwc_imagesize)
283
284 /* Motorized pan & tilt functions */
285#define VIDIOCPWCMPTRESET _IOW('v', 211, int)
286#define VIDIOCPWCMPTGRANGE _IOR('v', 211, struct pwc_mpt_range)
287#define VIDIOCPWCMPTSANGLE _IOW('v', 212, struct pwc_mpt_angles)
288#define VIDIOCPWCMPTGANGLE _IOR('v', 212, struct pwc_mpt_angles)
289#define VIDIOCPWCMPTSTATUS _IOR('v', 213, struct pwc_mpt_status)
290
291 /* Get the USB set-video command; needed for initializing libpwcx */
292#define VIDIOCPWCGVIDCMD _IOR('v', 215, struct pwc_video_command)
293struct pwc_table_init_buffer {
294 int len;
295 char *buffer;
296
297};
298#define VIDIOCPWCGVIDTABLE _IOR('v', 216, struct pwc_table_init_buffer)
299
300/*
301 * This is private command used when communicating with v4l2.
302 * In the future all private ioctl will be remove/replace to
303 * use interface offer by v4l2.
304 */
305
306#define V4L2_CID_PRIVATE_SAVE_USER (V4L2_CID_PRIVATE_BASE + 0)
307#define V4L2_CID_PRIVATE_RESTORE_USER (V4L2_CID_PRIVATE_BASE + 1)
308#define V4L2_CID_PRIVATE_RESTORE_FACTORY (V4L2_CID_PRIVATE_BASE + 2)
309#define V4L2_CID_PRIVATE_COLOUR_MODE (V4L2_CID_PRIVATE_BASE + 3)
310#define V4L2_CID_PRIVATE_AUTOCONTOUR (V4L2_CID_PRIVATE_BASE + 4)
311#define V4L2_CID_PRIVATE_CONTOUR (V4L2_CID_PRIVATE_BASE + 5)
312#define V4L2_CID_PRIVATE_BACKLIGHT (V4L2_CID_PRIVATE_BASE + 6)
313#define V4L2_CID_PRIVATE_FLICKERLESS (V4L2_CID_PRIVATE_BASE + 7)
314#define V4L2_CID_PRIVATE_NOISE_REDUCTION (V4L2_CID_PRIVATE_BASE + 8)
315
316struct pwc_raw_frame {
317 __le16 type; /* type of the webcam */
318 __le16 vbandlength; /* Size of 4lines compressed (used by the decompressor) */
319 __u8 cmd[4]; /* the four byte of the command (in case of nala,
320 only the first 3 bytes is filled) */
321 __u8 rawframe[0]; /* frame_size = H/4*vbandlength */
322} __attribute__ ((packed));
323
324
325#endif
diff --git a/include/media/saa7115.h b/include/media/saa7115.h
index 6b4836f3f057..9f0e2285a099 100644
--- a/include/media/saa7115.h
+++ b/include/media/saa7115.h
@@ -1,5 +1,5 @@
1/* 1/*
2 saa7115.h - definition for saa7113/4/5 inputs 2 saa7115.h - definition for saa7113/4/5 inputs and frequency flags
3 3
4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) 4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
5 5
@@ -33,5 +33,14 @@
33#define SAA7115_SVIDEO2 8 33#define SAA7115_SVIDEO2 8
34#define SAA7115_SVIDEO3 9 34#define SAA7115_SVIDEO3 9
35 35
36/* SAA7115 v4l2_crystal_freq frequency values */
37#define SAA7115_FREQ_32_11_MHZ 32110000 /* 32.11 MHz crystal, SAA7114/5 only */
38#define SAA7115_FREQ_24_576_MHZ 24576000 /* 24.576 MHz crystal */
39
40/* SAA7115 v4l2_crystal_freq audio clock control flags */
41#define SAA7115_FREQ_FL_UCGC (1 << 0) /* SA 3A[7], UCGC, SAA7115 only */
42#define SAA7115_FREQ_FL_CGCDIV (1 << 1) /* SA 3A[6], CGCDIV, SAA7115 only */
43#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */
44
36#endif 45#endif
37 46
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
index 4507cb61ae93..83fe2e3d1e25 100644
--- a/include/media/saa7146_vv.h
+++ b/include/media/saa7146_vv.h
@@ -2,7 +2,7 @@
2#define __SAA7146_VV__ 2#define __SAA7146_VV__
3 3
4#include <linux/videodev.h> 4#include <linux/videodev.h>
5 5#include <media/v4l2-common.h>
6#include <media/saa7146.h> 6#include <media/saa7146.h>
7#include <media/video-buf.h> 7#include <media/video-buf.h>
8 8
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 017fed7d5e4d..2f7b00b08e88 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -25,6 +25,8 @@
25#include <linux/videodev2.h> 25#include <linux/videodev2.h>
26#include <media/tuner-types.h> 26#include <media/tuner-types.h>
27 27
28extern int tuner_debug;
29
28#define ADDR_UNSET (255) 30#define ADDR_UNSET (255)
29 31
30#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */ 32#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */
@@ -108,7 +110,7 @@
108#define TUNER_TEA5767 62 /* Only FM Radio Tuner */ 110#define TUNER_TEA5767 62 /* Only FM Radio Tuner */
109#define TUNER_PHILIPS_FMD1216ME_MK3 63 111#define TUNER_PHILIPS_FMD1216ME_MK3 63
110 112
111#define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ 113#define TUNER_LG_TDVS_H06XF 64 /* TDVS H061F, H062F, H064F */
112#define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ 114#define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */
113#define TUNER_LG_TALN 66 115#define TUNER_LG_TALN 66
114#define TUNER_PHILIPS_TD1316 67 116#define TUNER_PHILIPS_TD1316 67
@@ -119,6 +121,8 @@
119#define TUNER_XCEIVE_XC3028 71 121#define TUNER_XCEIVE_XC3028 71
120 122
121#define TUNER_THOMSON_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */ 123#define TUNER_THOMSON_FE6600 72 /* DViCO FusionHDTV DVB-T Hybrid */
124#define TUNER_SAMSUNG_TCPG_6121P30A 73 /* Hauppauge PVR-500 PAL */
125#define TUNER_TDA9887 74 /* This tuner should be used only internally */
122 126
123/* tv card specific */ 127/* tv card specific */
124#define TDA9887_PRESENT (1<<0) 128#define TDA9887_PRESENT (1<<0)
@@ -190,6 +194,10 @@ struct tuner {
190 194
191 int using_v4l2; 195 int using_v4l2;
192 196
197 /* used by tda9887 */
198 unsigned int tda9887_config;
199 unsigned char tda9887_data[4];
200
193 /* used by MT2032 */ 201 /* used by MT2032 */
194 unsigned int xogc; 202 unsigned int xogc;
195 unsigned int radio_if2; 203 unsigned int radio_if2;
@@ -206,6 +214,8 @@ struct tuner {
206 void (*set_radio_freq)(struct i2c_client *c, unsigned int freq); 214 void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
207 int (*has_signal)(struct i2c_client *c); 215 int (*has_signal)(struct i2c_client *c);
208 int (*is_stereo)(struct i2c_client *c); 216 int (*is_stereo)(struct i2c_client *c);
217 int (*get_afc)(struct i2c_client *c);
218 void (*tuner_status)(struct i2c_client *c);
209 void (*standby)(struct i2c_client *c); 219 void (*standby)(struct i2c_client *c);
210}; 220};
211 221
@@ -218,6 +228,7 @@ extern int tda8290_probe(struct i2c_client *c);
218extern int tea5767_tuner_init(struct i2c_client *c); 228extern int tea5767_tuner_init(struct i2c_client *c);
219extern int default_tuner_init(struct i2c_client *c); 229extern int default_tuner_init(struct i2c_client *c);
220extern int tea5767_autodetection(struct i2c_client *c); 230extern int tea5767_autodetection(struct i2c_client *c);
231extern int tda9887_tuner_init(struct i2c_client *c);
221 232
222#define tuner_warn(fmt, arg...) do {\ 233#define tuner_warn(fmt, arg...) do {\
223 printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ 234 printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
diff --git a/include/media/tvp5150.h b/include/media/tvp5150.h
new file mode 100644
index 000000000000..72bd2a2b8bfd
--- /dev/null
+++ b/include/media/tvp5150.h
@@ -0,0 +1,34 @@
1/*
2 tvp5150.h - definition for tvp5150 inputs
3
4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#ifndef _TVP5150_H_
22#define _TVP5150_H_
23
24/* TVP5150 HW inputs */
25#define TVP5150_COMPOSITE0 0
26#define TVP5150_COMPOSITE1 1
27#define TVP5150_SVIDEO 2
28
29/* TVP5150 HW outputs */
30#define TVP5150_NORMAL 0
31#define TVP5150_BLACK_SCREEN 1
32
33#endif
34
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 642520acdfa7..5564db13c0d5 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -26,8 +26,14 @@
26#ifndef V4L2_COMMON_H_ 26#ifndef V4L2_COMMON_H_
27#define V4L2_COMMON_H_ 27#define V4L2_COMMON_H_
28 28
29#include <media/v4l2-dev.h>
30
29/* v4l debugging and diagnostics */ 31/* v4l debugging and diagnostics */
30 32
33/* Debug bitmask flags to be used on V4L2 */
34#define V4L2_DEBUG_IOCTL 0x01
35#define V4L2_DEBUG_IOCTL_ARG 0x02
36
31/* Common printk constucts for v4l-i2c drivers. These macros create a unique 37/* Common printk constucts for v4l-i2c drivers. These macros create a unique
32 prefix consisting of the driver name, the adapter number and the i2c 38 prefix consisting of the driver name, the adapter number and the i2c
33 address. */ 39 address. */
@@ -78,6 +84,19 @@ extern void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg);
78 84
79/* ------------------------------------------------------------------------- */ 85/* ------------------------------------------------------------------------- */
80 86
87/* Control helper functions */
88
89int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl,
90 const char **menu_items);
91const char **v4l2_ctrl_get_menu(u32 id);
92int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def);
93int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl);
94int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu,
95 struct v4l2_queryctrl *qctrl, const char **menu_items);
96u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id);
97
98/* ------------------------------------------------------------------------- */
99
81/* Internal ioctls */ 100/* Internal ioctls */
82 101
83/* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ 102/* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */
@@ -112,6 +131,8 @@ enum v4l2_chip_ident {
112 V4L2_IDENT_SAA7129 = 159, 131 V4L2_IDENT_SAA7129 = 159,
113 132
114 /* module cx25840: reserved range 200-249 */ 133 /* module cx25840: reserved range 200-249 */
134 V4L2_IDENT_CX25836 = 236,
135 V4L2_IDENT_CX25837 = 237,
115 V4L2_IDENT_CX25840 = 240, 136 V4L2_IDENT_CX25840 = 240,
116 V4L2_IDENT_CX25841 = 241, 137 V4L2_IDENT_CX25841 = 241,
117 V4L2_IDENT_CX25842 = 242, 138 V4L2_IDENT_CX25842 = 242,
@@ -211,4 +232,15 @@ struct v4l2_routing {
211#define VIDIOC_INT_S_VIDEO_ROUTING _IOW ('d', 111, struct v4l2_routing) 232#define VIDIOC_INT_S_VIDEO_ROUTING _IOW ('d', 111, struct v4l2_routing)
212#define VIDIOC_INT_G_VIDEO_ROUTING _IOR ('d', 112, struct v4l2_routing) 233#define VIDIOC_INT_G_VIDEO_ROUTING _IOR ('d', 112, struct v4l2_routing)
213 234
235struct v4l2_crystal_freq {
236 u32 freq; /* frequency in Hz of the crystal */
237 u32 flags; /* device specific flags */
238};
239
240/* Sets the frequency of the crystal used to generate the clocks.
241 An extra flags field allows device specific configuration regarding
242 clock frequency dividers, etc. If not used, then set flags to 0.
243 If the frequency is not supported, then -EINVAL is returned. */
244#define VIDIOC_INT_S_CRYSTAL_FREQ _IOW ('d', 113, struct v4l2_crystal_freq)
245
214#endif /* V4L2_COMMON_H_ */ 246#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
new file mode 100644
index 000000000000..a1b473190e65
--- /dev/null
+++ b/include/media/v4l2-dev.h
@@ -0,0 +1,375 @@
1/*
2 *
3 * V 4 L 2 D R I V E R H E L P E R A P I
4 *
5 * Moved from videodev2.h
6 *
7 * Some commonly needed functions for drivers (v4l2-common.o module)
8 */
9#ifndef _V4L2_DEV_H
10#define _V4L2_DEV_H
11
12#define OBSOLETE_OWNER 1 /* to be removed soon */
13
14#include <linux/poll.h>
15#include <linux/fs.h>
16#include <linux/device.h>
17#include <linux/mutex.h>
18#include <linux/compiler.h> /* need __user */
19#ifdef CONFIG_VIDEO_V4L1
20#include <linux/videodev.h>
21#else
22#include <linux/videodev2.h>
23#endif
24
25#include <linux/fs.h>
26
27#define VIDEO_MAJOR 81
28/* Minor device allocation */
29#define MINOR_VFL_TYPE_GRABBER_MIN 0
30#define MINOR_VFL_TYPE_GRABBER_MAX 63
31#define MINOR_VFL_TYPE_RADIO_MIN 64
32#define MINOR_VFL_TYPE_RADIO_MAX 127
33#define MINOR_VFL_TYPE_VTX_MIN 192
34#define MINOR_VFL_TYPE_VTX_MAX 223
35#define MINOR_VFL_TYPE_VBI_MIN 224
36#define MINOR_VFL_TYPE_VBI_MAX 255
37
38#define VFL_TYPE_GRABBER 0
39#define VFL_TYPE_VBI 1
40#define VFL_TYPE_RADIO 2
41#define VFL_TYPE_VTX 3
42
43/* Video standard functions */
44extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
45extern int v4l2_video_std_construct(struct v4l2_standard *vs,
46 int id, char *name);
47
48/* prority handling */
49struct v4l2_prio_state {
50 atomic_t prios[4];
51};
52int v4l2_prio_init(struct v4l2_prio_state *global);
53int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
54 enum v4l2_priority new);
55int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
56int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);
57enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
58int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
59
60/* names for fancy debug output */
61extern char *v4l2_field_names[];
62extern char *v4l2_type_names[];
63
64/* Compatibility layer interface -- v4l1-compat module */
65typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
66 unsigned int cmd, void *arg);
67#ifdef CONFIG_VIDEO_V4L1_COMPAT
68int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
69 int cmd, void *arg, v4l2_kioctl driver_ioctl);
70#else
71#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL
72#endif
73
74/* 32 Bits compatibility layer for 64 bits processors */
75extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
76 unsigned long arg);
77
78/*
79 * Newer version of video_device, handled by videodev2.c
80 * This version moves redundant code from video device code to
81 * the common handler
82 */
83struct v4l2_tvnorm {
84 char *name;
85 v4l2_std_id id;
86
87 void *priv_data;
88};
89
90struct video_device
91{
92 /* device ops */
93 const struct file_operations *fops;
94
95 /* device info */
96 struct device *dev;
97 char name[32];
98 int type; /* v4l1 */
99 int type2; /* v4l2 */
100 int hardware;
101 int minor;
102
103 int debug; /* Activates debug level*/
104
105 /* Video standard vars */
106 int tvnormsize; /* Size of tvnorm array */
107 v4l2_std_id current_norm; /* Current tvnorm */
108 struct v4l2_tvnorm *tvnorms;
109
110 /* callbacks */
111 void (*release)(struct video_device *vfd);
112
113 /* ioctl callbacks */
114
115 /* VIDIOC_QUERYCAP handler */
116 int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap);
117
118 /* Priority handling */
119 int (*vidioc_g_priority) (struct file *file, void *fh,
120 enum v4l2_priority *p);
121 int (*vidioc_s_priority) (struct file *file, void *fh,
122 enum v4l2_priority p);
123
124 /* VIDIOC_ENUM_FMT handlers */
125 int (*vidioc_enum_fmt_cap) (struct file *file, void *fh,
126 struct v4l2_fmtdesc *f);
127 int (*vidioc_enum_fmt_overlay) (struct file *file, void *fh,
128 struct v4l2_fmtdesc *f);
129 int (*vidioc_enum_fmt_vbi) (struct file *file, void *fh,
130 struct v4l2_fmtdesc *f);
131 int (*vidioc_enum_fmt_vbi_capture) (struct file *file, void *fh,
132 struct v4l2_fmtdesc *f);
133 int (*vidioc_enum_fmt_video_output)(struct file *file, void *fh,
134 struct v4l2_fmtdesc *f);
135 int (*vidioc_enum_fmt_vbi_output) (struct file *file, void *fh,
136 struct v4l2_fmtdesc *f);
137 int (*vidioc_enum_fmt_type_private)(struct file *file, void *fh,
138 struct v4l2_fmtdesc *f);
139
140 /* VIDIOC_G_FMT handlers */
141 int (*vidioc_g_fmt_cap) (struct file *file, void *fh,
142 struct v4l2_format *f);
143 int (*vidioc_g_fmt_overlay) (struct file *file, void *fh,
144 struct v4l2_format *f);
145 int (*vidioc_g_fmt_vbi) (struct file *file, void *fh,
146 struct v4l2_format *f);
147 int (*vidioc_g_fmt_vbi_output) (struct file *file, void *fh,
148 struct v4l2_format *f);
149 int (*vidioc_g_fmt_vbi_capture)(struct file *file, void *fh,
150 struct v4l2_format *f);
151 int (*vidioc_g_fmt_video_output)(struct file *file, void *fh,
152 struct v4l2_format *f);
153 int (*vidioc_g_fmt_type_private)(struct file *file, void *fh,
154 struct v4l2_format *f);
155
156 /* VIDIOC_S_FMT handlers */
157 int (*vidioc_s_fmt_cap) (struct file *file, void *fh,
158 struct v4l2_format *f);
159
160 int (*vidioc_s_fmt_overlay) (struct file *file, void *fh,
161 struct v4l2_format *f);
162 int (*vidioc_s_fmt_vbi) (struct file *file, void *fh,
163 struct v4l2_format *f);
164 int (*vidioc_s_fmt_vbi_output) (struct file *file, void *fh,
165 struct v4l2_format *f);
166 int (*vidioc_s_fmt_vbi_capture)(struct file *file, void *fh,
167 struct v4l2_format *f);
168 int (*vidioc_s_fmt_video_output)(struct file *file, void *fh,
169 struct v4l2_format *f);
170 int (*vidioc_s_fmt_type_private)(struct file *file, void *fh,
171 struct v4l2_format *f);
172
173 /* VIDIOC_TRY_FMT handlers */
174 int (*vidioc_try_fmt_cap) (struct file *file, void *fh,
175 struct v4l2_format *f);
176 int (*vidioc_try_fmt_overlay) (struct file *file, void *fh,
177 struct v4l2_format *f);
178 int (*vidioc_try_fmt_vbi) (struct file *file, void *fh,
179 struct v4l2_format *f);
180 int (*vidioc_try_fmt_vbi_output) (struct file *file, void *fh,
181 struct v4l2_format *f);
182 int (*vidioc_try_fmt_vbi_capture)(struct file *file, void *fh,
183 struct v4l2_format *f);
184 int (*vidioc_try_fmt_video_output)(struct file *file, void *fh,
185 struct v4l2_format *f);
186 int (*vidioc_try_fmt_type_private)(struct file *file, void *fh,
187 struct v4l2_format *f);
188
189 /* Buffer handlers */
190 int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b);
191 int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b);
192 int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
193 int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
194
195
196 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
197#ifdef HAVE_V4L1
198 /* buffer type is struct vidio_mbuf * */
199 int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p);
200#endif
201 int (*vidioc_g_fbuf) (struct file *file, void *fh,
202 struct v4l2_framebuffer *a);
203 int (*vidioc_s_fbuf) (struct file *file, void *fh,
204 struct v4l2_framebuffer *a);
205
206 /* Stream on/off */
207 int (*vidioc_streamon) (struct file *file, void *fh, enum v4l2_buf_type i);
208 int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i);
209
210 /* Standard handling
211 G_STD and ENUMSTD are handled by videodev.c
212 */
213 int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id a);
214 int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);
215
216 /* Input handling */
217 int (*vidioc_enum_input)(struct file *file, void *fh,
218 struct v4l2_input *inp);
219 int (*vidioc_g_input) (struct file *file, void *fh, unsigned int *i);
220 int (*vidioc_s_input) (struct file *file, void *fh, unsigned int i);
221
222 /* Output handling */
223 int (*vidioc_enumoutput) (struct file *file, void *fh,
224 struct v4l2_output *a);
225 int (*vidioc_g_output) (struct file *file, void *fh, unsigned int *i);
226 int (*vidioc_s_output) (struct file *file, void *fh, unsigned int i);
227
228 /* Control handling */
229 int (*vidioc_queryctrl) (struct file *file, void *fh,
230 struct v4l2_queryctrl *a);
231 int (*vidioc_g_ctrl) (struct file *file, void *fh,
232 struct v4l2_control *a);
233 int (*vidioc_s_ctrl) (struct file *file, void *fh,
234 struct v4l2_control *a);
235 int (*vidioc_g_ext_ctrls) (struct file *file, void *fh,
236 struct v4l2_ext_controls *a);
237 int (*vidioc_s_ext_ctrls) (struct file *file, void *fh,
238 struct v4l2_ext_controls *a);
239 int (*vidioc_try_ext_ctrls) (struct file *file, void *fh,
240 struct v4l2_ext_controls *a);
241 int (*vidioc_querymenu) (struct file *file, void *fh,
242 struct v4l2_querymenu *a);
243
244 /* Audio ioctls */
245 int (*vidioc_enumaudio) (struct file *file, void *fh,
246 struct v4l2_audio *a);
247 int (*vidioc_g_audio) (struct file *file, void *fh,
248 struct v4l2_audio *a);
249 int (*vidioc_s_audio) (struct file *file, void *fh,
250 struct v4l2_audio *a);
251
252 /* Audio out ioctls */
253 int (*vidioc_enumaudout) (struct file *file, void *fh,
254 struct v4l2_audioout *a);
255 int (*vidioc_g_audout) (struct file *file, void *fh,
256 struct v4l2_audioout *a);
257 int (*vidioc_s_audout) (struct file *file, void *fh,
258 struct v4l2_audioout *a);
259 int (*vidioc_g_modulator) (struct file *file, void *fh,
260 struct v4l2_modulator *a);
261 int (*vidioc_s_modulator) (struct file *file, void *fh,
262 struct v4l2_modulator *a);
263 /* Crop ioctls */
264 int (*vidioc_cropcap) (struct file *file, void *fh,
265 struct v4l2_cropcap *a);
266 int (*vidioc_g_crop) (struct file *file, void *fh,
267 struct v4l2_crop *a);
268 int (*vidioc_s_crop) (struct file *file, void *fh,
269 struct v4l2_crop *a);
270 /* Compression ioctls */
271 int (*vidioc_g_mpegcomp) (struct file *file, void *fh,
272 struct v4l2_mpeg_compression *a);
273 int (*vidioc_s_mpegcomp) (struct file *file, void *fh,
274 struct v4l2_mpeg_compression *a);
275 int (*vidioc_g_jpegcomp) (struct file *file, void *fh,
276 struct v4l2_jpegcompression *a);
277 int (*vidioc_s_jpegcomp) (struct file *file, void *fh,
278 struct v4l2_jpegcompression *a);
279
280 /* Stream type-dependent parameter ioctls */
281 int (*vidioc_g_parm) (struct file *file, void *fh,
282 struct v4l2_streamparm *a);
283 int (*vidioc_s_parm) (struct file *file, void *fh,
284 struct v4l2_streamparm *a);
285
286 /* Tuner ioctls */
287 int (*vidioc_g_tuner) (struct file *file, void *fh,
288 struct v4l2_tuner *a);
289 int (*vidioc_s_tuner) (struct file *file, void *fh,
290 struct v4l2_tuner *a);
291 int (*vidioc_g_frequency) (struct file *file, void *fh,
292 struct v4l2_frequency *a);
293 int (*vidioc_s_frequency) (struct file *file, void *fh,
294 struct v4l2_frequency *a);
295
296 /* Sliced VBI cap */
297 int (*vidioc_g_sliced_vbi_cap) (struct file *file, void *fh,
298 struct v4l2_sliced_vbi_cap *a);
299
300 /* Log status ioctl */
301 int (*vidioc_log_status) (struct file *file, void *fh);
302
303
304#ifdef OBSOLETE_OWNER /* to be removed soon */
305/* obsolete -- fops->owner is used instead */
306struct module *owner;
307/* dev->driver_data will be used instead some day.
308 * Use the video_{get|set}_drvdata() helper functions,
309 * so the switch over will be transparent for you.
310 * Or use {pci|usb}_{get|set}_drvdata() directly. */
311void *priv;
312#endif
313
314 /* for videodev.c intenal usage -- please don't touch */
315 int users; /* video_exclusive_{open|close} ... */
316 struct mutex lock; /* ... helper function uses these */
317 char devfs_name[64]; /* devfs */
318 struct class_device class_dev; /* sysfs */
319};
320
321/* Version 2 functions */
322extern int video_register_device(struct video_device *vfd, int type, int nr);
323void video_unregister_device(struct video_device *);
324extern int video_ioctl2(struct inode *inode, struct file *file,
325 unsigned int cmd, unsigned long arg);
326
327/* helper functions to alloc / release struct video_device, the
328 later can be used for video_device->release() */
329struct video_device *video_device_alloc(void);
330void video_device_release(struct video_device *vfd);
331
332/* Include support for obsoleted stuff */
333extern int video_usercopy(struct inode *inode, struct file *file,
334 unsigned int cmd, unsigned long arg,
335 int (*func)(struct inode *inode, struct file *file,
336 unsigned int cmd, void *arg));
337
338
339#ifdef HAVE_V4L1
340#include <linux/mm.h>
341
342extern struct video_device* video_devdata(struct file*);
343
344#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
345static inline void
346video_device_create_file(struct video_device *vfd,
347 struct class_device_attribute *attr)
348{
349 class_device_create_file(&vfd->class_dev, attr);
350}
351static inline void
352video_device_remove_file(struct video_device *vfd,
353 struct class_device_attribute *attr)
354{
355 class_device_remove_file(&vfd->class_dev, attr);
356}
357
358#ifdef OBSOLETE_OWNER /* to be removed soon */
359/* helper functions to access driver private data. */
360static inline void *video_get_drvdata(struct video_device *dev)
361{
362 return dev->priv;
363}
364
365static inline void video_set_drvdata(struct video_device *dev, void *data)
366{
367 dev->priv = data;
368}
369#endif
370
371extern int video_exclusive_open(struct inode *inode, struct file *file);
372extern int video_exclusive_release(struct inode *inode, struct file *file);
373#endif /* HAVE_V4L1 */
374
375#endif /* _V4L2_DEV_H */
diff --git a/include/media/video-buf-dvb.h b/include/media/video-buf-dvb.h
index b78d90fe629f..8233cafdeef6 100644
--- a/include/media/video-buf-dvb.h
+++ b/include/media/video-buf-dvb.h
@@ -26,7 +26,8 @@ struct videobuf_dvb {
26 26
27int videobuf_dvb_register(struct videobuf_dvb *dvb, 27int videobuf_dvb_register(struct videobuf_dvb *dvb,
28 struct module *module, 28 struct module *module,
29 void *adapter_priv); 29 void *adapter_priv,
30 struct device *device);
30void videobuf_dvb_unregister(struct videobuf_dvb *dvb); 31void videobuf_dvb_unregister(struct videobuf_dvb *dvb);
31 32
32/* 33/*
diff --git a/include/media/video-buf.h b/include/media/video-buf.h
index fff3fd0fbf94..1115a256969f 100644
--- a/include/media/video-buf.h
+++ b/include/media/video-buf.h
@@ -23,6 +23,7 @@
23 */ 23 */
24 24
25#include <linux/videodev2.h> 25#include <linux/videodev2.h>
26#include <linux/poll.h>
26 27
27#define UNSET (-1U) 28#define UNSET (-1U)
28 29
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index a4f554520197..b5067d3c2387 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -20,9 +20,10 @@
20 * along with this program; if not, write to the Free Software 20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * 22 *
23 */ 23 */
24 24
25#include <linux/videodev.h> 25#include <linux/videodev.h>
26#include <media/v4l2-dev.h>
26 27
27struct snd_tea575x; 28struct snd_tea575x;
28 29