diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-31 06:38:04 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-31 06:38:04 -0400 |
commit | 5fbf24659b75356e2142e1f1b88f67b34cbc3e75 (patch) | |
tree | 0e470e4cc89b72e3d74939f8c39396a6a0bebb3a /include/linux | |
parent | d89961e2dc87b6e30b8e3f60bd2af5cd92cf4643 (diff) | |
parent | 6e86841d05f371b5b9b86ce76c02aaee83352298 (diff) |
Merge branch 'linus' into x86/xen
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/buffer_head.h | 2 | ||||
-rw-r--r-- | include/linux/cpumask.h | 63 | ||||
-rw-r--r-- | include/linux/fs.h | 44 | ||||
-rw-r--r-- | include/linux/iommu-helper.h | 1 | ||||
-rw-r--r-- | include/linux/maple.h | 2 | ||||
-rw-r--r-- | include/linux/mfd/core.h | 30 | ||||
-rw-r--r-- | include/linux/mm.h | 3 | ||||
-rw-r--r-- | include/linux/mm_types.h | 4 | ||||
-rw-r--r-- | include/linux/mmu_notifier.h | 279 | ||||
-rw-r--r-- | include/linux/of.h | 1 | ||||
-rw-r--r-- | include/linux/of_spi.h | 18 | ||||
-rw-r--r-- | include/linux/pagemap.h | 1 | ||||
-rw-r--r-- | include/linux/pci-aspm.h | 5 | ||||
-rw-r--r-- | include/linux/pci.h | 2 | ||||
-rw-r--r-- | include/linux/pci_regs.h | 1 | ||||
-rw-r--r-- | include/linux/rculist.h | 28 | ||||
-rw-r--r-- | include/linux/rmap.h | 8 | ||||
-rw-r--r-- | include/linux/serio.h | 3 | ||||
-rw-r--r-- | include/linux/spi/spi.h | 12 | ||||
-rw-r--r-- | include/linux/stop_machine.h | 50 | ||||
-rw-r--r-- | include/linux/videodev.h | 15 | ||||
-rw-r--r-- | include/linux/videodev2.h | 386 | ||||
-rw-r--r-- | include/linux/videotext.h | 16 |
23 files changed, 658 insertions, 316 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 82aa36c53ea7..50cfe8ceb478 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -205,6 +205,8 @@ void block_invalidatepage(struct page *page, unsigned long offset); | |||
205 | int block_write_full_page(struct page *page, get_block_t *get_block, | 205 | int block_write_full_page(struct page *page, get_block_t *get_block, |
206 | struct writeback_control *wbc); | 206 | struct writeback_control *wbc); |
207 | int block_read_full_page(struct page*, get_block_t*); | 207 | int block_read_full_page(struct page*, get_block_t*); |
208 | int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, | ||
209 | unsigned long from); | ||
208 | int block_write_begin(struct file *, struct address_space *, | 210 | int block_write_begin(struct file *, struct address_space *, |
209 | loff_t, unsigned, unsigned, | 211 | loff_t, unsigned, unsigned, |
210 | struct page **, void **, get_block_t*); | 212 | struct page **, void **, get_block_t*); |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 1b5c98e7fef7..96d0509fb8d8 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -62,15 +62,7 @@ | |||
62 | * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids | 62 | * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids |
63 | * | 63 | * |
64 | * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set | 64 | * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set |
65 | *ifdef CONFIG_HAS_CPUMASK_OF_CPU | 65 | * (can be used as an lvalue) |
66 | * cpumask_of_cpu_ptr_declare(v) Declares cpumask_t *v | ||
67 | * cpumask_of_cpu_ptr_next(v, cpu) Sets v = &cpumask_of_cpu_map[cpu] | ||
68 | * cpumask_of_cpu_ptr(v, cpu) Combines above two operations | ||
69 | *else | ||
70 | * cpumask_of_cpu_ptr_declare(v) Declares cpumask_t _v and *v = &_v | ||
71 | * cpumask_of_cpu_ptr_next(v, cpu) Sets _v = cpumask_of_cpu(cpu) | ||
72 | * cpumask_of_cpu_ptr(v, cpu) Combines above two operations | ||
73 | *endif | ||
74 | * CPU_MASK_ALL Initializer - all bits set | 66 | * CPU_MASK_ALL Initializer - all bits set |
75 | * CPU_MASK_NONE Initializer - no bits set | 67 | * CPU_MASK_NONE Initializer - no bits set |
76 | * unsigned long *cpus_addr(mask) Array of unsigned long's in mask | 68 | * unsigned long *cpus_addr(mask) Array of unsigned long's in mask |
@@ -273,37 +265,30 @@ static inline void __cpus_shift_left(cpumask_t *dstp, | |||
273 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | 265 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); |
274 | } | 266 | } |
275 | 267 | ||
268 | /* | ||
269 | * Special-case data structure for "single bit set only" constant CPU masks. | ||
270 | * | ||
271 | * We pre-generate all the 64 (or 32) possible bit positions, with enough | ||
272 | * padding to the left and the right, and return the constant pointer | ||
273 | * appropriately offset. | ||
274 | */ | ||
275 | extern const unsigned long | ||
276 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; | ||
277 | |||
278 | static inline const cpumask_t *get_cpu_mask(unsigned int cpu) | ||
279 | { | ||
280 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; | ||
281 | p -= cpu / BITS_PER_LONG; | ||
282 | return (const cpumask_t *)p; | ||
283 | } | ||
284 | |||
285 | /* | ||
286 | * In cases where we take the address of the cpumask immediately, | ||
287 | * gcc optimizes it out (it's a constant) and there's no huge stack | ||
288 | * variable created: | ||
289 | */ | ||
290 | #define cpumask_of_cpu(cpu) ({ *get_cpu_mask(cpu); }) | ||
276 | 291 | ||
277 | #ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP | ||
278 | extern cpumask_t *cpumask_of_cpu_map; | ||
279 | #define cpumask_of_cpu(cpu) (cpumask_of_cpu_map[cpu]) | ||
280 | #define cpumask_of_cpu_ptr(v, cpu) \ | ||
281 | const cpumask_t *v = &cpumask_of_cpu(cpu) | ||
282 | #define cpumask_of_cpu_ptr_declare(v) \ | ||
283 | const cpumask_t *v | ||
284 | #define cpumask_of_cpu_ptr_next(v, cpu) \ | ||
285 | v = &cpumask_of_cpu(cpu) | ||
286 | #else | ||
287 | #define cpumask_of_cpu(cpu) \ | ||
288 | ({ \ | ||
289 | typeof(_unused_cpumask_arg_) m; \ | ||
290 | if (sizeof(m) == sizeof(unsigned long)) { \ | ||
291 | m.bits[0] = 1UL<<(cpu); \ | ||
292 | } else { \ | ||
293 | cpus_clear(m); \ | ||
294 | cpu_set((cpu), m); \ | ||
295 | } \ | ||
296 | m; \ | ||
297 | }) | ||
298 | #define cpumask_of_cpu_ptr(v, cpu) \ | ||
299 | cpumask_t _##v = cpumask_of_cpu(cpu); \ | ||
300 | const cpumask_t *v = &_##v | ||
301 | #define cpumask_of_cpu_ptr_declare(v) \ | ||
302 | cpumask_t _##v; \ | ||
303 | const cpumask_t *v = &_##v | ||
304 | #define cpumask_of_cpu_ptr_next(v, cpu) \ | ||
305 | _##v = cpumask_of_cpu(cpu) | ||
306 | #endif | ||
307 | 292 | ||
308 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | 293 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) |
309 | 294 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 8252b045e624..580b513668fe 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -443,6 +443,27 @@ static inline size_t iov_iter_count(struct iov_iter *i) | |||
443 | return i->count; | 443 | return i->count; |
444 | } | 444 | } |
445 | 445 | ||
446 | /* | ||
447 | * "descriptor" for what we're up to with a read. | ||
448 | * This allows us to use the same read code yet | ||
449 | * have multiple different users of the data that | ||
450 | * we read from a file. | ||
451 | * | ||
452 | * The simplest case just copies the data to user | ||
453 | * mode. | ||
454 | */ | ||
455 | typedef struct { | ||
456 | size_t written; | ||
457 | size_t count; | ||
458 | union { | ||
459 | char __user *buf; | ||
460 | void *data; | ||
461 | } arg; | ||
462 | int error; | ||
463 | } read_descriptor_t; | ||
464 | |||
465 | typedef int (*read_actor_t)(read_descriptor_t *, struct page *, | ||
466 | unsigned long, unsigned long); | ||
446 | 467 | ||
447 | struct address_space_operations { | 468 | struct address_space_operations { |
448 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 469 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
@@ -484,6 +505,8 @@ struct address_space_operations { | |||
484 | int (*migratepage) (struct address_space *, | 505 | int (*migratepage) (struct address_space *, |
485 | struct page *, struct page *); | 506 | struct page *, struct page *); |
486 | int (*launder_page) (struct page *); | 507 | int (*launder_page) (struct page *); |
508 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | ||
509 | unsigned long); | ||
487 | }; | 510 | }; |
488 | 511 | ||
489 | /* | 512 | /* |
@@ -1198,27 +1221,6 @@ struct block_device_operations { | |||
1198 | struct module *owner; | 1221 | struct module *owner; |
1199 | }; | 1222 | }; |
1200 | 1223 | ||
1201 | /* | ||
1202 | * "descriptor" for what we're up to with a read. | ||
1203 | * This allows us to use the same read code yet | ||
1204 | * have multiple different users of the data that | ||
1205 | * we read from a file. | ||
1206 | * | ||
1207 | * The simplest case just copies the data to user | ||
1208 | * mode. | ||
1209 | */ | ||
1210 | typedef struct { | ||
1211 | size_t written; | ||
1212 | size_t count; | ||
1213 | union { | ||
1214 | char __user * buf; | ||
1215 | void *data; | ||
1216 | } arg; | ||
1217 | int error; | ||
1218 | } read_descriptor_t; | ||
1219 | |||
1220 | typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, unsigned long); | ||
1221 | |||
1222 | /* These macros are for out of kernel modules to test that | 1224 | /* These macros are for out of kernel modules to test that |
1223 | * the kernel supports the unlocked_ioctl and compat_ioctl | 1225 | * the kernel supports the unlocked_ioctl and compat_ioctl |
1224 | * fields in struct file_operations. */ | 1226 | * fields in struct file_operations. */ |
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h index c975caf75385..f8598f583944 100644 --- a/include/linux/iommu-helper.h +++ b/include/linux/iommu-helper.h | |||
@@ -8,3 +8,4 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | |||
8 | unsigned long align_mask); | 8 | unsigned long align_mask); |
9 | extern void iommu_area_free(unsigned long *map, unsigned long start, | 9 | extern void iommu_area_free(unsigned long *map, unsigned long start, |
10 | unsigned int nr); | 10 | unsigned int nr); |
11 | extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len); | ||
diff --git a/include/linux/maple.h b/include/linux/maple.h index d31e36ebb436..523a286bb477 100644 --- a/include/linux/maple.h +++ b/include/linux/maple.h | |||
@@ -61,8 +61,6 @@ struct maple_device { | |||
61 | 61 | ||
62 | struct maple_driver { | 62 | struct maple_driver { |
63 | unsigned long function; | 63 | unsigned long function; |
64 | int (*connect) (struct maple_device * dev); | ||
65 | void (*disconnect) (struct maple_device * dev); | ||
66 | struct device_driver drv; | 64 | struct device_driver drv; |
67 | }; | 65 | }; |
68 | 66 | ||
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index bb3dd0545928..49ef857cdb2d 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -1,5 +1,3 @@ | |||
1 | #ifndef MFD_CORE_H | ||
2 | #define MFD_CORE_H | ||
3 | /* | 1 | /* |
4 | * drivers/mfd/mfd-core.h | 2 | * drivers/mfd/mfd-core.h |
5 | * | 3 | * |
@@ -13,6 +11,9 @@ | |||
13 | * | 11 | * |
14 | */ | 12 | */ |
15 | 13 | ||
14 | #ifndef MFD_CORE_H | ||
15 | #define MFD_CORE_H | ||
16 | |||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | 18 | ||
18 | /* | 19 | /* |
@@ -28,7 +29,13 @@ struct mfd_cell { | |||
28 | int (*suspend)(struct platform_device *dev); | 29 | int (*suspend)(struct platform_device *dev); |
29 | int (*resume)(struct platform_device *dev); | 30 | int (*resume)(struct platform_device *dev); |
30 | 31 | ||
31 | void *driver_data; /* driver-specific data */ | 32 | /* driver-specific data for MFD-aware "cell" drivers */ |
33 | void *driver_data; | ||
34 | |||
35 | /* platform_data can be used to either pass data to "generic" | ||
36 | driver or as a hook to mfd_cell for the "cell" drivers */ | ||
37 | void *platform_data; | ||
38 | size_t data_size; | ||
32 | 39 | ||
33 | /* | 40 | /* |
34 | * This resources can be specified relatievly to the parent device. | 41 | * This resources can be specified relatievly to the parent device. |
@@ -38,18 +45,11 @@ struct mfd_cell { | |||
38 | const struct resource *resources; | 45 | const struct resource *resources; |
39 | }; | 46 | }; |
40 | 47 | ||
41 | static inline struct mfd_cell * | 48 | extern int mfd_add_devices(struct device *parent, int id, |
42 | mfd_get_cell(struct platform_device *pdev) | 49 | const struct mfd_cell *cells, int n_devs, |
43 | { | 50 | struct resource *mem_base, |
44 | return (struct mfd_cell *)pdev->dev.platform_data; | 51 | int irq_base); |
45 | } | ||
46 | |||
47 | extern int mfd_add_devices( | ||
48 | struct platform_device *parent, | ||
49 | const struct mfd_cell *cells, int n_devs, | ||
50 | struct resource *mem_base, | ||
51 | int irq_base); | ||
52 | 52 | ||
53 | extern void mfd_remove_devices(struct platform_device *parent); | 53 | extern void mfd_remove_devices(struct device *parent); |
54 | 54 | ||
55 | #endif | 55 | #endif |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6e695eaab4ce..866a3dbe5c75 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1104,6 +1104,9 @@ extern struct vm_area_struct *copy_vma(struct vm_area_struct **, | |||
1104 | unsigned long addr, unsigned long len, pgoff_t pgoff); | 1104 | unsigned long addr, unsigned long len, pgoff_t pgoff); |
1105 | extern void exit_mmap(struct mm_struct *); | 1105 | extern void exit_mmap(struct mm_struct *); |
1106 | 1106 | ||
1107 | extern int mm_take_all_locks(struct mm_struct *mm); | ||
1108 | extern void mm_drop_all_locks(struct mm_struct *mm); | ||
1109 | |||
1107 | #ifdef CONFIG_PROC_FS | 1110 | #ifdef CONFIG_PROC_FS |
1108 | /* From fs/proc/base.c. callers must _not_ hold the mm's exe_file_lock */ | 1111 | /* From fs/proc/base.c. callers must _not_ hold the mm's exe_file_lock */ |
1109 | extern void added_exe_file_vma(struct mm_struct *mm); | 1112 | extern void added_exe_file_vma(struct mm_struct *mm); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 746f975b58ef..386edbe2cb4e 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/rbtree.h> | 10 | #include <linux/rbtree.h> |
11 | #include <linux/rwsem.h> | 11 | #include <linux/rwsem.h> |
12 | #include <linux/completion.h> | 12 | #include <linux/completion.h> |
13 | #include <linux/cpumask.h> | ||
13 | #include <asm/page.h> | 14 | #include <asm/page.h> |
14 | #include <asm/mmu.h> | 15 | #include <asm/mmu.h> |
15 | 16 | ||
@@ -253,6 +254,9 @@ struct mm_struct { | |||
253 | struct file *exe_file; | 254 | struct file *exe_file; |
254 | unsigned long num_exe_file_vmas; | 255 | unsigned long num_exe_file_vmas; |
255 | #endif | 256 | #endif |
257 | #ifdef CONFIG_MMU_NOTIFIER | ||
258 | struct mmu_notifier_mm *mmu_notifier_mm; | ||
259 | #endif | ||
256 | }; | 260 | }; |
257 | 261 | ||
258 | #endif /* _LINUX_MM_TYPES_H */ | 262 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h new file mode 100644 index 000000000000..b77486d152cd --- /dev/null +++ b/include/linux/mmu_notifier.h | |||
@@ -0,0 +1,279 @@ | |||
1 | #ifndef _LINUX_MMU_NOTIFIER_H | ||
2 | #define _LINUX_MMU_NOTIFIER_H | ||
3 | |||
4 | #include <linux/list.h> | ||
5 | #include <linux/spinlock.h> | ||
6 | #include <linux/mm_types.h> | ||
7 | |||
8 | struct mmu_notifier; | ||
9 | struct mmu_notifier_ops; | ||
10 | |||
11 | #ifdef CONFIG_MMU_NOTIFIER | ||
12 | |||
13 | /* | ||
14 | * The mmu notifier_mm structure is allocated and installed in | ||
15 | * mm->mmu_notifier_mm inside the mm_take_all_locks() protected | ||
16 | * critical section and it's released only when mm_count reaches zero | ||
17 | * in mmdrop(). | ||
18 | */ | ||
19 | struct mmu_notifier_mm { | ||
20 | /* all mmu notifiers registerd in this mm are queued in this list */ | ||
21 | struct hlist_head list; | ||
22 | /* to serialize the list modifications and hlist_unhashed */ | ||
23 | spinlock_t lock; | ||
24 | }; | ||
25 | |||
26 | struct mmu_notifier_ops { | ||
27 | /* | ||
28 | * Called either by mmu_notifier_unregister or when the mm is | ||
29 | * being destroyed by exit_mmap, always before all pages are | ||
30 | * freed. This can run concurrently with other mmu notifier | ||
31 | * methods (the ones invoked outside the mm context) and it | ||
32 | * should tear down all secondary mmu mappings and freeze the | ||
33 | * secondary mmu. If this method isn't implemented you've to | ||
34 | * be sure that nothing could possibly write to the pages | ||
35 | * through the secondary mmu by the time the last thread with | ||
36 | * tsk->mm == mm exits. | ||
37 | * | ||
38 | * As side note: the pages freed after ->release returns could | ||
39 | * be immediately reallocated by the gart at an alias physical | ||
40 | * address with a different cache model, so if ->release isn't | ||
41 | * implemented because all _software_ driven memory accesses | ||
42 | * through the secondary mmu are terminated by the time the | ||
43 | * last thread of this mm quits, you've also to be sure that | ||
44 | * speculative _hardware_ operations can't allocate dirty | ||
45 | * cachelines in the cpu that could not be snooped and made | ||
46 | * coherent with the other read and write operations happening | ||
47 | * through the gart alias address, so leading to memory | ||
48 | * corruption. | ||
49 | */ | ||
50 | void (*release)(struct mmu_notifier *mn, | ||
51 | struct mm_struct *mm); | ||
52 | |||
53 | /* | ||
54 | * clear_flush_young is called after the VM is | ||
55 | * test-and-clearing the young/accessed bitflag in the | ||
56 | * pte. This way the VM will provide proper aging to the | ||
57 | * accesses to the page through the secondary MMUs and not | ||
58 | * only to the ones through the Linux pte. | ||
59 | */ | ||
60 | int (*clear_flush_young)(struct mmu_notifier *mn, | ||
61 | struct mm_struct *mm, | ||
62 | unsigned long address); | ||
63 | |||
64 | /* | ||
65 | * Before this is invoked any secondary MMU is still ok to | ||
66 | * read/write to the page previously pointed to by the Linux | ||
67 | * pte because the page hasn't been freed yet and it won't be | ||
68 | * freed until this returns. If required set_page_dirty has to | ||
69 | * be called internally to this method. | ||
70 | */ | ||
71 | void (*invalidate_page)(struct mmu_notifier *mn, | ||
72 | struct mm_struct *mm, | ||
73 | unsigned long address); | ||
74 | |||
75 | /* | ||
76 | * invalidate_range_start() and invalidate_range_end() must be | ||
77 | * paired and are called only when the mmap_sem and/or the | ||
78 | * locks protecting the reverse maps are held. The subsystem | ||
79 | * must guarantee that no additional references are taken to | ||
80 | * the pages in the range established between the call to | ||
81 | * invalidate_range_start() and the matching call to | ||
82 | * invalidate_range_end(). | ||
83 | * | ||
84 | * Invalidation of multiple concurrent ranges may be | ||
85 | * optionally permitted by the driver. Either way the | ||
86 | * establishment of sptes is forbidden in the range passed to | ||
87 | * invalidate_range_begin/end for the whole duration of the | ||
88 | * invalidate_range_begin/end critical section. | ||
89 | * | ||
90 | * invalidate_range_start() is called when all pages in the | ||
91 | * range are still mapped and have at least a refcount of one. | ||
92 | * | ||
93 | * invalidate_range_end() is called when all pages in the | ||
94 | * range have been unmapped and the pages have been freed by | ||
95 | * the VM. | ||
96 | * | ||
97 | * The VM will remove the page table entries and potentially | ||
98 | * the page between invalidate_range_start() and | ||
99 | * invalidate_range_end(). If the page must not be freed | ||
100 | * because of pending I/O or other circumstances then the | ||
101 | * invalidate_range_start() callback (or the initial mapping | ||
102 | * by the driver) must make sure that the refcount is kept | ||
103 | * elevated. | ||
104 | * | ||
105 | * If the driver increases the refcount when the pages are | ||
106 | * initially mapped into an address space then either | ||
107 | * invalidate_range_start() or invalidate_range_end() may | ||
108 | * decrease the refcount. If the refcount is decreased on | ||
109 | * invalidate_range_start() then the VM can free pages as page | ||
110 | * table entries are removed. If the refcount is only | ||
111 | * droppped on invalidate_range_end() then the driver itself | ||
112 | * will drop the last refcount but it must take care to flush | ||
113 | * any secondary tlb before doing the final free on the | ||
114 | * page. Pages will no longer be referenced by the linux | ||
115 | * address space but may still be referenced by sptes until | ||
116 | * the last refcount is dropped. | ||
117 | */ | ||
118 | void (*invalidate_range_start)(struct mmu_notifier *mn, | ||
119 | struct mm_struct *mm, | ||
120 | unsigned long start, unsigned long end); | ||
121 | void (*invalidate_range_end)(struct mmu_notifier *mn, | ||
122 | struct mm_struct *mm, | ||
123 | unsigned long start, unsigned long end); | ||
124 | }; | ||
125 | |||
126 | /* | ||
127 | * The notifier chains are protected by mmap_sem and/or the reverse map | ||
128 | * semaphores. Notifier chains are only changed when all reverse maps and | ||
129 | * the mmap_sem locks are taken. | ||
130 | * | ||
131 | * Therefore notifier chains can only be traversed when either | ||
132 | * | ||
133 | * 1. mmap_sem is held. | ||
134 | * 2. One of the reverse map locks is held (i_mmap_lock or anon_vma->lock). | ||
135 | * 3. No other concurrent thread can access the list (release) | ||
136 | */ | ||
137 | struct mmu_notifier { | ||
138 | struct hlist_node hlist; | ||
139 | const struct mmu_notifier_ops *ops; | ||
140 | }; | ||
141 | |||
142 | static inline int mm_has_notifiers(struct mm_struct *mm) | ||
143 | { | ||
144 | return unlikely(mm->mmu_notifier_mm); | ||
145 | } | ||
146 | |||
147 | extern int mmu_notifier_register(struct mmu_notifier *mn, | ||
148 | struct mm_struct *mm); | ||
149 | extern int __mmu_notifier_register(struct mmu_notifier *mn, | ||
150 | struct mm_struct *mm); | ||
151 | extern void mmu_notifier_unregister(struct mmu_notifier *mn, | ||
152 | struct mm_struct *mm); | ||
153 | extern void __mmu_notifier_mm_destroy(struct mm_struct *mm); | ||
154 | extern void __mmu_notifier_release(struct mm_struct *mm); | ||
155 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, | ||
156 | unsigned long address); | ||
157 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, | ||
158 | unsigned long address); | ||
159 | extern void __mmu_notifier_invalidate_range_start(struct mm_struct *mm, | ||
160 | unsigned long start, unsigned long end); | ||
161 | extern void __mmu_notifier_invalidate_range_end(struct mm_struct *mm, | ||
162 | unsigned long start, unsigned long end); | ||
163 | |||
164 | static inline void mmu_notifier_release(struct mm_struct *mm) | ||
165 | { | ||
166 | if (mm_has_notifiers(mm)) | ||
167 | __mmu_notifier_release(mm); | ||
168 | } | ||
169 | |||
170 | static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | ||
171 | unsigned long address) | ||
172 | { | ||
173 | if (mm_has_notifiers(mm)) | ||
174 | return __mmu_notifier_clear_flush_young(mm, address); | ||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, | ||
179 | unsigned long address) | ||
180 | { | ||
181 | if (mm_has_notifiers(mm)) | ||
182 | __mmu_notifier_invalidate_page(mm, address); | ||
183 | } | ||
184 | |||
185 | static inline void mmu_notifier_invalidate_range_start(struct mm_struct *mm, | ||
186 | unsigned long start, unsigned long end) | ||
187 | { | ||
188 | if (mm_has_notifiers(mm)) | ||
189 | __mmu_notifier_invalidate_range_start(mm, start, end); | ||
190 | } | ||
191 | |||
192 | static inline void mmu_notifier_invalidate_range_end(struct mm_struct *mm, | ||
193 | unsigned long start, unsigned long end) | ||
194 | { | ||
195 | if (mm_has_notifiers(mm)) | ||
196 | __mmu_notifier_invalidate_range_end(mm, start, end); | ||
197 | } | ||
198 | |||
199 | static inline void mmu_notifier_mm_init(struct mm_struct *mm) | ||
200 | { | ||
201 | mm->mmu_notifier_mm = NULL; | ||
202 | } | ||
203 | |||
204 | static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | ||
205 | { | ||
206 | if (mm_has_notifiers(mm)) | ||
207 | __mmu_notifier_mm_destroy(mm); | ||
208 | } | ||
209 | |||
210 | /* | ||
211 | * These two macros will sometime replace ptep_clear_flush. | ||
212 | * ptep_clear_flush is impleemnted as macro itself, so this also is | ||
213 | * implemented as a macro until ptep_clear_flush will converted to an | ||
214 | * inline function, to diminish the risk of compilation failure. The | ||
215 | * invalidate_page method over time can be moved outside the PT lock | ||
216 | * and these two macros can be later removed. | ||
217 | */ | ||
218 | #define ptep_clear_flush_notify(__vma, __address, __ptep) \ | ||
219 | ({ \ | ||
220 | pte_t __pte; \ | ||
221 | struct vm_area_struct *___vma = __vma; \ | ||
222 | unsigned long ___address = __address; \ | ||
223 | __pte = ptep_clear_flush(___vma, ___address, __ptep); \ | ||
224 | mmu_notifier_invalidate_page(___vma->vm_mm, ___address); \ | ||
225 | __pte; \ | ||
226 | }) | ||
227 | |||
228 | #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ | ||
229 | ({ \ | ||
230 | int __young; \ | ||
231 | struct vm_area_struct *___vma = __vma; \ | ||
232 | unsigned long ___address = __address; \ | ||
233 | __young = ptep_clear_flush_young(___vma, ___address, __ptep); \ | ||
234 | __young |= mmu_notifier_clear_flush_young(___vma->vm_mm, \ | ||
235 | ___address); \ | ||
236 | __young; \ | ||
237 | }) | ||
238 | |||
239 | #else /* CONFIG_MMU_NOTIFIER */ | ||
240 | |||
241 | static inline void mmu_notifier_release(struct mm_struct *mm) | ||
242 | { | ||
243 | } | ||
244 | |||
245 | static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | ||
246 | unsigned long address) | ||
247 | { | ||
248 | return 0; | ||
249 | } | ||
250 | |||
251 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, | ||
252 | unsigned long address) | ||
253 | { | ||
254 | } | ||
255 | |||
256 | static inline void mmu_notifier_invalidate_range_start(struct mm_struct *mm, | ||
257 | unsigned long start, unsigned long end) | ||
258 | { | ||
259 | } | ||
260 | |||
261 | static inline void mmu_notifier_invalidate_range_end(struct mm_struct *mm, | ||
262 | unsigned long start, unsigned long end) | ||
263 | { | ||
264 | } | ||
265 | |||
266 | static inline void mmu_notifier_mm_init(struct mm_struct *mm) | ||
267 | { | ||
268 | } | ||
269 | |||
270 | static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | ||
271 | { | ||
272 | } | ||
273 | |||
274 | #define ptep_clear_flush_young_notify ptep_clear_flush_young | ||
275 | #define ptep_clear_flush_notify ptep_clear_flush | ||
276 | |||
277 | #endif /* CONFIG_MMU_NOTIFIER */ | ||
278 | |||
279 | #endif /* _LINUX_MMU_NOTIFIER_H */ | ||
diff --git a/include/linux/of.h b/include/linux/of.h index 59a61bdc98b6..79886ade070f 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -70,5 +70,6 @@ extern int of_n_addr_cells(struct device_node *np); | |||
70 | extern int of_n_size_cells(struct device_node *np); | 70 | extern int of_n_size_cells(struct device_node *np); |
71 | extern const struct of_device_id *of_match_node( | 71 | extern const struct of_device_id *of_match_node( |
72 | const struct of_device_id *matches, const struct device_node *node); | 72 | const struct of_device_id *matches, const struct device_node *node); |
73 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); | ||
73 | 74 | ||
74 | #endif /* _LINUX_OF_H */ | 75 | #endif /* _LINUX_OF_H */ |
diff --git a/include/linux/of_spi.h b/include/linux/of_spi.h new file mode 100644 index 000000000000..5f71ee8c0868 --- /dev/null +++ b/include/linux/of_spi.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * OpenFirmware SPI support routines | ||
3 | * Copyright (C) 2008 Secret Lab Technologies Ltd. | ||
4 | * | ||
5 | * Support routines for deriving SPI device attachments from the device | ||
6 | * tree. | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_OF_SPI_H | ||
10 | #define __LINUX_OF_SPI_H | ||
11 | |||
12 | #include <linux/of.h> | ||
13 | #include <linux/spi/spi.h> | ||
14 | |||
15 | extern void of_register_spi_devices(struct spi_master *master, | ||
16 | struct device_node *np); | ||
17 | |||
18 | #endif /* __LINUX_OF_SPI */ | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index a81d81890422..a39b38ccdc97 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -20,6 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ | 21 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ |
22 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ | 22 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ |
23 | #define AS_MM_ALL_LOCKS (__GFP_BITS_SHIFT + 2) /* under mm_take_all_locks() */ | ||
23 | 24 | ||
24 | static inline void mapping_set_error(struct address_space *mapping, int error) | 25 | static inline void mapping_set_error(struct address_space *mapping, int error) |
25 | { | 26 | { |
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index a1a1e618e996..91ba0b338b47 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h | |||
@@ -27,6 +27,7 @@ extern void pcie_aspm_init_link_state(struct pci_dev *pdev); | |||
27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); | 27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); |
28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); | 28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); |
29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); | 29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); |
30 | extern void pcie_no_aspm(void); | ||
30 | #else | 31 | #else |
31 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) | 32 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) |
32 | { | 33 | { |
@@ -40,6 +41,10 @@ static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) | |||
40 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) | 41 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) |
41 | { | 42 | { |
42 | } | 43 | } |
44 | |||
45 | static inline void pcie_no_aspm(void) | ||
46 | { | ||
47 | } | ||
43 | #endif | 48 | #endif |
44 | 49 | ||
45 | #ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ | 50 | #ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 1d296d31abe0..825be3878f68 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -124,6 +124,8 @@ enum pci_dev_flags { | |||
124 | * generation too. | 124 | * generation too. |
125 | */ | 125 | */ |
126 | PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1, | 126 | PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1, |
127 | /* Device configuration is irrevocably lost if disabled into D3 */ | ||
128 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, | ||
127 | }; | 129 | }; |
128 | 130 | ||
129 | typedef unsigned short __bitwise pci_bus_flags_t; | 131 | typedef unsigned short __bitwise pci_bus_flags_t; |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 19958b929905..450684f7eaac 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -374,6 +374,7 @@ | |||
374 | #define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ | 374 | #define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ |
375 | #define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ | 375 | #define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ |
376 | #define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ | 376 | #define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ |
377 | #define PCI_EXP_DEVCAP_RBER 0x8000 /* Role-Based Error Reporting */ | ||
377 | #define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ | 378 | #define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ |
378 | #define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ | 379 | #define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ |
379 | #define PCI_EXP_DEVCTL 8 /* Device Control */ | 380 | #define PCI_EXP_DEVCTL 8 /* Device Control */ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index b0f39be08b6c..eb4443c7e05b 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -98,6 +98,34 @@ static inline void list_del_rcu(struct list_head *entry) | |||
98 | } | 98 | } |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * hlist_del_init_rcu - deletes entry from hash list with re-initialization | ||
102 | * @n: the element to delete from the hash list. | ||
103 | * | ||
104 | * Note: list_unhashed() on the node return true after this. It is | ||
105 | * useful for RCU based read lockfree traversal if the writer side | ||
106 | * must know if the list entry is still hashed or already unhashed. | ||
107 | * | ||
108 | * In particular, it means that we can not poison the forward pointers | ||
109 | * that may still be used for walking the hash list and we can only | ||
110 | * zero the pprev pointer so list_unhashed() will return true after | ||
111 | * this. | ||
112 | * | ||
113 | * The caller must take whatever precautions are necessary (such as | ||
114 | * holding appropriate locks) to avoid racing with another | ||
115 | * list-mutation primitive, such as hlist_add_head_rcu() or | ||
116 | * hlist_del_rcu(), running on this same list. However, it is | ||
117 | * perfectly legal to run concurrently with the _rcu list-traversal | ||
118 | * primitives, such as hlist_for_each_entry_rcu(). | ||
119 | */ | ||
120 | static inline void hlist_del_init_rcu(struct hlist_node *n) | ||
121 | { | ||
122 | if (!hlist_unhashed(n)) { | ||
123 | __hlist_del(n); | ||
124 | n->pprev = NULL; | ||
125 | } | ||
126 | } | ||
127 | |||
128 | /** | ||
101 | * list_replace_rcu - replace old entry by new one | 129 | * list_replace_rcu - replace old entry by new one |
102 | * @old : the element to be replaced | 130 | * @old : the element to be replaced |
103 | * @new : the new element to insert | 131 | * @new : the new element to insert |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 1383692ac5bd..69407f85e10b 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -26,6 +26,14 @@ | |||
26 | */ | 26 | */ |
27 | struct anon_vma { | 27 | struct anon_vma { |
28 | spinlock_t lock; /* Serialize access to vma list */ | 28 | spinlock_t lock; /* Serialize access to vma list */ |
29 | /* | ||
30 | * NOTE: the LSB of the head.next is set by | ||
31 | * mm_take_all_locks() _after_ taking the above lock. So the | ||
32 | * head must only be read/written after taking the above lock | ||
33 | * to be sure to see a valid next pointer. The LSB bit itself | ||
34 | * is serialized by a system wide lock only visible to | ||
35 | * mm_take_all_locks() (mm_all_locks_mutex). | ||
36 | */ | ||
29 | struct list_head head; /* List of private "related" vmas */ | 37 | struct list_head head; /* List of private "related" vmas */ |
30 | }; | 38 | }; |
31 | 39 | ||
diff --git a/include/linux/serio.h b/include/linux/serio.h index e72716cca577..25641d9e0ea8 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -87,11 +87,10 @@ void serio_unregister_port(struct serio *serio); | |||
87 | void serio_unregister_child_port(struct serio *serio); | 87 | void serio_unregister_child_port(struct serio *serio); |
88 | 88 | ||
89 | int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name); | 89 | int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name); |
90 | static inline int serio_register_driver(struct serio_driver *drv) | 90 | static inline int __must_check serio_register_driver(struct serio_driver *drv) |
91 | { | 91 | { |
92 | return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); | 92 | return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); |
93 | } | 93 | } |
94 | int serio_register_driver(struct serio_driver *drv); | ||
95 | void serio_unregister_driver(struct serio_driver *drv); | 94 | void serio_unregister_driver(struct serio_driver *drv); |
96 | 95 | ||
97 | static inline int serio_write(struct serio *serio, unsigned char data) | 96 | static inline int serio_write(struct serio *serio, unsigned char data) |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index a9cc29d46653..4be01bb44377 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -778,8 +778,20 @@ spi_register_board_info(struct spi_board_info const *info, unsigned n) | |||
778 | * use spi_new_device() to describe each device. You can also call | 778 | * use spi_new_device() to describe each device. You can also call |
779 | * spi_unregister_device() to start making that device vanish, but | 779 | * spi_unregister_device() to start making that device vanish, but |
780 | * normally that would be handled by spi_unregister_master(). | 780 | * normally that would be handled by spi_unregister_master(). |
781 | * | ||
782 | * You can also use spi_alloc_device() and spi_add_device() to use a two | ||
783 | * stage registration sequence for each spi_device. This gives the caller | ||
784 | * some more control over the spi_device structure before it is registered, | ||
785 | * but requires that caller to initialize fields that would otherwise | ||
786 | * be defined using the board info. | ||
781 | */ | 787 | */ |
782 | extern struct spi_device * | 788 | extern struct spi_device * |
789 | spi_alloc_device(struct spi_master *master); | ||
790 | |||
791 | extern int | ||
792 | spi_add_device(struct spi_device *spi); | ||
793 | |||
794 | extern struct spi_device * | ||
783 | spi_new_device(struct spi_master *, struct spi_board_info *); | 795 | spi_new_device(struct spi_master *, struct spi_board_info *); |
784 | 796 | ||
785 | static inline void | 797 | static inline void |
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 5bfc553bdb21..f1cb0ba6d715 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -5,41 +5,43 @@ | |||
5 | (and more). So the "read" side to such a lock is anything which | 5 | (and more). So the "read" side to such a lock is anything which |
6 | diables preeempt. */ | 6 | diables preeempt. */ |
7 | #include <linux/cpu.h> | 7 | #include <linux/cpu.h> |
8 | #include <linux/cpumask.h> | ||
8 | #include <asm/system.h> | 9 | #include <asm/system.h> |
9 | 10 | ||
10 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) | 11 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) |
12 | |||
13 | /* Deprecated, but useful for transition. */ | ||
14 | #define ALL_CPUS ~0U | ||
15 | |||
11 | /** | 16 | /** |
12 | * stop_machine_run: freeze the machine on all CPUs and run this function | 17 | * stop_machine: freeze the machine on all CPUs and run this function |
13 | * @fn: the function to run | 18 | * @fn: the function to run |
14 | * @data: the data ptr for the @fn() | 19 | * @data: the data ptr for the @fn() |
15 | * @cpu: the cpu to run @fn() on (or any, if @cpu == NR_CPUS. | 20 | * @cpus: the cpus to run the @fn() on (NULL = any online cpu) |
16 | * | 21 | * |
17 | * Description: This causes a thread to be scheduled on every other cpu, | 22 | * Description: This causes a thread to be scheduled on every cpu, |
18 | * each of which disables interrupts, and finally interrupts are disabled | 23 | * each of which disables interrupts. The result is that noone is |
19 | * on the current CPU. The result is that noone is holding a spinlock | 24 | * holding a spinlock or inside any other preempt-disabled region when |
20 | * or inside any other preempt-disabled region when @fn() runs. | 25 | * @fn() runs. |
21 | * | 26 | * |
22 | * This can be thought of as a very heavy write lock, equivalent to | 27 | * This can be thought of as a very heavy write lock, equivalent to |
23 | * grabbing every spinlock in the kernel. */ | 28 | * grabbing every spinlock in the kernel. */ |
24 | int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu); | 29 | int stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus); |
25 | 30 | ||
26 | /** | 31 | /** |
27 | * __stop_machine_run: freeze the machine on all CPUs and run this function | 32 | * __stop_machine: freeze the machine on all CPUs and run this function |
28 | * @fn: the function to run | 33 | * @fn: the function to run |
29 | * @data: the data ptr for the @fn | 34 | * @data: the data ptr for the @fn |
30 | * @cpu: the cpu to run @fn on (or any, if @cpu == NR_CPUS. | 35 | * @cpus: the cpus to run the @fn() on (NULL = any online cpu) |
31 | * | 36 | * |
32 | * Description: This is a special version of the above, which returns the | 37 | * Description: This is a special version of the above, which assumes cpus |
33 | * thread which has run @fn(): kthread_stop will return the return value | 38 | * won't come or go while it's being called. Used by hotplug cpu. |
34 | * of @fn(). Used by hotplug cpu. | ||
35 | */ | 39 | */ |
36 | struct task_struct *__stop_machine_run(int (*fn)(void *), void *data, | 40 | int __stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus); |
37 | unsigned int cpu); | ||
38 | |||
39 | #else | 41 | #else |
40 | 42 | ||
41 | static inline int stop_machine_run(int (*fn)(void *), void *data, | 43 | static inline int stop_machine(int (*fn)(void *), void *data, |
42 | unsigned int cpu) | 44 | const cpumask_t *cpus) |
43 | { | 45 | { |
44 | int ret; | 46 | int ret; |
45 | local_irq_disable(); | 47 | local_irq_disable(); |
@@ -48,4 +50,18 @@ static inline int stop_machine_run(int (*fn)(void *), void *data, | |||
48 | return ret; | 50 | return ret; |
49 | } | 51 | } |
50 | #endif /* CONFIG_SMP */ | 52 | #endif /* CONFIG_SMP */ |
53 | |||
54 | static inline int __deprecated stop_machine_run(int (*fn)(void *), void *data, | ||
55 | unsigned int cpu) | ||
56 | { | ||
57 | /* If they don't care which cpu fn runs on, just pick one. */ | ||
58 | if (cpu == NR_CPUS) | ||
59 | return stop_machine(fn, data, NULL); | ||
60 | else if (cpu == ~0U) | ||
61 | return stop_machine(fn, data, &cpu_possible_map); | ||
62 | else { | ||
63 | cpumask_t cpus = cpumask_of_cpu(cpu); | ||
64 | return stop_machine(fn, data, &cpus); | ||
65 | } | ||
66 | } | ||
51 | #endif /* _LINUX_STOP_MACHINE */ | 67 | #endif /* _LINUX_STOP_MACHINE */ |
diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 9385a566aed8..15a653d41132 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h | |||
@@ -17,6 +17,21 @@ | |||
17 | 17 | ||
18 | #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) | 18 | #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) |
19 | 19 | ||
20 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | ||
21 | #define VID_TYPE_TUNER 2 /* Can tune */ | ||
22 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | ||
23 | #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ | ||
24 | #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ | ||
25 | #define VID_TYPE_CLIPPING 32 /* Can clip */ | ||
26 | #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ | ||
27 | #define VID_TYPE_SCALES 128 /* Scalable */ | ||
28 | #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ | ||
29 | #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ | ||
30 | #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ | ||
31 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | ||
32 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | ||
33 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | ||
34 | |||
20 | struct video_capability | 35 | struct video_capability |
21 | { | 36 | { |
22 | char name[32]; | 37 | char name[32]; |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 2e66a95e8d32..e466bd54a50e 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -71,6 +71,11 @@ | |||
71 | */ | 71 | */ |
72 | #define VIDEO_MAX_FRAME 32 | 72 | #define VIDEO_MAX_FRAME 32 |
73 | 73 | ||
74 | #ifndef __KERNEL__ | ||
75 | |||
76 | /* These defines are V4L1 specific and should not be used with the V4L2 API! | ||
77 | They will be removed from this header in the future. */ | ||
78 | |||
74 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | 79 | #define VID_TYPE_CAPTURE 1 /* Can capture */ |
75 | #define VID_TYPE_TUNER 2 /* Can tune */ | 80 | #define VID_TYPE_TUNER 2 /* Can tune */ |
76 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | 81 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ |
@@ -85,14 +90,15 @@ | |||
85 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | 90 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ |
86 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | 91 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ |
87 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | 92 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ |
93 | #endif | ||
88 | 94 | ||
89 | /* | 95 | /* |
90 | * M I S C E L L A N E O U S | 96 | * M I S C E L L A N E O U S |
91 | */ | 97 | */ |
92 | 98 | ||
93 | /* Four-character-code (FOURCC) */ | 99 | /* Four-character-code (FOURCC) */ |
94 | #define v4l2_fourcc(a,b,c,d)\ | 100 | #define v4l2_fourcc(a, b, c, d)\ |
95 | (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) | 101 | ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24)) |
96 | 102 | ||
97 | /* | 103 | /* |
98 | * E N U M S | 104 | * E N U M S |
@@ -226,8 +232,7 @@ struct v4l2_fract { | |||
226 | /* | 232 | /* |
227 | * D R I V E R C A P A B I L I T I E S | 233 | * D R I V E R C A P A B I L I T I E S |
228 | */ | 234 | */ |
229 | struct v4l2_capability | 235 | struct v4l2_capability { |
230 | { | ||
231 | __u8 driver[16]; /* i.e. "bttv" */ | 236 | __u8 driver[16]; /* i.e. "bttv" */ |
232 | __u8 card[32]; /* i.e. "Hauppauge WinTV" */ | 237 | __u8 card[32]; /* i.e. "Hauppauge WinTV" */ |
233 | __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ | 238 | __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ |
@@ -259,8 +264,7 @@ struct v4l2_capability | |||
259 | /* | 264 | /* |
260 | * V I D E O I M A G E F O R M A T | 265 | * V I D E O I M A G E F O R M A T |
261 | */ | 266 | */ |
262 | struct v4l2_pix_format | 267 | struct v4l2_pix_format { |
263 | { | ||
264 | __u32 width; | 268 | __u32 width; |
265 | __u32 height; | 269 | __u32 height; |
266 | __u32 pixelformat; | 270 | __u32 pixelformat; |
@@ -272,68 +276,69 @@ struct v4l2_pix_format | |||
272 | }; | 276 | }; |
273 | 277 | ||
274 | /* Pixel format FOURCC depth Description */ | 278 | /* Pixel format FOURCC depth Description */ |
275 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ | 279 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ |
276 | #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R','4','4','4') /* 16 xxxxrrrr ggggbbbb */ | 280 | #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ |
277 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ | 281 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ |
278 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ | 282 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ |
279 | #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */ | 283 | #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ |
280 | #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */ | 284 | #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ |
281 | #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */ | 285 | #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ |
282 | #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */ | 286 | #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ |
283 | #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */ | 287 | #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ |
284 | #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */ | 288 | #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ |
285 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */ | 289 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ |
286 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y','1','6',' ') /* 16 Greyscale */ | 290 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ |
287 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P','A','L','8') /* 8 8-bit palette */ | 291 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ |
288 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */ | 292 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ |
289 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */ | 293 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ |
290 | #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */ | 294 | #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ |
291 | #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */ | 295 | #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ |
292 | #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */ | 296 | #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ |
293 | #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */ | 297 | #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */ |
294 | #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */ | 298 | #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */ |
295 | #define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y','4','4','4') /* 16 xxxxyyyy uuuuvvvv */ | 299 | #define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */ |
296 | #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y','U','V','O') /* 16 YUV-5-5-5 */ | 300 | #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ |
297 | #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y','U','V','P') /* 16 YUV-5-6-5 */ | 301 | #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ |
298 | #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y','U','V','4') /* 32 YUV-8-8-8-8 */ | 302 | #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ |
299 | 303 | ||
300 | /* two planes -- one Y, one Cr + Cb interleaved */ | 304 | /* two planes -- one Y, one Cr + Cb interleaved */ |
301 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */ | 305 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ |
302 | #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */ | 306 | #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ |
303 | 307 | ||
304 | /* The following formats are not defined in the V4L2 specification */ | 308 | /* The following formats are not defined in the V4L2 specification */ |
305 | #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */ | 309 | #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */ |
306 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ | 310 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ |
307 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ | 311 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */ |
308 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ | 312 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ |
309 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */ | 313 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ |
310 | 314 | ||
311 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 315 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
312 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ | 316 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ |
313 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G','B','R','G') /* 8 GBGB.. RGRG.. */ | 317 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
314 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B','Y','R','2') /* 16 BGBG.. GRGR.. */ | 318 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ |
315 | 319 | ||
316 | /* compressed formats */ | 320 | /* compressed formats */ |
317 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ | 321 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ |
318 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ | 322 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ |
319 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ | 323 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ |
320 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */ | 324 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ |
321 | 325 | ||
322 | /* Vendor-specific formats */ | 326 | /* Vendor-specific formats */ |
323 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ | 327 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ |
324 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */ | 328 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ |
325 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ | 329 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ |
326 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ | 330 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ |
327 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ | 331 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ |
328 | #define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S','5','0','1') /* YUYV per line */ | 332 | #define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */ |
329 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S','5','6','1') /* compressed GBRG bayer */ | 333 | #define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */ |
330 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P','2','0','7') /* compressed BGGR bayer */ | 334 | #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ |
335 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ | ||
336 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ | ||
331 | 337 | ||
332 | /* | 338 | /* |
333 | * F O R M A T E N U M E R A T I O N | 339 | * F O R M A T E N U M E R A T I O N |
334 | */ | 340 | */ |
335 | struct v4l2_fmtdesc | 341 | struct v4l2_fmtdesc { |
336 | { | ||
337 | __u32 index; /* Format number */ | 342 | __u32 index; /* Format number */ |
338 | enum v4l2_buf_type type; /* buffer type */ | 343 | enum v4l2_buf_type type; /* buffer type */ |
339 | __u32 flags; | 344 | __u32 flags; |
@@ -349,21 +354,18 @@ struct v4l2_fmtdesc | |||
349 | /* | 354 | /* |
350 | * F R A M E S I Z E E N U M E R A T I O N | 355 | * F R A M E S I Z E E N U M E R A T I O N |
351 | */ | 356 | */ |
352 | enum v4l2_frmsizetypes | 357 | enum v4l2_frmsizetypes { |
353 | { | ||
354 | V4L2_FRMSIZE_TYPE_DISCRETE = 1, | 358 | V4L2_FRMSIZE_TYPE_DISCRETE = 1, |
355 | V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, | 359 | V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, |
356 | V4L2_FRMSIZE_TYPE_STEPWISE = 3, | 360 | V4L2_FRMSIZE_TYPE_STEPWISE = 3, |
357 | }; | 361 | }; |
358 | 362 | ||
359 | struct v4l2_frmsize_discrete | 363 | struct v4l2_frmsize_discrete { |
360 | { | ||
361 | __u32 width; /* Frame width [pixel] */ | 364 | __u32 width; /* Frame width [pixel] */ |
362 | __u32 height; /* Frame height [pixel] */ | 365 | __u32 height; /* Frame height [pixel] */ |
363 | }; | 366 | }; |
364 | 367 | ||
365 | struct v4l2_frmsize_stepwise | 368 | struct v4l2_frmsize_stepwise { |
366 | { | ||
367 | __u32 min_width; /* Minimum frame width [pixel] */ | 369 | __u32 min_width; /* Minimum frame width [pixel] */ |
368 | __u32 max_width; /* Maximum frame width [pixel] */ | 370 | __u32 max_width; /* Maximum frame width [pixel] */ |
369 | __u32 step_width; /* Frame width step size [pixel] */ | 371 | __u32 step_width; /* Frame width step size [pixel] */ |
@@ -372,8 +374,7 @@ struct v4l2_frmsize_stepwise | |||
372 | __u32 step_height; /* Frame height step size [pixel] */ | 374 | __u32 step_height; /* Frame height step size [pixel] */ |
373 | }; | 375 | }; |
374 | 376 | ||
375 | struct v4l2_frmsizeenum | 377 | struct v4l2_frmsizeenum { |
376 | { | ||
377 | __u32 index; /* Frame size number */ | 378 | __u32 index; /* Frame size number */ |
378 | __u32 pixel_format; /* Pixel format */ | 379 | __u32 pixel_format; /* Pixel format */ |
379 | __u32 type; /* Frame size type the device supports. */ | 380 | __u32 type; /* Frame size type the device supports. */ |
@@ -389,22 +390,19 @@ struct v4l2_frmsizeenum | |||
389 | /* | 390 | /* |
390 | * F R A M E R A T E E N U M E R A T I O N | 391 | * F R A M E R A T E E N U M E R A T I O N |
391 | */ | 392 | */ |
392 | enum v4l2_frmivaltypes | 393 | enum v4l2_frmivaltypes { |
393 | { | ||
394 | V4L2_FRMIVAL_TYPE_DISCRETE = 1, | 394 | V4L2_FRMIVAL_TYPE_DISCRETE = 1, |
395 | V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, | 395 | V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, |
396 | V4L2_FRMIVAL_TYPE_STEPWISE = 3, | 396 | V4L2_FRMIVAL_TYPE_STEPWISE = 3, |
397 | }; | 397 | }; |
398 | 398 | ||
399 | struct v4l2_frmival_stepwise | 399 | struct v4l2_frmival_stepwise { |
400 | { | ||
401 | struct v4l2_fract min; /* Minimum frame interval [s] */ | 400 | struct v4l2_fract min; /* Minimum frame interval [s] */ |
402 | struct v4l2_fract max; /* Maximum frame interval [s] */ | 401 | struct v4l2_fract max; /* Maximum frame interval [s] */ |
403 | struct v4l2_fract step; /* Frame interval step size [s] */ | 402 | struct v4l2_fract step; /* Frame interval step size [s] */ |
404 | }; | 403 | }; |
405 | 404 | ||
406 | struct v4l2_frmivalenum | 405 | struct v4l2_frmivalenum { |
407 | { | ||
408 | __u32 index; /* Frame format index */ | 406 | __u32 index; /* Frame format index */ |
409 | __u32 pixel_format; /* Pixel format */ | 407 | __u32 pixel_format; /* Pixel format */ |
410 | __u32 width; /* Frame width */ | 408 | __u32 width; /* Frame width */ |
@@ -423,8 +421,7 @@ struct v4l2_frmivalenum | |||
423 | /* | 421 | /* |
424 | * T I M E C O D E | 422 | * T I M E C O D E |
425 | */ | 423 | */ |
426 | struct v4l2_timecode | 424 | struct v4l2_timecode { |
427 | { | ||
428 | __u32 type; | 425 | __u32 type; |
429 | __u32 flags; | 426 | __u32 flags; |
430 | __u8 frames; | 427 | __u8 frames; |
@@ -449,8 +446,7 @@ struct v4l2_timecode | |||
449 | #define V4L2_TC_USERBITS_8BITCHARS 0x0008 | 446 | #define V4L2_TC_USERBITS_8BITCHARS 0x0008 |
450 | /* The above is based on SMPTE timecodes */ | 447 | /* The above is based on SMPTE timecodes */ |
451 | 448 | ||
452 | struct v4l2_jpegcompression | 449 | struct v4l2_jpegcompression { |
453 | { | ||
454 | int quality; | 450 | int quality; |
455 | 451 | ||
456 | int APPn; /* Number of APP segment to be written, | 452 | int APPn; /* Number of APP segment to be written, |
@@ -482,16 +478,14 @@ struct v4l2_jpegcompression | |||
482 | /* | 478 | /* |
483 | * M E M O R Y - M A P P I N G B U F F E R S | 479 | * M E M O R Y - M A P P I N G B U F F E R S |
484 | */ | 480 | */ |
485 | struct v4l2_requestbuffers | 481 | struct v4l2_requestbuffers { |
486 | { | ||
487 | __u32 count; | 482 | __u32 count; |
488 | enum v4l2_buf_type type; | 483 | enum v4l2_buf_type type; |
489 | enum v4l2_memory memory; | 484 | enum v4l2_memory memory; |
490 | __u32 reserved[2]; | 485 | __u32 reserved[2]; |
491 | }; | 486 | }; |
492 | 487 | ||
493 | struct v4l2_buffer | 488 | struct v4l2_buffer { |
494 | { | ||
495 | __u32 index; | 489 | __u32 index; |
496 | enum v4l2_buf_type type; | 490 | enum v4l2_buf_type type; |
497 | __u32 bytesused; | 491 | __u32 bytesused; |
@@ -525,13 +519,12 @@ struct v4l2_buffer | |||
525 | /* | 519 | /* |
526 | * O V E R L A Y P R E V I E W | 520 | * O V E R L A Y P R E V I E W |
527 | */ | 521 | */ |
528 | struct v4l2_framebuffer | 522 | struct v4l2_framebuffer { |
529 | { | ||
530 | __u32 capability; | 523 | __u32 capability; |
531 | __u32 flags; | 524 | __u32 flags; |
532 | /* FIXME: in theory we should pass something like PCI device + memory | 525 | /* FIXME: in theory we should pass something like PCI device + memory |
533 | * region + offset instead of some physical address */ | 526 | * region + offset instead of some physical address */ |
534 | void* base; | 527 | void *base; |
535 | struct v4l2_pix_format fmt; | 528 | struct v4l2_pix_format fmt; |
536 | }; | 529 | }; |
537 | /* Flags for the 'capability' field. Read only */ | 530 | /* Flags for the 'capability' field. Read only */ |
@@ -550,14 +543,12 @@ struct v4l2_framebuffer | |||
550 | #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 | 543 | #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 |
551 | #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 | 544 | #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 |
552 | 545 | ||
553 | struct v4l2_clip | 546 | struct v4l2_clip { |
554 | { | ||
555 | struct v4l2_rect c; | 547 | struct v4l2_rect c; |
556 | struct v4l2_clip __user *next; | 548 | struct v4l2_clip __user *next; |
557 | }; | 549 | }; |
558 | 550 | ||
559 | struct v4l2_window | 551 | struct v4l2_window { |
560 | { | ||
561 | struct v4l2_rect w; | 552 | struct v4l2_rect w; |
562 | enum v4l2_field field; | 553 | enum v4l2_field field; |
563 | __u32 chromakey; | 554 | __u32 chromakey; |
@@ -570,8 +561,7 @@ struct v4l2_window | |||
570 | /* | 561 | /* |
571 | * C A P T U R E P A R A M E T E R S | 562 | * C A P T U R E P A R A M E T E R S |
572 | */ | 563 | */ |
573 | struct v4l2_captureparm | 564 | struct v4l2_captureparm { |
574 | { | ||
575 | __u32 capability; /* Supported modes */ | 565 | __u32 capability; /* Supported modes */ |
576 | __u32 capturemode; /* Current mode */ | 566 | __u32 capturemode; /* Current mode */ |
577 | struct v4l2_fract timeperframe; /* Time per frame in .1us units */ | 567 | struct v4l2_fract timeperframe; /* Time per frame in .1us units */ |
@@ -584,8 +574,7 @@ struct v4l2_captureparm | |||
584 | #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ | 574 | #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ |
585 | #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ | 575 | #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ |
586 | 576 | ||
587 | struct v4l2_outputparm | 577 | struct v4l2_outputparm { |
588 | { | ||
589 | __u32 capability; /* Supported modes */ | 578 | __u32 capability; /* Supported modes */ |
590 | __u32 outputmode; /* Current mode */ | 579 | __u32 outputmode; /* Current mode */ |
591 | struct v4l2_fract timeperframe; /* Time per frame in seconds */ | 580 | struct v4l2_fract timeperframe; /* Time per frame in seconds */ |
@@ -702,8 +691,7 @@ typedef __u64 v4l2_std_id; | |||
702 | #define V4L2_STD_ALL (V4L2_STD_525_60 |\ | 691 | #define V4L2_STD_ALL (V4L2_STD_525_60 |\ |
703 | V4L2_STD_625_50) | 692 | V4L2_STD_625_50) |
704 | 693 | ||
705 | struct v4l2_standard | 694 | struct v4l2_standard { |
706 | { | ||
707 | __u32 index; | 695 | __u32 index; |
708 | v4l2_std_id id; | 696 | v4l2_std_id id; |
709 | __u8 name[24]; | 697 | __u8 name[24]; |
@@ -715,8 +703,7 @@ struct v4l2_standard | |||
715 | /* | 703 | /* |
716 | * V I D E O I N P U T S | 704 | * V I D E O I N P U T S |
717 | */ | 705 | */ |
718 | struct v4l2_input | 706 | struct v4l2_input { |
719 | { | ||
720 | __u32 index; /* Which input */ | 707 | __u32 index; /* Which input */ |
721 | __u8 name[32]; /* Label */ | 708 | __u8 name[32]; /* Label */ |
722 | __u32 type; /* Type of input */ | 709 | __u32 type; /* Type of input */ |
@@ -753,8 +740,7 @@ struct v4l2_input | |||
753 | /* | 740 | /* |
754 | * V I D E O O U T P U T S | 741 | * V I D E O O U T P U T S |
755 | */ | 742 | */ |
756 | struct v4l2_output | 743 | struct v4l2_output { |
757 | { | ||
758 | __u32 index; /* Which output */ | 744 | __u32 index; /* Which output */ |
759 | __u8 name[32]; /* Label */ | 745 | __u8 name[32]; /* Label */ |
760 | __u32 type; /* Type of output */ | 746 | __u32 type; /* Type of output */ |
@@ -771,14 +757,12 @@ struct v4l2_output | |||
771 | /* | 757 | /* |
772 | * C O N T R O L S | 758 | * C O N T R O L S |
773 | */ | 759 | */ |
774 | struct v4l2_control | 760 | struct v4l2_control { |
775 | { | ||
776 | __u32 id; | 761 | __u32 id; |
777 | __s32 value; | 762 | __s32 value; |
778 | }; | 763 | }; |
779 | 764 | ||
780 | struct v4l2_ext_control | 765 | struct v4l2_ext_control { |
781 | { | ||
782 | __u32 id; | 766 | __u32 id; |
783 | __u32 reserved2[2]; | 767 | __u32 reserved2[2]; |
784 | union { | 768 | union { |
@@ -788,8 +772,7 @@ struct v4l2_ext_control | |||
788 | }; | 772 | }; |
789 | } __attribute__ ((packed)); | 773 | } __attribute__ ((packed)); |
790 | 774 | ||
791 | struct v4l2_ext_controls | 775 | struct v4l2_ext_controls { |
792 | { | ||
793 | __u32 ctrl_class; | 776 | __u32 ctrl_class; |
794 | __u32 count; | 777 | __u32 count; |
795 | __u32 error_idx; | 778 | __u32 error_idx; |
@@ -807,8 +790,7 @@ struct v4l2_ext_controls | |||
807 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) | 790 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) |
808 | 791 | ||
809 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ | 792 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ |
810 | struct v4l2_queryctrl | 793 | struct v4l2_queryctrl { |
811 | { | ||
812 | __u32 id; | 794 | __u32 id; |
813 | enum v4l2_ctrl_type type; | 795 | enum v4l2_ctrl_type type; |
814 | __u8 name[32]; /* Whatever */ | 796 | __u8 name[32]; /* Whatever */ |
@@ -821,8 +803,7 @@ struct v4l2_queryctrl | |||
821 | }; | 803 | }; |
822 | 804 | ||
823 | /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ | 805 | /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ |
824 | struct v4l2_querymenu | 806 | struct v4l2_querymenu { |
825 | { | ||
826 | __u32 id; | 807 | __u32 id; |
827 | __u32 index; | 808 | __u32 index; |
828 | __u8 name[32]; /* Whatever */ | 809 | __u8 name[32]; /* Whatever */ |
@@ -1104,8 +1085,7 @@ enum v4l2_exposure_auto_type { | |||
1104 | /* | 1085 | /* |
1105 | * T U N I N G | 1086 | * T U N I N G |
1106 | */ | 1087 | */ |
1107 | struct v4l2_tuner | 1088 | struct v4l2_tuner { |
1108 | { | ||
1109 | __u32 index; | 1089 | __u32 index; |
1110 | __u8 name[32]; | 1090 | __u8 name[32]; |
1111 | enum v4l2_tuner_type type; | 1091 | enum v4l2_tuner_type type; |
@@ -1119,8 +1099,7 @@ struct v4l2_tuner | |||
1119 | __u32 reserved[4]; | 1099 | __u32 reserved[4]; |
1120 | }; | 1100 | }; |
1121 | 1101 | ||
1122 | struct v4l2_modulator | 1102 | struct v4l2_modulator { |
1123 | { | ||
1124 | __u32 index; | 1103 | __u32 index; |
1125 | __u8 name[32]; | 1104 | __u8 name[32]; |
1126 | __u32 capability; | 1105 | __u32 capability; |
@@ -1153,8 +1132,7 @@ struct v4l2_modulator | |||
1153 | #define V4L2_TUNER_MODE_LANG1 0x0003 | 1132 | #define V4L2_TUNER_MODE_LANG1 0x0003 |
1154 | #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004 | 1133 | #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004 |
1155 | 1134 | ||
1156 | struct v4l2_frequency | 1135 | struct v4l2_frequency { |
1157 | { | ||
1158 | __u32 tuner; | 1136 | __u32 tuner; |
1159 | enum v4l2_tuner_type type; | 1137 | enum v4l2_tuner_type type; |
1160 | __u32 frequency; | 1138 | __u32 frequency; |
@@ -1172,8 +1150,7 @@ struct v4l2_hw_freq_seek { | |||
1172 | /* | 1150 | /* |
1173 | * A U D I O | 1151 | * A U D I O |
1174 | */ | 1152 | */ |
1175 | struct v4l2_audio | 1153 | struct v4l2_audio { |
1176 | { | ||
1177 | __u32 index; | 1154 | __u32 index; |
1178 | __u8 name[32]; | 1155 | __u8 name[32]; |
1179 | __u32 capability; | 1156 | __u32 capability; |
@@ -1188,8 +1165,7 @@ struct v4l2_audio | |||
1188 | /* Flags for the 'mode' field */ | 1165 | /* Flags for the 'mode' field */ |
1189 | #define V4L2_AUDMODE_AVL 0x00001 | 1166 | #define V4L2_AUDMODE_AVL 0x00001 |
1190 | 1167 | ||
1191 | struct v4l2_audioout | 1168 | struct v4l2_audioout { |
1192 | { | ||
1193 | __u32 index; | 1169 | __u32 index; |
1194 | __u8 name[32]; | 1170 | __u8 name[32]; |
1195 | __u32 capability; | 1171 | __u32 capability; |
@@ -1253,8 +1229,7 @@ struct v4l2_encoder_cmd { | |||
1253 | */ | 1229 | */ |
1254 | 1230 | ||
1255 | /* Raw VBI */ | 1231 | /* Raw VBI */ |
1256 | struct v4l2_vbi_format | 1232 | struct v4l2_vbi_format { |
1257 | { | ||
1258 | __u32 sampling_rate; /* in 1 Hz */ | 1233 | __u32 sampling_rate; /* in 1 Hz */ |
1259 | __u32 offset; | 1234 | __u32 offset; |
1260 | __u32 samples_per_line; | 1235 | __u32 samples_per_line; |
@@ -1266,8 +1241,8 @@ struct v4l2_vbi_format | |||
1266 | }; | 1241 | }; |
1267 | 1242 | ||
1268 | /* VBI flags */ | 1243 | /* VBI flags */ |
1269 | #define V4L2_VBI_UNSYNC (1<< 0) | 1244 | #define V4L2_VBI_UNSYNC (1 << 0) |
1270 | #define V4L2_VBI_INTERLACED (1<< 1) | 1245 | #define V4L2_VBI_INTERLACED (1 << 1) |
1271 | 1246 | ||
1272 | /* Sliced VBI | 1247 | /* Sliced VBI |
1273 | * | 1248 | * |
@@ -1276,8 +1251,7 @@ struct v4l2_vbi_format | |||
1276 | * notice in the definitive implementation. | 1251 | * notice in the definitive implementation. |
1277 | */ | 1252 | */ |
1278 | 1253 | ||
1279 | struct v4l2_sliced_vbi_format | 1254 | struct v4l2_sliced_vbi_format { |
1280 | { | ||
1281 | __u16 service_set; | 1255 | __u16 service_set; |
1282 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field | 1256 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field |
1283 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field | 1257 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field |
@@ -1301,8 +1275,7 @@ struct v4l2_sliced_vbi_format | |||
1301 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) | 1275 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) |
1302 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) | 1276 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) |
1303 | 1277 | ||
1304 | struct v4l2_sliced_vbi_cap | 1278 | struct v4l2_sliced_vbi_cap { |
1305 | { | ||
1306 | __u16 service_set; | 1279 | __u16 service_set; |
1307 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field | 1280 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field |
1308 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field | 1281 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field |
@@ -1313,8 +1286,7 @@ struct v4l2_sliced_vbi_cap | |||
1313 | __u32 reserved[3]; /* must be 0 */ | 1286 | __u32 reserved[3]; /* must be 0 */ |
1314 | }; | 1287 | }; |
1315 | 1288 | ||
1316 | struct v4l2_sliced_vbi_data | 1289 | struct v4l2_sliced_vbi_data { |
1317 | { | ||
1318 | __u32 id; | 1290 | __u32 id; |
1319 | __u32 field; /* 0: first field, 1: second field */ | 1291 | __u32 field; /* 0: first field, 1: second field */ |
1320 | __u32 line; /* 1-23 */ | 1292 | __u32 line; /* 1-23 */ |
@@ -1328,27 +1300,23 @@ struct v4l2_sliced_vbi_data | |||
1328 | 1300 | ||
1329 | /* Stream data format | 1301 | /* Stream data format |
1330 | */ | 1302 | */ |
1331 | struct v4l2_format | 1303 | struct v4l2_format { |
1332 | { | ||
1333 | enum v4l2_buf_type type; | 1304 | enum v4l2_buf_type type; |
1334 | union | 1305 | union { |
1335 | { | 1306 | struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ |
1336 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE | 1307 | struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ |
1337 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY | 1308 | struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ |
1338 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE | 1309 | struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ |
1339 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE | 1310 | __u8 raw_data[200]; /* user-defined */ |
1340 | __u8 raw_data[200]; // user-defined | ||
1341 | } fmt; | 1311 | } fmt; |
1342 | }; | 1312 | }; |
1343 | 1313 | ||
1344 | 1314 | ||
1345 | /* Stream type-dependent parameters | 1315 | /* Stream type-dependent parameters |
1346 | */ | 1316 | */ |
1347 | struct v4l2_streamparm | 1317 | struct v4l2_streamparm { |
1348 | { | ||
1349 | enum v4l2_buf_type type; | 1318 | enum v4l2_buf_type type; |
1350 | union | 1319 | union { |
1351 | { | ||
1352 | struct v4l2_captureparm capture; | 1320 | struct v4l2_captureparm capture; |
1353 | struct v4l2_outputparm output; | 1321 | struct v4l2_outputparm output; |
1354 | __u8 raw_data[200]; /* user-defined */ | 1322 | __u8 raw_data[200]; /* user-defined */ |
@@ -1386,92 +1354,86 @@ struct v4l2_chip_ident { | |||
1386 | * 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 | 1354 | * 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 |
1387 | * | 1355 | * |
1388 | */ | 1356 | */ |
1389 | #define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability) | 1357 | #define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability) |
1390 | #define VIDIOC_RESERVED _IO ('V', 1) | 1358 | #define VIDIOC_RESERVED _IO('V', 1) |
1391 | #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) | 1359 | #define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc) |
1392 | #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) | 1360 | #define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format) |
1393 | #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) | 1361 | #define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format) |
1394 | #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) | 1362 | #define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers) |
1395 | #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) | 1363 | #define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer) |
1396 | #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) | 1364 | #define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer) |
1397 | #define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer) | 1365 | #define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer) |
1398 | #define VIDIOC_OVERLAY _IOW ('V', 14, int) | 1366 | #define VIDIOC_OVERLAY _IOW('V', 14, int) |
1399 | #define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer) | 1367 | #define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer) |
1400 | #define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer) | 1368 | #define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer) |
1401 | #define VIDIOC_STREAMON _IOW ('V', 18, int) | 1369 | #define VIDIOC_STREAMON _IOW('V', 18, int) |
1402 | #define VIDIOC_STREAMOFF _IOW ('V', 19, int) | 1370 | #define VIDIOC_STREAMOFF _IOW('V', 19, int) |
1403 | #define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm) | 1371 | #define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm) |
1404 | #define VIDIOC_S_PARM _IOWR ('V', 22, struct v4l2_streamparm) | 1372 | #define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm) |
1405 | #define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id) | 1373 | #define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id) |
1406 | #define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id) | 1374 | #define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id) |
1407 | #define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard) | 1375 | #define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard) |
1408 | #define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input) | 1376 | #define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input) |
1409 | #define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control) | 1377 | #define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control) |
1410 | #define VIDIOC_S_CTRL _IOWR ('V', 28, struct v4l2_control) | 1378 | #define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control) |
1411 | #define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner) | 1379 | #define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner) |
1412 | #define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner) | 1380 | #define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner) |
1413 | #define VIDIOC_G_AUDIO _IOR ('V', 33, struct v4l2_audio) | 1381 | #define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio) |
1414 | #define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio) | 1382 | #define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio) |
1415 | #define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl) | 1383 | #define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl) |
1416 | #define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu) | 1384 | #define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu) |
1417 | #define VIDIOC_G_INPUT _IOR ('V', 38, int) | 1385 | #define VIDIOC_G_INPUT _IOR('V', 38, int) |
1418 | #define VIDIOC_S_INPUT _IOWR ('V', 39, int) | 1386 | #define VIDIOC_S_INPUT _IOWR('V', 39, int) |
1419 | #define VIDIOC_G_OUTPUT _IOR ('V', 46, int) | 1387 | #define VIDIOC_G_OUTPUT _IOR('V', 46, int) |
1420 | #define VIDIOC_S_OUTPUT _IOWR ('V', 47, int) | 1388 | #define VIDIOC_S_OUTPUT _IOWR('V', 47, int) |
1421 | #define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output) | 1389 | #define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output) |
1422 | #define VIDIOC_G_AUDOUT _IOR ('V', 49, struct v4l2_audioout) | 1390 | #define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout) |
1423 | #define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout) | 1391 | #define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout) |
1424 | #define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator) | 1392 | #define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator) |
1425 | #define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator) | 1393 | #define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator) |
1426 | #define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency) | 1394 | #define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency) |
1427 | #define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency) | 1395 | #define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency) |
1428 | #define VIDIOC_CROPCAP _IOWR ('V', 58, struct v4l2_cropcap) | 1396 | #define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap) |
1429 | #define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop) | 1397 | #define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop) |
1430 | #define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop) | 1398 | #define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop) |
1431 | #define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression) | 1399 | #define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression) |
1432 | #define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression) | 1400 | #define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression) |
1433 | #define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id) | 1401 | #define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id) |
1434 | #define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format) | 1402 | #define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format) |
1435 | #define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio) | 1403 | #define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio) |
1436 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) | 1404 | #define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout) |
1437 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) | 1405 | #define VIDIOC_G_PRIORITY _IOR('V', 67, enum v4l2_priority) |
1438 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) | 1406 | #define VIDIOC_S_PRIORITY _IOW('V', 68, enum v4l2_priority) |
1439 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) | 1407 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap) |
1440 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | 1408 | #define VIDIOC_LOG_STATUS _IO('V', 70) |
1441 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) | 1409 | #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls) |
1442 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) | 1410 | #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls) |
1443 | #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) | 1411 | #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls) |
1444 | #if 1 | 1412 | #if 1 |
1445 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) | 1413 | #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum) |
1446 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) | 1414 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum) |
1447 | #define VIDIOC_G_ENC_INDEX _IOR ('V', 76, struct v4l2_enc_idx) | 1415 | #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) |
1448 | #define VIDIOC_ENCODER_CMD _IOWR ('V', 77, struct v4l2_encoder_cmd) | 1416 | #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) |
1449 | #define VIDIOC_TRY_ENCODER_CMD _IOWR ('V', 78, struct v4l2_encoder_cmd) | 1417 | #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) |
1450 | 1418 | ||
1451 | /* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | 1419 | /* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ |
1452 | #define VIDIOC_DBG_S_REGISTER _IOW ('V', 79, struct v4l2_register) | 1420 | #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_register) |
1453 | #define VIDIOC_DBG_G_REGISTER _IOWR ('V', 80, struct v4l2_register) | 1421 | #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_register) |
1454 | 1422 | ||
1455 | #define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident) | 1423 | #define VIDIOC_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_chip_ident) |
1456 | #endif | 1424 | #endif |
1457 | #define VIDIOC_S_HW_FREQ_SEEK _IOW ('V', 82, struct v4l2_hw_freq_seek) | 1425 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) |
1458 | 1426 | ||
1459 | #ifdef __OLD_VIDIOC_ | 1427 | #ifdef __OLD_VIDIOC_ |
1460 | /* for compatibility, will go away some day */ | 1428 | /* for compatibility, will go away some day */ |
1461 | #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) | 1429 | #define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int) |
1462 | #define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) | 1430 | #define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm) |
1463 | #define VIDIOC_S_CTRL_OLD _IOW ('V', 28, struct v4l2_control) | 1431 | #define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control) |
1464 | #define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) | 1432 | #define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio) |
1465 | #define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) | 1433 | #define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout) |
1466 | #define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) | 1434 | #define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap) |
1467 | #endif | 1435 | #endif |
1468 | 1436 | ||
1469 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ | 1437 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ |
1470 | 1438 | ||
1471 | #endif /* __LINUX_VIDEODEV2_H */ | 1439 | #endif /* __LINUX_VIDEODEV2_H */ |
1472 | |||
1473 | /* | ||
1474 | * Local variables: | ||
1475 | * c-basic-offset: 8 | ||
1476 | * End: | ||
1477 | */ | ||
diff --git a/include/linux/videotext.h b/include/linux/videotext.h index 018f92047ff8..3e68c8d1c7f7 100644 --- a/include/linux/videotext.h +++ b/include/linux/videotext.h | |||
@@ -45,10 +45,10 @@ | |||
45 | #define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */ | 45 | #define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */ |
46 | #define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */ | 46 | #define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */ |
47 | 47 | ||
48 | /* | 48 | /* |
49 | * Definitions for VTXIOCGETINFO | 49 | * Definitions for VTXIOCGETINFO |
50 | */ | 50 | */ |
51 | 51 | ||
52 | #define SAA5243 0 | 52 | #define SAA5243 0 |
53 | #define SAA5246 1 | 53 | #define SAA5246 1 |
54 | #define SAA5249 2 | 54 | #define SAA5249 2 |
@@ -57,10 +57,10 @@ | |||
57 | 57 | ||
58 | typedef struct { | 58 | typedef struct { |
59 | int version_major, version_minor; /* version of driver; if version_major changes, driver */ | 59 | int version_major, version_minor; /* version of driver; if version_major changes, driver */ |
60 | /* is not backward compatible!!! CHECK THIS!!! */ | 60 | /* is not backward compatible!!! CHECK THIS!!! */ |
61 | int numpages; /* number of page-buffers of vtx-chipset */ | 61 | int numpages; /* number of page-buffers of vtx-chipset */ |
62 | int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or | 62 | int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or |
63 | * SAA5249) */ | 63 | * SAA5249) */ |
64 | } | 64 | } |
65 | vtx_info_t; | 65 | vtx_info_t; |
66 | 66 | ||
@@ -81,7 +81,7 @@ vtx_info_t; | |||
81 | #define PGMASK_HOUR (HR_TEN | HR_UNIT) | 81 | #define PGMASK_HOUR (HR_TEN | HR_UNIT) |
82 | #define PGMASK_MINUTE (MIN_TEN | MIN_UNIT) | 82 | #define PGMASK_MINUTE (MIN_TEN | MIN_UNIT) |
83 | 83 | ||
84 | typedef struct | 84 | typedef struct |
85 | { | 85 | { |
86 | int page; /* number of requested page (hexadecimal) */ | 86 | int page; /* number of requested page (hexadecimal) */ |
87 | int hour; /* requested hour (hexadecimal) */ | 87 | int hour; /* requested hour (hexadecimal) */ |
@@ -98,11 +98,11 @@ vtx_pagereq_t; | |||
98 | /* | 98 | /* |
99 | * Definitions for VTXIOC{GETSTAT,PUTSTAT} | 99 | * Definitions for VTXIOC{GETSTAT,PUTSTAT} |
100 | */ | 100 | */ |
101 | 101 | ||
102 | #define VTX_PAGESIZE (40 * 24) | 102 | #define VTX_PAGESIZE (40 * 24) |
103 | #define VTX_VIRTUALSIZE (40 * 49) | 103 | #define VTX_VIRTUALSIZE (40 * 49) |
104 | 104 | ||
105 | typedef struct | 105 | typedef struct |
106 | { | 106 | { |
107 | int pagenum; /* number of page (hexadecimal) */ | 107 | int pagenum; /* number of page (hexadecimal) */ |
108 | int hour; /* hour (hexadecimal) */ | 108 | int hour; /* hour (hexadecimal) */ |
@@ -121,5 +121,5 @@ typedef struct | |||
121 | unsigned hamming : 1; /* hamming-error occurred */ | 121 | unsigned hamming : 1; /* hamming-error occurred */ |
122 | } | 122 | } |
123 | vtx_pageinfo_t; | 123 | vtx_pageinfo_t; |
124 | 124 | ||
125 | #endif /* _VTX_H */ | 125 | #endif /* _VTX_H */ |