diff options
Diffstat (limited to 'Documentation')
27 files changed, 1011 insertions, 159 deletions
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power new file mode 100644 index 000000000000..6123c523bfd7 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-power | |||
@@ -0,0 +1,79 @@ | |||
1 | What: /sys/devices/.../power/ | ||
2 | Date: January 2009 | ||
3 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
4 | Description: | ||
5 | The /sys/devices/.../power directory contains attributes | ||
6 | allowing the user space to check and modify some power | ||
7 | management related properties of given device. | ||
8 | |||
9 | What: /sys/devices/.../power/wakeup | ||
10 | Date: January 2009 | ||
11 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
12 | Description: | ||
13 | The /sys/devices/.../power/wakeup attribute allows the user | ||
14 | space to check if the device is enabled to wake up the system | ||
15 | from sleep states, such as the memory sleep state (suspend to | ||
16 | RAM) and hibernation (suspend to disk), and to enable or disable | ||
17 | it to do that as desired. | ||
18 | |||
19 | Some devices support "wakeup" events, which are hardware signals | ||
20 | used to activate the system from a sleep state. Such devices | ||
21 | have one of the following two values for the sysfs power/wakeup | ||
22 | file: | ||
23 | |||
24 | + "enabled\n" to issue the events; | ||
25 | + "disabled\n" not to do so; | ||
26 | |||
27 | In that cases the user space can change the setting represented | ||
28 | by the contents of this file by writing either "enabled", or | ||
29 | "disabled" to it. | ||
30 | |||
31 | For the devices that are not capable of generating system wakeup | ||
32 | events this file contains "\n". In that cases the user space | ||
33 | cannot modify the contents of this file and the device cannot be | ||
34 | enabled to wake up the system. | ||
35 | |||
36 | What: /sys/devices/.../power/control | ||
37 | Date: January 2009 | ||
38 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
39 | Description: | ||
40 | The /sys/devices/.../power/control attribute allows the user | ||
41 | space to control the run-time power management of the device. | ||
42 | |||
43 | All devices have one of the following two values for the | ||
44 | power/control file: | ||
45 | |||
46 | + "auto\n" to allow the device to be power managed at run time; | ||
47 | + "on\n" to prevent the device from being power managed; | ||
48 | |||
49 | The default for all devices is "auto", which means that they may | ||
50 | be subject to automatic power management, depending on their | ||
51 | drivers. Changing this attribute to "on" prevents the driver | ||
52 | from power managing the device at run time. Doing that while | ||
53 | the device is suspended causes it to be woken up. | ||
54 | |||
55 | What: /sys/devices/.../power/async | ||
56 | Date: January 2009 | ||
57 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
58 | Description: | ||
59 | The /sys/devices/.../async attribute allows the user space to | ||
60 | enable or diasble the device's suspend and resume callbacks to | ||
61 | be executed asynchronously (ie. in separate threads, in parallel | ||
62 | with the main suspend/resume thread) during system-wide power | ||
63 | transitions (eg. suspend to RAM, hibernation). | ||
64 | |||
65 | All devices have one of the following two values for the | ||
66 | power/async file: | ||
67 | |||
68 | + "enabled\n" to permit the asynchronous suspend/resume; | ||
69 | + "disabled\n" to forbid it; | ||
70 | |||
71 | The value of this attribute may be changed by writing either | ||
72 | "enabled", or "disabled" to it. | ||
73 | |||
74 | It generally is unsafe to permit the asynchronous suspend/resume | ||
75 | of a device unless it is certain that all of the PM dependencies | ||
76 | of the device are known to the PM core. However, for some | ||
77 | devices this attribute is set to "enabled" by bus type code or | ||
78 | device drivers and in that cases it should be safe to leave the | ||
79 | default value. | ||
diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power index dcff4d0623ad..d6a801f45b48 100644 --- a/Documentation/ABI/testing/sysfs-power +++ b/Documentation/ABI/testing/sysfs-power | |||
@@ -101,3 +101,16 @@ Description: | |||
101 | 101 | ||
102 | CAUTION: Using it will cause your machine's real-time (CMOS) | 102 | CAUTION: Using it will cause your machine's real-time (CMOS) |
103 | clock to be set to a random invalid time after a resume. | 103 | clock to be set to a random invalid time after a resume. |
104 | |||
105 | What: /sys/power/pm_async | ||
106 | Date: January 2009 | ||
107 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
108 | Description: | ||
109 | The /sys/power/pm_async file controls the switch allowing the | ||
110 | user space to enable or disable asynchronous suspend and resume | ||
111 | of devices. If enabled, this feature will cause some device | ||
112 | drivers' suspend and resume callbacks to be executed in parallel | ||
113 | with each other and with the main suspend thread. It is enabled | ||
114 | if this file contains "1", which is the default. It may be | ||
115 | disabled by writing "0" to this file, in which case all devices | ||
116 | will be suspended and resumed synchronously. | ||
diff --git a/Documentation/DocBook/v4l/io.xml b/Documentation/DocBook/v4l/io.xml index f92f24323b2a..e870330cbf77 100644 --- a/Documentation/DocBook/v4l/io.xml +++ b/Documentation/DocBook/v4l/io.xml | |||
@@ -589,7 +589,8 @@ number of a video input as in &v4l2-input; field | |||
589 | <entry></entry> | 589 | <entry></entry> |
590 | <entry>A place holder for future extensions and custom | 590 | <entry>A place holder for future extensions and custom |
591 | (driver defined) buffer types | 591 | (driver defined) buffer types |
592 | <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher.</entry> | 592 | <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications |
593 | should set this to 0.</entry> | ||
593 | </row> | 594 | </row> |
594 | </tbody> | 595 | </tbody> |
595 | </tgroup> | 596 | </tgroup> |
diff --git a/Documentation/DocBook/v4l/vidioc-qbuf.xml b/Documentation/DocBook/v4l/vidioc-qbuf.xml index 187081778154..b843bd7b3897 100644 --- a/Documentation/DocBook/v4l/vidioc-qbuf.xml +++ b/Documentation/DocBook/v4l/vidioc-qbuf.xml | |||
@@ -54,12 +54,10 @@ to enqueue an empty (capturing) or filled (output) buffer in the | |||
54 | driver's incoming queue. The semantics depend on the selected I/O | 54 | driver's incoming queue. The semantics depend on the selected I/O |
55 | method.</para> | 55 | method.</para> |
56 | 56 | ||
57 | <para>To enqueue a <link linkend="mmap">memory mapped</link> | 57 | <para>To enqueue a buffer applications set the <structfield>type</structfield> |
58 | buffer applications set the <structfield>type</structfield> field of a | 58 | field of a &v4l2-buffer; to the same buffer type as was previously used |
59 | &v4l2-buffer; to the same buffer type as previously &v4l2-format; | 59 | with &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers; |
60 | <structfield>type</structfield> and &v4l2-requestbuffers; | 60 | <structfield>type</structfield>. Applications must also set the |
61 | <structfield>type</structfield>, the <structfield>memory</structfield> | ||
62 | field to <constant>V4L2_MEMORY_MMAP</constant> and the | ||
63 | <structfield>index</structfield> field. Valid index numbers range from | 61 | <structfield>index</structfield> field. Valid index numbers range from |
64 | zero to the number of buffers allocated with &VIDIOC-REQBUFS; | 62 | zero to the number of buffers allocated with &VIDIOC-REQBUFS; |
65 | (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. The | 63 | (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. The |
@@ -70,8 +68,19 @@ intended for output (<structfield>type</structfield> is | |||
70 | <constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>) applications must also | 68 | <constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>) applications must also |
71 | initialize the <structfield>bytesused</structfield>, | 69 | initialize the <structfield>bytesused</structfield>, |
72 | <structfield>field</structfield> and | 70 | <structfield>field</structfield> and |
73 | <structfield>timestamp</structfield> fields. See <xref | 71 | <structfield>timestamp</structfield> fields, see <xref |
74 | linkend="buffer" /> for details. When | 72 | linkend="buffer" /> for details. |
73 | Applications must also set <structfield>flags</structfield> to 0. If a driver | ||
74 | supports capturing from specific video inputs and you want to specify a video | ||
75 | input, then <structfield>flags</structfield> should be set to | ||
76 | <constant>V4L2_BUF_FLAG_INPUT</constant> and the field | ||
77 | <structfield>input</structfield> must be initialized to the desired input. | ||
78 | The <structfield>reserved</structfield> field must be set to 0. | ||
79 | </para> | ||
80 | |||
81 | <para>To enqueue a <link linkend="mmap">memory mapped</link> | ||
82 | buffer applications set the <structfield>memory</structfield> | ||
83 | field to <constant>V4L2_MEMORY_MMAP</constant>. When | ||
75 | <constant>VIDIOC_QBUF</constant> is called with a pointer to this | 84 | <constant>VIDIOC_QBUF</constant> is called with a pointer to this |
76 | structure the driver sets the | 85 | structure the driver sets the |
77 | <constant>V4L2_BUF_FLAG_MAPPED</constant> and | 86 | <constant>V4L2_BUF_FLAG_MAPPED</constant> and |
@@ -81,14 +90,10 @@ structure the driver sets the | |||
81 | &EINVAL;.</para> | 90 | &EINVAL;.</para> |
82 | 91 | ||
83 | <para>To enqueue a <link linkend="userp">user pointer</link> | 92 | <para>To enqueue a <link linkend="userp">user pointer</link> |
84 | buffer applications set the <structfield>type</structfield> field of a | 93 | buffer applications set the <structfield>memory</structfield> |
85 | &v4l2-buffer; to the same buffer type as previously &v4l2-format; | 94 | field to <constant>V4L2_MEMORY_USERPTR</constant>, the |
86 | <structfield>type</structfield> and &v4l2-requestbuffers; | ||
87 | <structfield>type</structfield>, the <structfield>memory</structfield> | ||
88 | field to <constant>V4L2_MEMORY_USERPTR</constant> and the | ||
89 | <structfield>m.userptr</structfield> field to the address of the | 95 | <structfield>m.userptr</structfield> field to the address of the |
90 | buffer and <structfield>length</structfield> to its size. When the | 96 | buffer and <structfield>length</structfield> to its size. |
91 | buffer is intended for output additional fields must be set as above. | ||
92 | When <constant>VIDIOC_QBUF</constant> is called with a pointer to this | 97 | When <constant>VIDIOC_QBUF</constant> is called with a pointer to this |
93 | structure the driver sets the <constant>V4L2_BUF_FLAG_QUEUED</constant> | 98 | structure the driver sets the <constant>V4L2_BUF_FLAG_QUEUED</constant> |
94 | flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and | 99 | flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and |
@@ -96,13 +101,14 @@ flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and | |||
96 | <structfield>flags</structfield> field, or it returns an error code. | 101 | <structfield>flags</structfield> field, or it returns an error code. |
97 | This ioctl locks the memory pages of the buffer in physical memory, | 102 | This ioctl locks the memory pages of the buffer in physical memory, |
98 | they cannot be swapped out to disk. Buffers remain locked until | 103 | they cannot be swapped out to disk. Buffers remain locked until |
99 | dequeued, until the &VIDIOC-STREAMOFF; or &VIDIOC-REQBUFS; ioctl are | 104 | dequeued, until the &VIDIOC-STREAMOFF; or &VIDIOC-REQBUFS; ioctl is |
100 | called, or until the device is closed.</para> | 105 | called, or until the device is closed.</para> |
101 | 106 | ||
102 | <para>Applications call the <constant>VIDIOC_DQBUF</constant> | 107 | <para>Applications call the <constant>VIDIOC_DQBUF</constant> |
103 | ioctl to dequeue a filled (capturing) or displayed (output) buffer | 108 | ioctl to dequeue a filled (capturing) or displayed (output) buffer |
104 | from the driver's outgoing queue. They just set the | 109 | from the driver's outgoing queue. They just set the |
105 | <structfield>type</structfield> and <structfield>memory</structfield> | 110 | <structfield>type</structfield>, <structfield>memory</structfield> |
111 | and <structfield>reserved</structfield> | ||
106 | fields of a &v4l2-buffer; as above, when <constant>VIDIOC_DQBUF</constant> | 112 | fields of a &v4l2-buffer; as above, when <constant>VIDIOC_DQBUF</constant> |
107 | is called with a pointer to this structure the driver fills the | 113 | is called with a pointer to this structure the driver fills the |
108 | remaining fields or returns an error code.</para> | 114 | remaining fields or returns an error code.</para> |
diff --git a/Documentation/DocBook/v4l/vidioc-querybuf.xml b/Documentation/DocBook/v4l/vidioc-querybuf.xml index d834993e6191..e649805a4908 100644 --- a/Documentation/DocBook/v4l/vidioc-querybuf.xml +++ b/Documentation/DocBook/v4l/vidioc-querybuf.xml | |||
@@ -54,12 +54,13 @@ buffer at any time after buffers have been allocated with the | |||
54 | &VIDIOC-REQBUFS; ioctl.</para> | 54 | &VIDIOC-REQBUFS; ioctl.</para> |
55 | 55 | ||
56 | <para>Applications set the <structfield>type</structfield> field | 56 | <para>Applications set the <structfield>type</structfield> field |
57 | of a &v4l2-buffer; to the same buffer type as previously | 57 | of a &v4l2-buffer; to the same buffer type as was previously used with |
58 | &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers; | 58 | &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers; |
59 | <structfield>type</structfield>, and the <structfield>index</structfield> | 59 | <structfield>type</structfield>, and the <structfield>index</structfield> |
60 | field. Valid index numbers range from zero | 60 | field. Valid index numbers range from zero |
61 | to the number of buffers allocated with &VIDIOC-REQBUFS; | 61 | to the number of buffers allocated with &VIDIOC-REQBUFS; |
62 | (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. | 62 | (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. |
63 | The <structfield>reserved</structfield> field should to set to 0. | ||
63 | After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to | 64 | After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to |
64 | this structure drivers return an error code or fill the rest of | 65 | this structure drivers return an error code or fill the rest of |
65 | the structure.</para> | 66 | the structure.</para> |
@@ -68,8 +69,8 @@ the structure.</para> | |||
68 | <constant>V4L2_BUF_FLAG_MAPPED</constant>, | 69 | <constant>V4L2_BUF_FLAG_MAPPED</constant>, |
69 | <constant>V4L2_BUF_FLAG_QUEUED</constant> and | 70 | <constant>V4L2_BUF_FLAG_QUEUED</constant> and |
70 | <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The | 71 | <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The |
71 | <structfield>memory</structfield> field will be set to | 72 | <structfield>memory</structfield> field will be set to the current |
72 | <constant>V4L2_MEMORY_MMAP</constant>, the <structfield>m.offset</structfield> | 73 | I/O method, the <structfield>m.offset</structfield> |
73 | contains the offset of the buffer from the start of the device memory, | 74 | contains the offset of the buffer from the start of the device memory, |
74 | the <structfield>length</structfield> field its size. The driver may | 75 | the <structfield>length</structfield> field its size. The driver may |
75 | or may not set the remaining fields and flags, they are meaningless in | 76 | or may not set the remaining fields and flags, they are meaningless in |
diff --git a/Documentation/DocBook/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/v4l/vidioc-reqbufs.xml index bab38084454f..1c0816372074 100644 --- a/Documentation/DocBook/v4l/vidioc-reqbufs.xml +++ b/Documentation/DocBook/v4l/vidioc-reqbufs.xml | |||
@@ -54,23 +54,23 @@ I/O. Memory mapped buffers are located in device memory and must be | |||
54 | allocated with this ioctl before they can be mapped into the | 54 | allocated with this ioctl before they can be mapped into the |
55 | application's address space. User buffers are allocated by | 55 | application's address space. User buffers are allocated by |
56 | applications themselves, and this ioctl is merely used to switch the | 56 | applications themselves, and this ioctl is merely used to switch the |
57 | driver into user pointer I/O mode.</para> | 57 | driver into user pointer I/O mode and to setup some internal structures.</para> |
58 | 58 | ||
59 | <para>To allocate device buffers applications initialize three | 59 | <para>To allocate device buffers applications initialize all |
60 | fields of a <structname>v4l2_requestbuffers</structname> structure. | 60 | fields of the <structname>v4l2_requestbuffers</structname> structure. |
61 | They set the <structfield>type</structfield> field to the respective | 61 | They set the <structfield>type</structfield> field to the respective |
62 | stream or buffer type, the <structfield>count</structfield> field to | 62 | stream or buffer type, the <structfield>count</structfield> field to |
63 | the desired number of buffers, and <structfield>memory</structfield> | 63 | the desired number of buffers, <structfield>memory</structfield> |
64 | must be set to <constant>V4L2_MEMORY_MMAP</constant>. When the ioctl | 64 | must be set to the requested I/O method and the reserved array |
65 | is called with a pointer to this structure the driver attempts to | 65 | must be zeroed. When the ioctl |
66 | allocate the requested number of buffers and stores the actual number | 66 | is called with a pointer to this structure the driver will attempt to allocate |
67 | the requested number of buffers and it stores the actual number | ||
67 | allocated in the <structfield>count</structfield> field. It can be | 68 | allocated in the <structfield>count</structfield> field. It can be |
68 | smaller than the number requested, even zero, when the driver runs out | 69 | smaller than the number requested, even zero, when the driver runs out |
69 | of free memory. A larger number is possible when the driver requires | 70 | of free memory. A larger number is also possible when the driver requires |
70 | more buffers to function correctly.<footnote> | 71 | more buffers to function correctly. For example video output requires at least two buffers, |
71 | <para>For example video output requires at least two buffers, | ||
72 | one displayed and one filled by the application.</para> | 72 | one displayed and one filled by the application.</para> |
73 | </footnote> When memory mapping I/O is not supported the ioctl | 73 | <para>When the I/O method is not supported the ioctl |
74 | returns an &EINVAL;.</para> | 74 | returns an &EINVAL;.</para> |
75 | 75 | ||
76 | <para>Applications can call <constant>VIDIOC_REQBUFS</constant> | 76 | <para>Applications can call <constant>VIDIOC_REQBUFS</constant> |
@@ -81,14 +81,6 @@ in progress, an implicit &VIDIOC-STREAMOFF;. <!-- mhs: I see no | |||
81 | reason why munmap()ping one or even all buffers must imply | 81 | reason why munmap()ping one or even all buffers must imply |
82 | streamoff.--></para> | 82 | streamoff.--></para> |
83 | 83 | ||
84 | <para>To negotiate user pointer I/O, applications initialize only | ||
85 | the <structfield>type</structfield> field and set | ||
86 | <structfield>memory</structfield> to | ||
87 | <constant>V4L2_MEMORY_USERPTR</constant>. When the ioctl is called | ||
88 | with a pointer to this structure the driver prepares for user pointer | ||
89 | I/O, when this I/O method is not supported the ioctl returns an | ||
90 | &EINVAL;.</para> | ||
91 | |||
92 | <table pgwide="1" frame="none" id="v4l2-requestbuffers"> | 84 | <table pgwide="1" frame="none" id="v4l2-requestbuffers"> |
93 | <title>struct <structname>v4l2_requestbuffers</structname></title> | 85 | <title>struct <structname>v4l2_requestbuffers</structname></title> |
94 | <tgroup cols="3"> | 86 | <tgroup cols="3"> |
@@ -97,9 +89,7 @@ I/O, when this I/O method is not supported the ioctl returns an | |||
97 | <row> | 89 | <row> |
98 | <entry>__u32</entry> | 90 | <entry>__u32</entry> |
99 | <entry><structfield>count</structfield></entry> | 91 | <entry><structfield>count</structfield></entry> |
100 | <entry>The number of buffers requested or granted. This | 92 | <entry>The number of buffers requested or granted.</entry> |
101 | field is only used when <structfield>memory</structfield> is set to | ||
102 | <constant>V4L2_MEMORY_MMAP</constant>.</entry> | ||
103 | </row> | 93 | </row> |
104 | <row> | 94 | <row> |
105 | <entry>&v4l2-buf-type;</entry> | 95 | <entry>&v4l2-buf-type;</entry> |
@@ -120,7 +110,7 @@ as the &v4l2-format; <structfield>type</structfield> field. See <xref | |||
120 | <entry><structfield>reserved</structfield>[2]</entry> | 110 | <entry><structfield>reserved</structfield>[2]</entry> |
121 | <entry>A place holder for future extensions and custom | 111 | <entry>A place holder for future extensions and custom |
122 | (driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and | 112 | (driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and |
123 | higher.</entry> | 113 | higher. This array should be zeroed by applications.</entry> |
124 | </row> | 114 | </row> |
125 | </tbody> | 115 | </tbody> |
126 | </tgroup> | 116 | </tgroup> |
diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt index da42ab414c48..b231414bb8bc 100644 --- a/Documentation/cachetlb.txt +++ b/Documentation/cachetlb.txt | |||
@@ -377,3 +377,27 @@ maps this page at its virtual address. | |||
377 | All the functionality of flush_icache_page can be implemented in | 377 | All the functionality of flush_icache_page can be implemented in |
378 | flush_dcache_page and update_mmu_cache. In 2.7 the hope is to | 378 | flush_dcache_page and update_mmu_cache. In 2.7 the hope is to |
379 | remove this interface completely. | 379 | remove this interface completely. |
380 | |||
381 | The final category of APIs is for I/O to deliberately aliased address | ||
382 | ranges inside the kernel. Such aliases are set up by use of the | ||
383 | vmap/vmalloc API. Since kernel I/O goes via physical pages, the I/O | ||
384 | subsystem assumes that the user mapping and kernel offset mapping are | ||
385 | the only aliases. This isn't true for vmap aliases, so anything in | ||
386 | the kernel trying to do I/O to vmap areas must manually manage | ||
387 | coherency. It must do this by flushing the vmap range before doing | ||
388 | I/O and invalidating it after the I/O returns. | ||
389 | |||
390 | void flush_kernel_vmap_range(void *vaddr, int size) | ||
391 | flushes the kernel cache for a given virtual address range in | ||
392 | the vmap area. This is to make sure that any data the kernel | ||
393 | modified in the vmap range is made visible to the physical | ||
394 | page. The design is to make this area safe to perform I/O on. | ||
395 | Note that this API does *not* also flush the offset map alias | ||
396 | of the area. | ||
397 | |||
398 | void invalidate_kernel_vmap_range(void *vaddr, int size) invalidates | ||
399 | the cache for a given virtual address range in the vmap area | ||
400 | which prevents the processor from making the cache stale by | ||
401 | speculatively reading data while the I/O was occurring to the | ||
402 | physical pages. This is only necessary for data reads into the | ||
403 | vmap area. | ||
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index 3ad6acead949..d9bcffd59433 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -69,7 +69,6 @@ av_permissions.h | |||
69 | bbootsect | 69 | bbootsect |
70 | bin2c | 70 | bin2c |
71 | binkernel.spec | 71 | binkernel.spec |
72 | binoffset | ||
73 | bootsect | 72 | bootsect |
74 | bounds.h | 73 | bounds.h |
75 | bsetup | 74 | bsetup |
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware index 14b7b5a3bcb9..239cbdbf4d12 100644 --- a/Documentation/dvb/get_dvb_firmware +++ b/Documentation/dvb/get_dvb_firmware | |||
@@ -26,7 +26,7 @@ use IO::Handle; | |||
26 | "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", | 26 | "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", |
27 | "or51211", "or51132_qam", "or51132_vsb", "bluebird", | 27 | "or51211", "or51132_qam", "or51132_vsb", "bluebird", |
28 | "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", | 28 | "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", |
29 | "af9015"); | 29 | "af9015", "ngene"); |
30 | 30 | ||
31 | # Check args | 31 | # Check args |
32 | syntax() if (scalar(@ARGV) != 1); | 32 | syntax() if (scalar(@ARGV) != 1); |
@@ -39,7 +39,7 @@ for ($i=0; $i < scalar(@components); $i++) { | |||
39 | die $@ if $@; | 39 | die $@ if $@; |
40 | print STDERR <<EOF; | 40 | print STDERR <<EOF; |
41 | Firmware(s) $outfile extracted successfully. | 41 | Firmware(s) $outfile extracted successfully. |
42 | Now copy it(they) to either /usr/lib/hotplug/firmware or /lib/firmware | 42 | Now copy it(them) to either /usr/lib/hotplug/firmware or /lib/firmware |
43 | (depending on configuration of firmware hotplug). | 43 | (depending on configuration of firmware hotplug). |
44 | EOF | 44 | EOF |
45 | exit(0); | 45 | exit(0); |
@@ -549,6 +549,24 @@ sub af9015 { | |||
549 | close INFILE; | 549 | close INFILE; |
550 | } | 550 | } |
551 | 551 | ||
552 | sub ngene { | ||
553 | my $url = "http://www.digitaldevices.de/download/"; | ||
554 | my $file1 = "ngene_15.fw"; | ||
555 | my $hash1 = "d798d5a757121174f0dbc5f2833c0c85"; | ||
556 | my $file2 = "ngene_17.fw"; | ||
557 | my $hash2 = "26b687136e127b8ac24b81e0eeafc20b"; | ||
558 | |||
559 | checkstandard(); | ||
560 | |||
561 | wgetfile($file1, $url . $file1); | ||
562 | verify($file1, $hash1); | ||
563 | |||
564 | wgetfile($file2, $url . $file2); | ||
565 | verify($file2, $hash2); | ||
566 | |||
567 | "$file1, $file2"; | ||
568 | } | ||
569 | |||
552 | # --------------------------------------------------------------- | 570 | # --------------------------------------------------------------- |
553 | # Utilities | 571 | # Utilities |
554 | 572 | ||
@@ -667,6 +685,7 @@ sub delzero{ | |||
667 | sub syntax() { | 685 | sub syntax() { |
668 | print STDERR "syntax: get_dvb_firmware <component>\n"; | 686 | print STDERR "syntax: get_dvb_firmware <component>\n"; |
669 | print STDERR "Supported components:\n"; | 687 | print STDERR "Supported components:\n"; |
688 | @components = sort @components; | ||
670 | for($i=0; $i < scalar(@components); $i++) { | 689 | for($i=0; $i < scalar(@components); $i++) { |
671 | print STDERR "\t" . $components[$i] . "\n"; | 690 | print STDERR "\t" . $components[$i] . "\n"; |
672 | } | 691 | } |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 0a46833c1b76..b9eba900e0f0 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -64,6 +64,17 @@ Who: Robin Getz <rgetz@blackfin.uclinux.org> & Matt Mackall <mpm@selenic.com> | |||
64 | 64 | ||
65 | --------------------------- | 65 | --------------------------- |
66 | 66 | ||
67 | What: Deprecated snapshot ioctls | ||
68 | When: 2.6.36 | ||
69 | |||
70 | Why: The ioctls in kernel/power/user.c were marked as deprecated long time | ||
71 | ago. Now they notify users about that so that they need to replace | ||
72 | their userspace. After some more time, remove them completely. | ||
73 | |||
74 | Who: Jiri Slaby <jirislaby@gmail.com> | ||
75 | |||
76 | --------------------------- | ||
77 | |||
67 | What: The ieee80211_regdom module parameter | 78 | What: The ieee80211_regdom module parameter |
68 | When: March 2010 / desktop catchup | 79 | When: March 2010 / desktop catchup |
69 | 80 | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 736d45602886..db611e195ebb 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -199,6 +199,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
199 | acpi_display_output=video | 199 | acpi_display_output=video |
200 | See above. | 200 | See above. |
201 | 201 | ||
202 | acpi_early_pdc_eval [HW,ACPI] Evaluate processor _PDC methods | ||
203 | early. Needed on some platforms to properly | ||
204 | initialize the EC. | ||
205 | |||
202 | acpi_irq_balance [HW,ACPI] | 206 | acpi_irq_balance [HW,ACPI] |
203 | ACPI will balance active IRQs | 207 | ACPI will balance active IRQs |
204 | default in APIC mode | 208 | default in APIC mode |
@@ -311,6 +315,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
311 | aic79xx= [HW,SCSI] | 315 | aic79xx= [HW,SCSI] |
312 | See Documentation/scsi/aic79xx.txt. | 316 | See Documentation/scsi/aic79xx.txt. |
313 | 317 | ||
318 | alignment= [KNL,ARM] | ||
319 | Allow the default userspace alignment fault handler | ||
320 | behaviour to be specified. Bit 0 enables warnings, | ||
321 | bit 1 enables fixups, and bit 2 sends a segfault. | ||
322 | |||
314 | amd_iommu= [HW,X86-84] | 323 | amd_iommu= [HW,X86-84] |
315 | Pass parameters to the AMD IOMMU driver in the system. | 324 | Pass parameters to the AMD IOMMU driver in the system. |
316 | Possible values are: | 325 | Possible values are: |
@@ -1729,6 +1738,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1729 | nomfgpt [X86-32] Disable Multi-Function General Purpose | 1738 | nomfgpt [X86-32] Disable Multi-Function General Purpose |
1730 | Timer usage (for AMD Geode machines). | 1739 | Timer usage (for AMD Geode machines). |
1731 | 1740 | ||
1741 | nopat [X86] Disable PAT (page attribute table extension of | ||
1742 | pagetables) support. | ||
1743 | |||
1732 | norandmaps Don't use address space randomization. Equivalent to | 1744 | norandmaps Don't use address space randomization. Equivalent to |
1733 | echo 0 > /proc/sys/kernel/randomize_va_space | 1745 | echo 0 > /proc/sys/kernel/randomize_va_space |
1734 | 1746 | ||
@@ -1939,8 +1951,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1939 | IRQ routing is enabled. | 1951 | IRQ routing is enabled. |
1940 | noacpi [X86] Do not use ACPI for IRQ routing | 1952 | noacpi [X86] Do not use ACPI for IRQ routing |
1941 | or for PCI scanning. | 1953 | or for PCI scanning. |
1942 | use_crs [X86] Use _CRS for PCI resource | 1954 | use_crs [X86] Use PCI host bridge window information |
1943 | allocation. | 1955 | from ACPI. On BIOSes from 2008 or later, this |
1956 | is enabled by default. If you need to use this, | ||
1957 | please report a bug. | ||
1958 | nocrs [X86] Ignore PCI host bridge windows from ACPI. | ||
1959 | If you need to use this, please report a bug. | ||
1944 | routeirq Do IRQ routing for all PCI devices. | 1960 | routeirq Do IRQ routing for all PCI devices. |
1945 | This is normally done in pci_enable_device(), | 1961 | This is normally done in pci_enable_device(), |
1946 | so this option is a temporary workaround | 1962 | so this option is a temporary workaround |
@@ -1989,6 +2005,14 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1989 | force Enable ASPM even on devices that claim not to support it. | 2005 | force Enable ASPM even on devices that claim not to support it. |
1990 | WARNING: Forcing ASPM on may cause system lockups. | 2006 | WARNING: Forcing ASPM on may cause system lockups. |
1991 | 2007 | ||
2008 | pcie_pme= [PCIE,PM] Native PCIe PME signaling options: | ||
2009 | off Do not use native PCIe PME signaling. | ||
2010 | force Use native PCIe PME signaling even if the BIOS refuses | ||
2011 | to allow the kernel to control the relevant PCIe config | ||
2012 | registers. | ||
2013 | nomsi Do not use MSI for native PCIe PME signaling (this makes | ||
2014 | all PCIe root ports use INTx for everything). | ||
2015 | |||
1992 | pcmv= [HW,PCMCIA] BadgePAD 4 | 2016 | pcmv= [HW,PCMCIA] BadgePAD 4 |
1993 | 2017 | ||
1994 | pd. [PARIDE] | 2018 | pd. [PARIDE] |
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 42208511b5c0..3119f5db75bd 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <sys/uio.h> | 34 | #include <sys/uio.h> |
35 | #include <termios.h> | 35 | #include <termios.h> |
36 | #include <getopt.h> | 36 | #include <getopt.h> |
37 | #include <zlib.h> | ||
38 | #include <assert.h> | 37 | #include <assert.h> |
39 | #include <sched.h> | 38 | #include <sched.h> |
40 | #include <limits.h> | 39 | #include <limits.h> |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 006b39dec87d..e87f3cdc8a6a 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -1074,10 +1074,10 @@ regen_max_retry - INTEGER | |||
1074 | Default: 5 | 1074 | Default: 5 |
1075 | 1075 | ||
1076 | max_addresses - INTEGER | 1076 | max_addresses - INTEGER |
1077 | Number of maximum addresses per interface. 0 disables limitation. | 1077 | Maximum number of autoconfigured addresses per interface. Setting |
1078 | It is recommended not set too large value (or 0) because it would | 1078 | to zero disables the limitation. It is not recommended to set this |
1079 | be too easy way to crash kernel to allow to create too much of | 1079 | value too large (or to zero) because it would be an easy way to |
1080 | autoconfigured addresses. | 1080 | crash the kernel by allowing too many addresses to be created. |
1081 | Default: 16 | 1081 | Default: 16 |
1082 | 1082 | ||
1083 | disable_ipv6 - BOOLEAN | 1083 | disable_ipv6 - BOOLEAN |
diff --git a/Documentation/pcmcia/locking.txt b/Documentation/pcmcia/locking.txt new file mode 100644 index 000000000000..68f622bc4064 --- /dev/null +++ b/Documentation/pcmcia/locking.txt | |||
@@ -0,0 +1,118 @@ | |||
1 | This file explains the locking and exclusion scheme used in the PCCARD | ||
2 | and PCMCIA subsystems. | ||
3 | |||
4 | |||
5 | A) Overview, Locking Hierarchy: | ||
6 | =============================== | ||
7 | |||
8 | pcmcia_socket_list_rwsem - protects only the list of sockets | ||
9 | - skt_mutex - serializes card insert / ejection | ||
10 | - ops_mutex - serializes socket operation | ||
11 | |||
12 | |||
13 | B) Exclusion | ||
14 | ============ | ||
15 | |||
16 | The following functions and callbacks to struct pcmcia_socket must | ||
17 | be called with "skt_mutex" held: | ||
18 | |||
19 | socket_detect_change() | ||
20 | send_event() | ||
21 | socket_reset() | ||
22 | socket_shutdown() | ||
23 | socket_setup() | ||
24 | socket_remove() | ||
25 | socket_insert() | ||
26 | socket_early_resume() | ||
27 | socket_late_resume() | ||
28 | socket_resume() | ||
29 | socket_suspend() | ||
30 | |||
31 | struct pcmcia_callback *callback | ||
32 | |||
33 | The following functions and callbacks to struct pcmcia_socket must | ||
34 | be called with "ops_mutex" held: | ||
35 | |||
36 | socket_reset() | ||
37 | socket_setup() | ||
38 | |||
39 | struct pccard_operations *ops | ||
40 | struct pccard_resource_ops *resource_ops; | ||
41 | |||
42 | Note that send_event() and struct pcmcia_callback *callback must not be | ||
43 | called with "ops_mutex" held. | ||
44 | |||
45 | |||
46 | C) Protection | ||
47 | ============= | ||
48 | |||
49 | 1. Global Data: | ||
50 | --------------- | ||
51 | struct list_head pcmcia_socket_list; | ||
52 | |||
53 | protected by pcmcia_socket_list_rwsem; | ||
54 | |||
55 | |||
56 | 2. Per-Socket Data: | ||
57 | ------------------- | ||
58 | The resource_ops and their data are protected by ops_mutex. | ||
59 | |||
60 | The "main" struct pcmcia_socket is protected as follows (read-only fields | ||
61 | or single-use fields not mentioned): | ||
62 | |||
63 | - by pcmcia_socket_list_rwsem: | ||
64 | struct list_head socket_list; | ||
65 | |||
66 | - by thread_lock: | ||
67 | unsigned int thread_events; | ||
68 | |||
69 | - by skt_mutex: | ||
70 | u_int suspended_state; | ||
71 | void (*tune_bridge); | ||
72 | struct pcmcia_callback *callback; | ||
73 | int resume_status; | ||
74 | |||
75 | - by ops_mutex: | ||
76 | socket_state_t socket; | ||
77 | u_int state; | ||
78 | u_short lock_count; | ||
79 | pccard_mem_map cis_mem; | ||
80 | void __iomem *cis_virt; | ||
81 | struct { } irq; | ||
82 | io_window_t io[]; | ||
83 | pccard_mem_map win[]; | ||
84 | struct list_head cis_cache; | ||
85 | size_t fake_cis_len; | ||
86 | u8 *fake_cis; | ||
87 | u_int irq_mask; | ||
88 | void (*zoom_video); | ||
89 | int (*power_hook); | ||
90 | u8 resource...; | ||
91 | struct list_head devices_list; | ||
92 | u8 device_count; | ||
93 | struct pcmcia_state; | ||
94 | |||
95 | |||
96 | 3. Per PCMCIA-device Data: | ||
97 | -------------------------- | ||
98 | |||
99 | The "main" struct pcmcia_devie is protected as follows (read-only fields | ||
100 | or single-use fields not mentioned): | ||
101 | |||
102 | |||
103 | - by pcmcia_socket->ops_mutex: | ||
104 | struct list_head socket_device_list; | ||
105 | struct config_t *function_config; | ||
106 | u16 _irq:1; | ||
107 | u16 _io:1; | ||
108 | u16 _win:4; | ||
109 | u16 _locked:1; | ||
110 | u16 allow_func_id_match:1; | ||
111 | u16 suspended:1; | ||
112 | u16 _removed:1; | ||
113 | |||
114 | - by the PCMCIA driver: | ||
115 | io_req_t io; | ||
116 | irq_req_t irq; | ||
117 | config_req_t conf; | ||
118 | window_handle_t win; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt b/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt new file mode 100644 index 000000000000..8832e8798912 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | MPC5121 PSC Device Tree Bindings | ||
2 | |||
3 | PSC in UART mode | ||
4 | ---------------- | ||
5 | |||
6 | For PSC in UART mode the needed PSC serial devices | ||
7 | are specified by fsl,mpc5121-psc-uart nodes in the | ||
8 | fsl,mpc5121-immr SoC node. Additionally the PSC FIFO | ||
9 | Controller node fsl,mpc5121-psc-fifo is requered there: | ||
10 | |||
11 | fsl,mpc5121-psc-uart nodes | ||
12 | -------------------------- | ||
13 | |||
14 | Required properties : | ||
15 | - compatible : Should contain "fsl,mpc5121-psc-uart" and "fsl,mpc5121-psc" | ||
16 | - cell-index : Index of the PSC in hardware | ||
17 | - reg : Offset and length of the register set for the PSC device | ||
18 | - interrupts : <a b> where a is the interrupt number of the | ||
19 | PSC FIFO Controller and b is a field that represents an | ||
20 | encoding of the sense and level information for the interrupt. | ||
21 | - interrupt-parent : the phandle for the interrupt controller that | ||
22 | services interrupts for this device. | ||
23 | |||
24 | Recommended properties : | ||
25 | - fsl,rx-fifo-size : the size of the RX fifo slice (a multiple of 4) | ||
26 | - fsl,tx-fifo-size : the size of the TX fifo slice (a multiple of 4) | ||
27 | |||
28 | |||
29 | fsl,mpc5121-psc-fifo node | ||
30 | ------------------------- | ||
31 | |||
32 | Required properties : | ||
33 | - compatible : Should be "fsl,mpc5121-psc-fifo" | ||
34 | - reg : Offset and length of the register set for the PSC | ||
35 | FIFO Controller | ||
36 | - interrupts : <a b> where a is the interrupt number of the | ||
37 | PSC FIFO Controller and b is a field that represents an | ||
38 | encoding of the sense and level information for the interrupt. | ||
39 | - interrupt-parent : the phandle for the interrupt controller that | ||
40 | services interrupts for this device. | ||
41 | |||
42 | |||
43 | Example for a board using PSC0 and PSC1 devices in serial mode: | ||
44 | |||
45 | serial@11000 { | ||
46 | compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc"; | ||
47 | cell-index = <0>; | ||
48 | reg = <0x11000 0x100>; | ||
49 | interrupts = <40 0x8>; | ||
50 | interrupt-parent = < &ipic >; | ||
51 | fsl,rx-fifo-size = <16>; | ||
52 | fsl,tx-fifo-size = <16>; | ||
53 | }; | ||
54 | |||
55 | serial@11100 { | ||
56 | compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc"; | ||
57 | cell-index = <1>; | ||
58 | reg = <0x11100 0x100>; | ||
59 | interrupts = <40 0x8>; | ||
60 | interrupt-parent = < &ipic >; | ||
61 | fsl,rx-fifo-size = <16>; | ||
62 | fsl,tx-fifo-size = <16>; | ||
63 | }; | ||
64 | |||
65 | pscfifo@11f00 { | ||
66 | compatible = "fsl,mpc5121-psc-fifo"; | ||
67 | reg = <0x11f00 0x100>; | ||
68 | interrupts = <40 0x8>; | ||
69 | interrupt-parent = < &ipic >; | ||
70 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt index e7d9a344c4f4..80510c018eea 100644 --- a/Documentation/powerpc/dts-bindings/fsl/spi.txt +++ b/Documentation/powerpc/dts-bindings/fsl/spi.txt | |||
@@ -13,6 +13,11 @@ Required properties: | |||
13 | - interrupt-parent : the phandle for the interrupt controller that | 13 | - interrupt-parent : the phandle for the interrupt controller that |
14 | services interrupts for this device. | 14 | services interrupts for this device. |
15 | 15 | ||
16 | Optional properties: | ||
17 | - gpios : specifies the gpio pins to be used for chipselects. | ||
18 | The gpios will be referred to as reg = <index> in the SPI child nodes. | ||
19 | If unspecified, a single SPI device without a chip select can be used. | ||
20 | |||
16 | Example: | 21 | Example: |
17 | spi@4c0 { | 22 | spi@4c0 { |
18 | cell-index = <0>; | 23 | cell-index = <0>; |
@@ -21,4 +26,6 @@ Example: | |||
21 | interrupts = <82 0>; | 26 | interrupts = <82 0>; |
22 | interrupt-parent = <700>; | 27 | interrupt-parent = <700>; |
23 | mode = "cpu"; | 28 | mode = "cpu"; |
29 | gpios = <&gpio 18 1 // device reg=<0> | ||
30 | &gpio 19 1>; // device reg=<1> | ||
24 | }; | 31 | }; |
diff --git a/Documentation/powerpc/ptrace.txt b/Documentation/powerpc/ptrace.txt new file mode 100644 index 000000000000..f4a5499b7bc6 --- /dev/null +++ b/Documentation/powerpc/ptrace.txt | |||
@@ -0,0 +1,134 @@ | |||
1 | GDB intends to support the following hardware debug features of BookE | ||
2 | processors: | ||
3 | |||
4 | 4 hardware breakpoints (IAC) | ||
5 | 2 hardware watchpoints (read, write and read-write) (DAC) | ||
6 | 2 value conditions for the hardware watchpoints (DVC) | ||
7 | |||
8 | For that, we need to extend ptrace so that GDB can query and set these | ||
9 | resources. Since we're extending, we're trying to create an interface | ||
10 | that's extendable and that covers both BookE and server processors, so | ||
11 | that GDB doesn't need to special-case each of them. We added the | ||
12 | following 3 new ptrace requests. | ||
13 | |||
14 | 1. PTRACE_PPC_GETHWDEBUGINFO | ||
15 | |||
16 | Query for GDB to discover the hardware debug features. The main info to | ||
17 | be returned here is the minimum alignment for the hardware watchpoints. | ||
18 | BookE processors don't have restrictions here, but server processors have | ||
19 | an 8-byte alignment restriction for hardware watchpoints. We'd like to avoid | ||
20 | adding special cases to GDB based on what it sees in AUXV. | ||
21 | |||
22 | Since we're at it, we added other useful info that the kernel can return to | ||
23 | GDB: this query will return the number of hardware breakpoints, hardware | ||
24 | watchpoints and whether it supports a range of addresses and a condition. | ||
25 | The query will fill the following structure provided by the requesting process: | ||
26 | |||
27 | struct ppc_debug_info { | ||
28 | unit32_t version; | ||
29 | unit32_t num_instruction_bps; | ||
30 | unit32_t num_data_bps; | ||
31 | unit32_t num_condition_regs; | ||
32 | unit32_t data_bp_alignment; | ||
33 | unit32_t sizeof_condition; /* size of the DVC register */ | ||
34 | uint64_t features; /* bitmask of the individual flags */ | ||
35 | }; | ||
36 | |||
37 | features will have bits indicating whether there is support for: | ||
38 | |||
39 | #define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1 | ||
40 | #define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2 | ||
41 | #define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4 | ||
42 | #define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8 | ||
43 | |||
44 | 2. PTRACE_SETHWDEBUG | ||
45 | |||
46 | Sets a hardware breakpoint or watchpoint, according to the provided structure: | ||
47 | |||
48 | struct ppc_hw_breakpoint { | ||
49 | uint32_t version; | ||
50 | #define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1 | ||
51 | #define PPC_BREAKPOINT_TRIGGER_READ 0x2 | ||
52 | #define PPC_BREAKPOINT_TRIGGER_WRITE 0x4 | ||
53 | uint32_t trigger_type; /* only some combinations allowed */ | ||
54 | #define PPC_BREAKPOINT_MODE_EXACT 0x0 | ||
55 | #define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1 | ||
56 | #define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2 | ||
57 | #define PPC_BREAKPOINT_MODE_MASK 0x3 | ||
58 | uint32_t addr_mode; /* address match mode */ | ||
59 | |||
60 | #define PPC_BREAKPOINT_CONDITION_MODE 0x3 | ||
61 | #define PPC_BREAKPOINT_CONDITION_NONE 0x0 | ||
62 | #define PPC_BREAKPOINT_CONDITION_AND 0x1 | ||
63 | #define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */ | ||
64 | #define PPC_BREAKPOINT_CONDITION_OR 0x2 | ||
65 | #define PPC_BREAKPOINT_CONDITION_AND_OR 0x3 | ||
66 | #define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */ | ||
67 | #define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16)) | ||
68 | uint32_t condition_mode; /* break/watchpoint condition flags */ | ||
69 | |||
70 | uint64_t addr; | ||
71 | uint64_t addr2; | ||
72 | uint64_t condition_value; | ||
73 | }; | ||
74 | |||
75 | A request specifies one event, not necessarily just one register to be set. | ||
76 | For instance, if the request is for a watchpoint with a condition, both the | ||
77 | DAC and DVC registers will be set in the same request. | ||
78 | |||
79 | With this GDB can ask for all kinds of hardware breakpoints and watchpoints | ||
80 | that the BookE supports. COMEFROM breakpoints available in server processors | ||
81 | are not contemplated, but that is out of the scope of this work. | ||
82 | |||
83 | ptrace will return an integer (handle) uniquely identifying the breakpoint or | ||
84 | watchpoint just created. This integer will be used in the PTRACE_DELHWDEBUG | ||
85 | request to ask for its removal. Return -ENOSPC if the requested breakpoint | ||
86 | can't be allocated on the registers. | ||
87 | |||
88 | Some examples of using the structure to: | ||
89 | |||
90 | - set a breakpoint in the first breakpoint register | ||
91 | |||
92 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
93 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
94 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
95 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
96 | p.addr = (uint64_t) address; | ||
97 | p.addr2 = 0; | ||
98 | p.condition_value = 0; | ||
99 | |||
100 | - set a watchpoint which triggers on reads in the second watchpoint register | ||
101 | |||
102 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
103 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
104 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
105 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
106 | p.addr = (uint64_t) address; | ||
107 | p.addr2 = 0; | ||
108 | p.condition_value = 0; | ||
109 | |||
110 | - set a watchpoint which triggers only with a specific value | ||
111 | |||
112 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
113 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
114 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
115 | p.condition_mode = PPC_BREAKPOINT_CONDITION_AND | PPC_BREAKPOINT_CONDITION_BE_ALL; | ||
116 | p.addr = (uint64_t) address; | ||
117 | p.addr2 = 0; | ||
118 | p.condition_value = (uint64_t) condition; | ||
119 | |||
120 | - set a ranged hardware breakpoint | ||
121 | |||
122 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
123 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
124 | p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; | ||
125 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
126 | p.addr = (uint64_t) begin_range; | ||
127 | p.addr2 = (uint64_t) end_range; | ||
128 | p.condition_value = 0; | ||
129 | |||
130 | 3. PTRACE_DELHWDEBUG | ||
131 | |||
132 | Takes an integer which identifies an existing breakpoint or watchpoint | ||
133 | (i.e., the value returned from PTRACE_SETHWDEBUG), and deletes the | ||
134 | corresponding breakpoint or watchpoint.. | ||
diff --git a/Documentation/s390/CommonIO b/Documentation/s390/CommonIO index 339207d11d95..d378cba66456 100644 --- a/Documentation/s390/CommonIO +++ b/Documentation/s390/CommonIO | |||
@@ -87,6 +87,12 @@ Command line parameters | |||
87 | compatibility, by the device number in hexadecimal (0xabcd or abcd). Device | 87 | compatibility, by the device number in hexadecimal (0xabcd or abcd). Device |
88 | numbers given as 0xabcd will be interpreted as 0.0.abcd. | 88 | numbers given as 0xabcd will be interpreted as 0.0.abcd. |
89 | 89 | ||
90 | * /proc/cio_settle | ||
91 | |||
92 | A write request to this file is blocked until all queued cio actions are | ||
93 | handled. This will allow userspace to wait for pending work affecting | ||
94 | device availability after changing cio_ignore or the hardware configuration. | ||
95 | |||
90 | * For some of the information present in the /proc filesystem in 2.4 (namely, | 96 | * For some of the information present in the /proc filesystem in 2.4 (namely, |
91 | /proc/subchannels and /proc/chpids), see driver-model.txt. | 97 | /proc/subchannels and /proc/chpids), see driver-model.txt. |
92 | Information formerly in /proc/irq_count is now in /proc/interrupts. | 98 | Information formerly in /proc/irq_count is now in /proc/interrupts. |
diff --git a/Documentation/s390/driver-model.txt b/Documentation/s390/driver-model.txt index bde473df748d..ed265cf54cde 100644 --- a/Documentation/s390/driver-model.txt +++ b/Documentation/s390/driver-model.txt | |||
@@ -223,8 +223,8 @@ touched by the driver - it should use the ccwgroup device's driver_data for its | |||
223 | private data. | 223 | private data. |
224 | 224 | ||
225 | To implement a ccwgroup driver, please refer to include/asm/ccwgroup.h. Keep in | 225 | To implement a ccwgroup driver, please refer to include/asm/ccwgroup.h. Keep in |
226 | mind that most drivers will need to implement both a ccwgroup and a ccw driver | 226 | mind that most drivers will need to implement both a ccwgroup and a ccw |
227 | (unless you have a meta ccw driver, like cu3088 for lcs and ctc). | 227 | driver. |
228 | 228 | ||
229 | 229 | ||
230 | 2. Channel paths | 230 | 2. Channel paths |
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas index 17ffa0607712..30023568805e 100644 --- a/Documentation/scsi/ChangeLog.megaraid_sas +++ b/Documentation/scsi/ChangeLog.megaraid_sas | |||
@@ -1,3 +1,19 @@ | |||
1 | 1 Release Date : Thur. Oct 29, 2009 09:12:45 PST 2009 - | ||
2 | (emaild-id:megaraidlinux@lsi.com) | ||
3 | Bo Yang | ||
4 | |||
5 | 2 Current Version : 00.00.04.17.1-rc1 | ||
6 | 3 Older Version : 00.00.04.12 | ||
7 | |||
8 | 1. Add the pad_0 in mfi frame structure to 0 to fix the | ||
9 | context value larger than 32bit value issue. | ||
10 | |||
11 | 2. Add the logic drive list to the driver. Driver will | ||
12 | keep the logic drive list internal after driver load. | ||
13 | |||
14 | 3. driver fixed the device update issue after get the AEN | ||
15 | PD delete/ADD, LD add/delete from FW. | ||
16 | |||
1 | 1 Release Date : Tues. July 28, 2009 10:12:45 PST 2009 - | 17 | 1 Release Date : Tues. July 28, 2009 10:12:45 PST 2009 - |
2 | (emaild-id:megaraidlinux@lsi.com) | 18 | (emaild-id:megaraidlinux@lsi.com) |
3 | Bo Yang | 19 | Bo Yang |
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 index 7539e8fa1ffd..16ca030e1185 100644 --- a/Documentation/video4linux/CARDLIST.cx23885 +++ b/Documentation/video4linux/CARDLIST.cx23885 | |||
@@ -26,3 +26,4 @@ | |||
26 | 25 -> Compro VideoMate E800 [1858:e800] | 26 | 25 -> Compro VideoMate E800 [1858:e800] |
27 | 26 -> Hauppauge WinTV-HVR1290 [0070:8551] | 27 | 26 -> Hauppauge WinTV-HVR1290 [0070:8551] |
28 | 27 -> Mygica X8558 PRO DMB-TH [14f1:8578] | 28 | 27 -> Mygica X8558 PRO DMB-TH [14f1:8578] |
29 | 28 -> LEADTEK WinFast PxTV1200 [107d:6f22] | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index fce1e7eb0474..b4a767060ed7 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -174,3 +174,4 @@ | |||
174 | 173 -> Zolid Hybrid TV Tuner PCI [1131:2004] | 174 | 173 -> Zolid Hybrid TV Tuner PCI [1131:2004] |
175 | 174 -> Asus Europa Hybrid OEM [1043:4847] | 175 | 174 -> Asus Europa Hybrid OEM [1043:4847] |
176 | 175 -> Leadtek Winfast DTV1000S [107d:6655] | 176 | 175 -> Leadtek Winfast DTV1000S [107d:6655] |
177 | 176 -> Beholder BeholdTV 505 RDS [0000:5051] | ||
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner index e0d298fe8830..9b2e0dd6017e 100644 --- a/Documentation/video4linux/CARDLIST.tuner +++ b/Documentation/video4linux/CARDLIST.tuner | |||
@@ -81,3 +81,4 @@ tuner=80 - Philips FQ1216LME MK3 PAL/SECAM w/active loopthrough | |||
81 | tuner=81 - Partsnic (Daewoo) PTI-5NF05 | 81 | tuner=81 - Partsnic (Daewoo) PTI-5NF05 |
82 | tuner=82 - Philips CU1216L | 82 | tuner=82 - Philips CU1216L |
83 | tuner=83 - NXP TDA18271 | 83 | tuner=83 - NXP TDA18271 |
84 | tuner=84 - Sony BTF-Pxn01Z | ||
diff --git a/Documentation/video4linux/README.tlg2300 b/Documentation/video4linux/README.tlg2300 new file mode 100644 index 000000000000..416ccb93d8c9 --- /dev/null +++ b/Documentation/video4linux/README.tlg2300 | |||
@@ -0,0 +1,47 @@ | |||
1 | tlg2300 release notes | ||
2 | ==================== | ||
3 | |||
4 | This is a v4l2/dvb device driver for the tlg2300 chip. | ||
5 | |||
6 | |||
7 | current status | ||
8 | ============== | ||
9 | |||
10 | video | ||
11 | - support mmap and read().(no overlay) | ||
12 | |||
13 | audio | ||
14 | - The driver will register a ALSA card for the audio input. | ||
15 | |||
16 | vbi | ||
17 | - Works for almost TV norms. | ||
18 | |||
19 | dvb-t | ||
20 | - works for DVB-T | ||
21 | |||
22 | FM | ||
23 | - Works for radio. | ||
24 | |||
25 | --------------------------------------------------------------------------- | ||
26 | TESTED APPLICATIONS: | ||
27 | |||
28 | -VLC1.0.4 test the video and dvb. The GUI is friendly to use. | ||
29 | |||
30 | -Mplayer test the video. | ||
31 | |||
32 | -Mplayer test the FM. The mplayer should be compiled with --enable-radio and | ||
33 | --enable-radio-capture. | ||
34 | The command runs as this(The alsa audio registers to card 1): | ||
35 | #mplayer radio://103.7/capture/ -radio adevice=hw=1,0:arate=48000 \ | ||
36 | -rawaudio rate=48000:channels=2 | ||
37 | |||
38 | --------------------------------------------------------------------------- | ||
39 | KNOWN PROBLEMS: | ||
40 | about preemphasis: | ||
41 | You can set the preemphasis for radio by the following command: | ||
42 | #v4l2-ctl -d /dev/radio0 --set-ctrl=pre_emphasis_settings=1 | ||
43 | |||
44 | "pre_emphasis_settings=1" means that you select the 50us. If you want | ||
45 | to select the 75us, please use "pre_emphasis_settings=2" | ||
46 | |||
47 | |||
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 1800a62cf135..181b9e6fd984 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -42,6 +42,7 @@ ov519 041e:4064 Creative Live! VISTA VF0420 | |||
42 | ov519 041e:4067 Creative Live! Cam Video IM (VF0350) | 42 | ov519 041e:4067 Creative Live! Cam Video IM (VF0350) |
43 | ov519 041e:4068 Creative Live! VISTA VF0470 | 43 | ov519 041e:4068 Creative Live! VISTA VF0470 |
44 | spca561 0458:7004 Genius VideoCAM Express V2 | 44 | spca561 0458:7004 Genius VideoCAM Express V2 |
45 | sn9c2028 0458:7005 Genius Smart 300, version 2 | ||
45 | sunplus 0458:7006 Genius Dsc 1.3 Smart | 46 | sunplus 0458:7006 Genius Dsc 1.3 Smart |
46 | zc3xx 0458:7007 Genius VideoCam V2 | 47 | zc3xx 0458:7007 Genius VideoCam V2 |
47 | zc3xx 0458:700c Genius VideoCam V3 | 48 | zc3xx 0458:700c Genius VideoCam V3 |
@@ -109,6 +110,7 @@ sunplus 04a5:3003 Benq DC 1300 | |||
109 | sunplus 04a5:3008 Benq DC 1500 | 110 | sunplus 04a5:3008 Benq DC 1500 |
110 | sunplus 04a5:300a Benq DC 3410 | 111 | sunplus 04a5:300a Benq DC 3410 |
111 | spca500 04a5:300c Benq DC 1016 | 112 | spca500 04a5:300c Benq DC 1016 |
113 | benq 04a5:3035 Benq DC E300 | ||
112 | finepix 04cb:0104 Fujifilm FinePix 4800 | 114 | finepix 04cb:0104 Fujifilm FinePix 4800 |
113 | finepix 04cb:0109 Fujifilm FinePix A202 | 115 | finepix 04cb:0109 Fujifilm FinePix A202 |
114 | finepix 04cb:010b Fujifilm FinePix A203 | 116 | finepix 04cb:010b Fujifilm FinePix A203 |
@@ -142,6 +144,7 @@ sunplus 04fc:5360 Sunplus Generic | |||
142 | spca500 04fc:7333 PalmPixDC85 | 144 | spca500 04fc:7333 PalmPixDC85 |
143 | sunplus 04fc:ffff Pure DigitalDakota | 145 | sunplus 04fc:ffff Pure DigitalDakota |
144 | spca501 0506:00df 3Com HomeConnect Lite | 146 | spca501 0506:00df 3Com HomeConnect Lite |
147 | sunplus 052b:1507 Megapixel 5 Pretec DC-1007 | ||
145 | sunplus 052b:1513 Megapix V4 | 148 | sunplus 052b:1513 Megapix V4 |
146 | sunplus 052b:1803 MegaImage VI | 149 | sunplus 052b:1803 MegaImage VI |
147 | tv8532 0545:808b Veo Stingray | 150 | tv8532 0545:808b Veo Stingray |
@@ -151,6 +154,7 @@ sunplus 0546:3191 Polaroid Ion 80 | |||
151 | sunplus 0546:3273 Polaroid PDC2030 | 154 | sunplus 0546:3273 Polaroid PDC2030 |
152 | ov519 054c:0154 Sonny toy4 | 155 | ov519 054c:0154 Sonny toy4 |
153 | ov519 054c:0155 Sonny toy5 | 156 | ov519 054c:0155 Sonny toy5 |
157 | cpia1 0553:0002 CPIA CPiA (version1) based cameras | ||
154 | zc3xx 055f:c005 Mustek Wcam300A | 158 | zc3xx 055f:c005 Mustek Wcam300A |
155 | spca500 055f:c200 Mustek Gsmart 300 | 159 | spca500 055f:c200 Mustek Gsmart 300 |
156 | sunplus 055f:c211 Kowa Bs888e Microcamera | 160 | sunplus 055f:c211 Kowa Bs888e Microcamera |
@@ -188,8 +192,7 @@ spca500 06bd:0404 Agfa CL20 | |||
188 | spca500 06be:0800 Optimedia | 192 | spca500 06be:0800 Optimedia |
189 | sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom | 193 | sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom |
190 | spca506 06e1:a190 ADS Instant VCD | 194 | spca506 06e1:a190 ADS Instant VCD |
191 | ov534 06f8:3002 Hercules Blog Webcam | 195 | ov534_9 06f8:3003 Hercules Dualpix HD Weblog |
192 | ov534 06f8:3003 Hercules Dualpix HD Weblog | ||
193 | sonixj 06f8:3004 Hercules Classic Silver | 196 | sonixj 06f8:3004 Hercules Classic Silver |
194 | sonixj 06f8:3008 Hercules Deluxe Optical Glass | 197 | sonixj 06f8:3008 Hercules Deluxe Optical Glass |
195 | pac7302 06f8:3009 Hercules Classic Link | 198 | pac7302 06f8:3009 Hercules Classic Link |
@@ -204,6 +207,7 @@ sunplus 0733:2221 Mercury Digital Pro 3.1p | |||
204 | sunplus 0733:3261 Concord 3045 spca536a | 207 | sunplus 0733:3261 Concord 3045 spca536a |
205 | sunplus 0733:3281 Cyberpix S550V | 208 | sunplus 0733:3281 Cyberpix S550V |
206 | spca506 0734:043b 3DeMon USB Capture aka | 209 | spca506 0734:043b 3DeMon USB Capture aka |
210 | cpia1 0813:0001 QX3 camera | ||
207 | ov519 0813:0002 Dual Mode USB Camera Plus | 211 | ov519 0813:0002 Dual Mode USB Camera Plus |
208 | spca500 084d:0003 D-Link DSC-350 | 212 | spca500 084d:0003 D-Link DSC-350 |
209 | spca500 08ca:0103 Aiptek PocketDV | 213 | spca500 08ca:0103 Aiptek PocketDV |
@@ -225,7 +229,8 @@ sunplus 08ca:2050 Medion MD 41437 | |||
225 | sunplus 08ca:2060 Aiptek PocketDV5300 | 229 | sunplus 08ca:2060 Aiptek PocketDV5300 |
226 | tv8532 0923:010f ICM532 cams | 230 | tv8532 0923:010f ICM532 cams |
227 | mars 093a:050f Mars-Semi Pc-Camera | 231 | mars 093a:050f Mars-Semi Pc-Camera |
228 | mr97310a 093a:010f Sakar Digital no. 77379 | 232 | mr97310a 093a:010e All known CIF cams with this ID |
233 | mr97310a 093a:010f All known VGA cams with this ID | ||
229 | pac207 093a:2460 Qtec Webcam 100 | 234 | pac207 093a:2460 Qtec Webcam 100 |
230 | pac207 093a:2461 HP Webcam | 235 | pac207 093a:2461 HP Webcam |
231 | pac207 093a:2463 Philips SPC 220 NC | 236 | pac207 093a:2463 Philips SPC 220 NC |
@@ -302,6 +307,7 @@ sonixj 0c45:613b Surfer SN-206 | |||
302 | sonixj 0c45:613c Sonix Pccam168 | 307 | sonixj 0c45:613c Sonix Pccam168 |
303 | sonixj 0c45:6143 Sonix Pccam168 | 308 | sonixj 0c45:6143 Sonix Pccam168 |
304 | sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia | 309 | sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia |
310 | sonixj 0c45:614a Frontech E-Ccam (JIL-2225) | ||
305 | sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) | 311 | sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) |
306 | sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) | 312 | sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) |
307 | sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) | 313 | sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) |
@@ -324,6 +330,10 @@ sn9c20x 0c45:62b0 PC Camera (SN9C202 + MT9V011/MT9V111/MT9V112) | |||
324 | sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655) | 330 | sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655) |
325 | sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660) | 331 | sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660) |
326 | sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R) | 332 | sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R) |
333 | sn9c2028 0c45:8001 Wild Planet Digital Spy Camera | ||
334 | sn9c2028 0c45:8003 Sakar #11199, #6637x, #67480 keychain cams | ||
335 | sn9c2028 0c45:8008 Mini-Shotz ms-350 | ||
336 | sn9c2028 0c45:800a Vivitar Vivicam 3350B | ||
327 | sunplus 0d64:0303 Sunplus FashionCam DXG | 337 | sunplus 0d64:0303 Sunplus FashionCam DXG |
328 | ov519 0e96:c001 TRUST 380 USB2 SPACEC@M | 338 | ov519 0e96:c001 TRUST 380 USB2 SPACEC@M |
329 | etoms 102c:6151 Qcam Sangha CIF | 339 | etoms 102c:6151 Qcam Sangha CIF |
@@ -341,10 +351,11 @@ spca501 1776:501c Arowana 300K CMOS Camera | |||
341 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops | 351 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops |
342 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC | 352 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC |
343 | pac207 2001:f115 D-Link DSB-C120 | 353 | pac207 2001:f115 D-Link DSB-C120 |
344 | sq905c 2770:9050 sq905c | 354 | sq905c 2770:9050 Disney pix micro (CIF) |
345 | sq905c 2770:905c DualCamera | 355 | sq905c 2770:9052 Disney pix micro 2 (VGA) |
346 | sq905 2770:9120 Argus Digital Camera DC1512 | 356 | sq905c 2770:905c All 11 known cameras with this ID |
347 | sq905c 2770:913d sq905c | 357 | sq905 2770:9120 All 24 known cameras with this ID |
358 | sq905c 2770:913d All 4 known cameras with this ID | ||
348 | spca500 2899:012c Toptro Industrial | 359 | spca500 2899:012c Toptro Industrial |
349 | ov519 8020:ef04 ov519 | 360 | ov519 8020:ef04 ov519 |
350 | spca508 8086:0110 Intel Easy PC Camera | 361 | spca508 8086:0110 Intel Easy PC Camera |
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index 74d677c8b036..5155700c206b 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -599,99 +599,13 @@ video_device::minor fields. | |||
599 | video buffer helper functions | 599 | video buffer helper functions |
600 | ----------------------------- | 600 | ----------------------------- |
601 | 601 | ||
602 | The v4l2 core API provides a standard method for dealing with video | 602 | The v4l2 core API provides a set of standard methods (called "videobuf") |
603 | buffers. Those methods allow a driver to implement read(), mmap() and | 603 | for dealing with video buffers. Those methods allow a driver to implement |
604 | overlay() on a consistent way. | 604 | read(), mmap() and overlay() in a consistent way. There are currently |
605 | 605 | methods for using video buffers on devices that supports DMA with | |
606 | There are currently methods for using video buffers on devices that | 606 | scatter/gather method (videobuf-dma-sg), DMA with linear access |
607 | supports DMA with scatter/gather method (videobuf-dma-sg), DMA with | 607 | (videobuf-dma-contig), and vmalloced buffers, mostly used on USB drivers |
608 | linear access (videobuf-dma-contig), and vmalloced buffers, mostly | 608 | (videobuf-vmalloc). |
609 | used on USB drivers (videobuf-vmalloc). | 609 | |
610 | 610 | Please see Documentation/video4linux/videobuf for more information on how | |
611 | Any driver using videobuf should provide operations (callbacks) for | 611 | to use the videobuf layer. |
612 | four handlers: | ||
613 | |||
614 | ops->buf_setup - calculates the size of the video buffers and avoid they | ||
615 | to waste more than some maximum limit of RAM; | ||
616 | ops->buf_prepare - fills the video buffer structs and calls | ||
617 | videobuf_iolock() to alloc and prepare mmaped memory; | ||
618 | ops->buf_queue - advices the driver that another buffer were | ||
619 | requested (by read() or by QBUF); | ||
620 | ops->buf_release - frees any buffer that were allocated. | ||
621 | |||
622 | In order to use it, the driver need to have a code (generally called at | ||
623 | interrupt context) that will properly handle the buffer request lists, | ||
624 | announcing that a new buffer were filled. | ||
625 | |||
626 | The irq handling code should handle the videobuf task lists, in order | ||
627 | to advice videobuf that a new frame were filled, in order to honor to a | ||
628 | request. The code is generally like this one: | ||
629 | if (list_empty(&dma_q->active)) | ||
630 | return; | ||
631 | |||
632 | buf = list_entry(dma_q->active.next, struct vbuffer, vb.queue); | ||
633 | |||
634 | if (!waitqueue_active(&buf->vb.done)) | ||
635 | return; | ||
636 | |||
637 | /* Some logic to handle the buf may be needed here */ | ||
638 | |||
639 | list_del(&buf->vb.queue); | ||
640 | do_gettimeofday(&buf->vb.ts); | ||
641 | wake_up(&buf->vb.done); | ||
642 | |||
643 | Those are the videobuffer functions used on drivers, implemented on | ||
644 | videobuf-core: | ||
645 | |||
646 | - Videobuf init functions | ||
647 | videobuf_queue_sg_init() | ||
648 | Initializes the videobuf infrastructure. This function should be | ||
649 | called before any other videobuf function on drivers that uses DMA | ||
650 | Scatter/Gather buffers. | ||
651 | |||
652 | videobuf_queue_dma_contig_init | ||
653 | Initializes the videobuf infrastructure. This function should be | ||
654 | called before any other videobuf function on drivers that need DMA | ||
655 | contiguous buffers. | ||
656 | |||
657 | videobuf_queue_vmalloc_init() | ||
658 | Initializes the videobuf infrastructure. This function should be | ||
659 | called before any other videobuf function on USB (and other drivers) | ||
660 | that need a vmalloced type of videobuf. | ||
661 | |||
662 | - videobuf_iolock() | ||
663 | Prepares the videobuf memory for the proper method (read, mmap, overlay). | ||
664 | |||
665 | - videobuf_queue_is_busy() | ||
666 | Checks if a videobuf is streaming. | ||
667 | |||
668 | - videobuf_queue_cancel() | ||
669 | Stops video handling. | ||
670 | |||
671 | - videobuf_mmap_free() | ||
672 | frees mmap buffers. | ||
673 | |||
674 | - videobuf_stop() | ||
675 | Stops video handling, ends mmap and frees mmap and other buffers. | ||
676 | |||
677 | - V4L2 api functions. Those functions correspond to VIDIOC_foo ioctls: | ||
678 | videobuf_reqbufs(), videobuf_querybuf(), videobuf_qbuf(), | ||
679 | videobuf_dqbuf(), videobuf_streamon(), videobuf_streamoff(). | ||
680 | |||
681 | - V4L1 api function (corresponds to VIDIOCMBUF ioctl): | ||
682 | videobuf_cgmbuf() | ||
683 | This function is used to provide backward compatibility with V4L1 | ||
684 | API. | ||
685 | |||
686 | - Some help functions for read()/poll() operations: | ||
687 | videobuf_read_stream() | ||
688 | For continuous stream read() | ||
689 | videobuf_read_one() | ||
690 | For snapshot read() | ||
691 | videobuf_poll_stream() | ||
692 | polling help function | ||
693 | |||
694 | The better way to understand it is to take a look at vivi driver. One | ||
695 | of the main reasons for vivi is to be a videobuf usage example. the | ||
696 | vivi_thread_tick() does the task that the IRQ callback would do on PCI | ||
697 | drivers (or the irq callback on USB). | ||
diff --git a/Documentation/video4linux/videobuf b/Documentation/video4linux/videobuf new file mode 100644 index 000000000000..17a1f9abf260 --- /dev/null +++ b/Documentation/video4linux/videobuf | |||
@@ -0,0 +1,360 @@ | |||
1 | An introduction to the videobuf layer | ||
2 | Jonathan Corbet <corbet@lwn.net> | ||
3 | Current as of 2.6.33 | ||
4 | |||
5 | The videobuf layer functions as a sort of glue layer between a V4L2 driver | ||
6 | and user space. It handles the allocation and management of buffers for | ||
7 | the storage of video frames. There is a set of functions which can be used | ||
8 | to implement many of the standard POSIX I/O system calls, including read(), | ||
9 | poll(), and, happily, mmap(). Another set of functions can be used to | ||
10 | implement the bulk of the V4L2 ioctl() calls related to streaming I/O, | ||
11 | including buffer allocation, queueing and dequeueing, and streaming | ||
12 | control. Using videobuf imposes a few design decisions on the driver | ||
13 | author, but the payback comes in the form of reduced code in the driver and | ||
14 | a consistent implementation of the V4L2 user-space API. | ||
15 | |||
16 | Buffer types | ||
17 | |||
18 | Not all video devices use the same kind of buffers. In fact, there are (at | ||
19 | least) three common variations: | ||
20 | |||
21 | - Buffers which are scattered in both the physical and (kernel) virtual | ||
22 | address spaces. (Almost) all user-space buffers are like this, but it | ||
23 | makes great sense to allocate kernel-space buffers this way as well when | ||
24 | it is possible. Unfortunately, it is not always possible; working with | ||
25 | this kind of buffer normally requires hardware which can do | ||
26 | scatter/gather DMA operations. | ||
27 | |||
28 | - Buffers which are physically scattered, but which are virtually | ||
29 | contiguous; buffers allocated with vmalloc(), in other words. These | ||
30 | buffers are just as hard to use for DMA operations, but they can be | ||
31 | useful in situations where DMA is not available but virtually-contiguous | ||
32 | buffers are convenient. | ||
33 | |||
34 | - Buffers which are physically contiguous. Allocation of this kind of | ||
35 | buffer can be unreliable on fragmented systems, but simpler DMA | ||
36 | controllers cannot deal with anything else. | ||
37 | |||
38 | Videobuf can work with all three types of buffers, but the driver author | ||
39 | must pick one at the outset and design the driver around that decision. | ||
40 | |||
41 | [It's worth noting that there's a fourth kind of buffer: "overlay" buffers | ||
42 | which are located within the system's video memory. The overlay | ||
43 | functionality is considered to be deprecated for most use, but it still | ||
44 | shows up occasionally in system-on-chip drivers where the performance | ||
45 | benefits merit the use of this technique. Overlay buffers can be handled | ||
46 | as a form of scattered buffer, but there are very few implementations in | ||
47 | the kernel and a description of this technique is currently beyond the | ||
48 | scope of this document.] | ||
49 | |||
50 | Data structures, callbacks, and initialization | ||
51 | |||
52 | Depending on which type of buffers are being used, the driver should | ||
53 | include one of the following files: | ||
54 | |||
55 | <media/videobuf-dma-sg.h> /* Physically scattered */ | ||
56 | <media/videobuf-vmalloc.h> /* vmalloc() buffers */ | ||
57 | <media/videobuf-dma-contig.h> /* Physically contiguous */ | ||
58 | |||
59 | The driver's data structure describing a V4L2 device should include a | ||
60 | struct videobuf_queue instance for the management of the buffer queue, | ||
61 | along with a list_head for the queue of available buffers. There will also | ||
62 | need to be an interrupt-safe spinlock which is used to protect (at least) | ||
63 | the queue. | ||
64 | |||
65 | The next step is to write four simple callbacks to help videobuf deal with | ||
66 | the management of buffers: | ||
67 | |||
68 | struct videobuf_queue_ops { | ||
69 | int (*buf_setup)(struct videobuf_queue *q, | ||
70 | unsigned int *count, unsigned int *size); | ||
71 | int (*buf_prepare)(struct videobuf_queue *q, | ||
72 | struct videobuf_buffer *vb, | ||
73 | enum v4l2_field field); | ||
74 | void (*buf_queue)(struct videobuf_queue *q, | ||
75 | struct videobuf_buffer *vb); | ||
76 | void (*buf_release)(struct videobuf_queue *q, | ||
77 | struct videobuf_buffer *vb); | ||
78 | }; | ||
79 | |||
80 | buf_setup() is called early in the I/O process, when streaming is being | ||
81 | initiated; its purpose is to tell videobuf about the I/O stream. The count | ||
82 | parameter will be a suggested number of buffers to use; the driver should | ||
83 | check it for rationality and adjust it if need be. As a practical rule, a | ||
84 | minimum of two buffers are needed for proper streaming, and there is | ||
85 | usually a maximum (which cannot exceed 32) which makes sense for each | ||
86 | device. The size parameter should be set to the expected (maximum) size | ||
87 | for each frame of data. | ||
88 | |||
89 | Each buffer (in the form of a struct videobuf_buffer pointer) will be | ||
90 | passed to buf_prepare(), which should set the buffer's size, width, height, | ||
91 | and field fields properly. If the buffer's state field is | ||
92 | VIDEOBUF_NEEDS_INIT, the driver should pass it to: | ||
93 | |||
94 | int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, | ||
95 | struct v4l2_framebuffer *fbuf); | ||
96 | |||
97 | Among other things, this call will usually allocate memory for the buffer. | ||
98 | Finally, the buf_prepare() function should set the buffer's state to | ||
99 | VIDEOBUF_PREPARED. | ||
100 | |||
101 | When a buffer is queued for I/O, it is passed to buf_queue(), which should | ||
102 | put it onto the driver's list of available buffers and set its state to | ||
103 | VIDEOBUF_QUEUED. Note that this function is called with the queue spinlock | ||
104 | held; if it tries to acquire it as well things will come to a screeching | ||
105 | halt. Yes, this is the voice of experience. Note also that videobuf may | ||
106 | wait on the first buffer in the queue; placing other buffers in front of it | ||
107 | could again gum up the works. So use list_add_tail() to enqueue buffers. | ||
108 | |||
109 | Finally, buf_release() is called when a buffer is no longer intended to be | ||
110 | used. The driver should ensure that there is no I/O active on the buffer, | ||
111 | then pass it to the appropriate free routine(s): | ||
112 | |||
113 | /* Scatter/gather drivers */ | ||
114 | int videobuf_dma_unmap(struct videobuf_queue *q, | ||
115 | struct videobuf_dmabuf *dma); | ||
116 | int videobuf_dma_free(struct videobuf_dmabuf *dma); | ||
117 | |||
118 | /* vmalloc drivers */ | ||
119 | void videobuf_vmalloc_free (struct videobuf_buffer *buf); | ||
120 | |||
121 | /* Contiguous drivers */ | ||
122 | void videobuf_dma_contig_free(struct videobuf_queue *q, | ||
123 | struct videobuf_buffer *buf); | ||
124 | |||
125 | One way to ensure that a buffer is no longer under I/O is to pass it to: | ||
126 | |||
127 | int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); | ||
128 | |||
129 | Here, vb is the buffer, non_blocking indicates whether non-blocking I/O | ||
130 | should be used (it should be zero in the buf_release() case), and intr | ||
131 | controls whether an interruptible wait is used. | ||
132 | |||
133 | File operations | ||
134 | |||
135 | At this point, much of the work is done; much of the rest is slipping | ||
136 | videobuf calls into the implementation of the other driver callbacks. The | ||
137 | first step is in the open() function, which must initialize the | ||
138 | videobuf queue. The function to use depends on the type of buffer used: | ||
139 | |||
140 | void videobuf_queue_sg_init(struct videobuf_queue *q, | ||
141 | struct videobuf_queue_ops *ops, | ||
142 | struct device *dev, | ||
143 | spinlock_t *irqlock, | ||
144 | enum v4l2_buf_type type, | ||
145 | enum v4l2_field field, | ||
146 | unsigned int msize, | ||
147 | void *priv); | ||
148 | |||
149 | void videobuf_queue_vmalloc_init(struct videobuf_queue *q, | ||
150 | struct videobuf_queue_ops *ops, | ||
151 | struct device *dev, | ||
152 | spinlock_t *irqlock, | ||
153 | enum v4l2_buf_type type, | ||
154 | enum v4l2_field field, | ||
155 | unsigned int msize, | ||
156 | void *priv); | ||
157 | |||
158 | void videobuf_queue_dma_contig_init(struct videobuf_queue *q, | ||
159 | struct videobuf_queue_ops *ops, | ||
160 | struct device *dev, | ||
161 | spinlock_t *irqlock, | ||
162 | enum v4l2_buf_type type, | ||
163 | enum v4l2_field field, | ||
164 | unsigned int msize, | ||
165 | void *priv); | ||
166 | |||
167 | In each case, the parameters are the same: q is the queue structure for the | ||
168 | device, ops is the set of callbacks as described above, dev is the device | ||
169 | structure for this video device, irqlock is an interrupt-safe spinlock to | ||
170 | protect access to the data structures, type is the buffer type used by the | ||
171 | device (cameras will use V4L2_BUF_TYPE_VIDEO_CAPTURE, for example), field | ||
172 | describes which field is being captured (often V4L2_FIELD_NONE for | ||
173 | progressive devices), msize is the size of any containing structure used | ||
174 | around struct videobuf_buffer, and priv is a private data pointer which | ||
175 | shows up in the priv_data field of struct videobuf_queue. Note that these | ||
176 | are void functions which, evidently, are immune to failure. | ||
177 | |||
178 | V4L2 capture drivers can be written to support either of two APIs: the | ||
179 | read() system call and the rather more complicated streaming mechanism. As | ||
180 | a general rule, it is necessary to support both to ensure that all | ||
181 | applications have a chance of working with the device. Videobuf makes it | ||
182 | easy to do that with the same code. To implement read(), the driver need | ||
183 | only make a call to one of: | ||
184 | |||
185 | ssize_t videobuf_read_one(struct videobuf_queue *q, | ||
186 | char __user *data, size_t count, | ||
187 | loff_t *ppos, int nonblocking); | ||
188 | |||
189 | ssize_t videobuf_read_stream(struct videobuf_queue *q, | ||
190 | char __user *data, size_t count, | ||
191 | loff_t *ppos, int vbihack, int nonblocking); | ||
192 | |||
193 | Either one of these functions will read frame data into data, returning the | ||
194 | amount actually read; the difference is that videobuf_read_one() will only | ||
195 | read a single frame, while videobuf_read_stream() will read multiple frames | ||
196 | if they are needed to satisfy the count requested by the application. A | ||
197 | typical driver read() implementation will start the capture engine, call | ||
198 | one of the above functions, then stop the engine before returning (though a | ||
199 | smarter implementation might leave the engine running for a little while in | ||
200 | anticipation of another read() call happening in the near future). | ||
201 | |||
202 | The poll() function can usually be implemented with a direct call to: | ||
203 | |||
204 | unsigned int videobuf_poll_stream(struct file *file, | ||
205 | struct videobuf_queue *q, | ||
206 | poll_table *wait); | ||
207 | |||
208 | Note that the actual wait queue eventually used will be the one associated | ||
209 | with the first available buffer. | ||
210 | |||
211 | When streaming I/O is done to kernel-space buffers, the driver must support | ||
212 | the mmap() system call to enable user space to access the data. In many | ||
213 | V4L2 drivers, the often-complex mmap() implementation simplifies to a | ||
214 | single call to: | ||
215 | |||
216 | int videobuf_mmap_mapper(struct videobuf_queue *q, | ||
217 | struct vm_area_struct *vma); | ||
218 | |||
219 | Everything else is handled by the videobuf code. | ||
220 | |||
221 | The release() function requires two separate videobuf calls: | ||
222 | |||
223 | void videobuf_stop(struct videobuf_queue *q); | ||
224 | int videobuf_mmap_free(struct videobuf_queue *q); | ||
225 | |||
226 | The call to videobuf_stop() terminates any I/O in progress - though it is | ||
227 | still up to the driver to stop the capture engine. The call to | ||
228 | videobuf_mmap_free() will ensure that all buffers have been unmapped; if | ||
229 | so, they will all be passed to the buf_release() callback. If buffers | ||
230 | remain mapped, videobuf_mmap_free() returns an error code instead. The | ||
231 | purpose is clearly to cause the closing of the file descriptor to fail if | ||
232 | buffers are still mapped, but every driver in the 2.6.32 kernel cheerfully | ||
233 | ignores its return value. | ||
234 | |||
235 | ioctl() operations | ||
236 | |||
237 | The V4L2 API includes a very long list of driver callbacks to respond to | ||
238 | the many ioctl() commands made available to user space. A number of these | ||
239 | - those associated with streaming I/O - turn almost directly into videobuf | ||
240 | calls. The relevant helper functions are: | ||
241 | |||
242 | int videobuf_reqbufs(struct videobuf_queue *q, | ||
243 | struct v4l2_requestbuffers *req); | ||
244 | int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b); | ||
245 | int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b); | ||
246 | int videobuf_dqbuf(struct videobuf_queue *q, struct v4l2_buffer *b, | ||
247 | int nonblocking); | ||
248 | int videobuf_streamon(struct videobuf_queue *q); | ||
249 | int videobuf_streamoff(struct videobuf_queue *q); | ||
250 | int videobuf_cgmbuf(struct videobuf_queue *q, struct video_mbuf *mbuf, | ||
251 | int count); | ||
252 | |||
253 | So, for example, a VIDIOC_REQBUFS call turns into a call to the driver's | ||
254 | vidioc_reqbufs() callback which, in turn, usually only needs to locate the | ||
255 | proper struct videobuf_queue pointer and pass it to videobuf_reqbufs(). | ||
256 | These support functions can replace a great deal of buffer management | ||
257 | boilerplate in a lot of V4L2 drivers. | ||
258 | |||
259 | The vidioc_streamon() and vidioc_streamoff() functions will be a bit more | ||
260 | complex, of course, since they will also need to deal with starting and | ||
261 | stopping the capture engine. videobuf_cgmbuf(), called from the driver's | ||
262 | vidiocgmbuf() function, only exists if the V4L1 compatibility module has | ||
263 | been selected with CONFIG_VIDEO_V4L1_COMPAT, so its use must be surrounded | ||
264 | with #ifdef directives. | ||
265 | |||
266 | Buffer allocation | ||
267 | |||
268 | Thus far, we have talked about buffers, but have not looked at how they are | ||
269 | allocated. The scatter/gather case is the most complex on this front. For | ||
270 | allocation, the driver can leave buffer allocation entirely up to the | ||
271 | videobuf layer; in this case, buffers will be allocated as anonymous | ||
272 | user-space pages and will be very scattered indeed. If the application is | ||
273 | using user-space buffers, no allocation is needed; the videobuf layer will | ||
274 | take care of calling get_user_pages() and filling in the scatterlist array. | ||
275 | |||
276 | If the driver needs to do its own memory allocation, it should be done in | ||
277 | the vidioc_reqbufs() function, *after* calling videobuf_reqbufs(). The | ||
278 | first step is a call to: | ||
279 | |||
280 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); | ||
281 | |||
282 | The returned videobuf_dmabuf structure (defined in | ||
283 | <media/videobuf-dma-sg.h>) includes a couple of relevant fields: | ||
284 | |||
285 | struct scatterlist *sglist; | ||
286 | int sglen; | ||
287 | |||
288 | The driver must allocate an appropriately-sized scatterlist array and | ||
289 | populate it with pointers to the pieces of the allocated buffer; sglen | ||
290 | should be set to the length of the array. | ||
291 | |||
292 | Drivers using the vmalloc() method need not (and cannot) concern themselves | ||
293 | with buffer allocation at all; videobuf will handle those details. The | ||
294 | same is normally true of contiguous-DMA drivers as well; videobuf will | ||
295 | allocate the buffers (with dma_alloc_coherent()) when it sees fit. That | ||
296 | means that these drivers may be trying to do high-order allocations at any | ||
297 | time, an operation which is not always guaranteed to work. Some drivers | ||
298 | play tricks by allocating DMA space at system boot time; videobuf does not | ||
299 | currently play well with those drivers. | ||
300 | |||
301 | As of 2.6.31, contiguous-DMA drivers can work with a user-supplied buffer, | ||
302 | as long as that buffer is physically contiguous. Normal user-space | ||
303 | allocations will not meet that criterion, but buffers obtained from other | ||
304 | kernel drivers, or those contained within huge pages, will work with these | ||
305 | drivers. | ||
306 | |||
307 | Filling the buffers | ||
308 | |||
309 | The final part of a videobuf implementation has no direct callback - it's | ||
310 | the portion of the code which actually puts frame data into the buffers, | ||
311 | usually in response to interrupts from the device. For all types of | ||
312 | drivers, this process works approximately as follows: | ||
313 | |||
314 | - Obtain the next available buffer and make sure that somebody is actually | ||
315 | waiting for it. | ||
316 | |||
317 | - Get a pointer to the memory and put video data there. | ||
318 | |||
319 | - Mark the buffer as done and wake up the process waiting for it. | ||
320 | |||
321 | Step (1) above is done by looking at the driver-managed list_head structure | ||
322 | - the one which is filled in the buf_queue() callback. Because starting | ||
323 | the engine and enqueueing buffers are done in separate steps, it's possible | ||
324 | for the engine to be running without any buffers available - in the | ||
325 | vmalloc() case especially. So the driver should be prepared for the list | ||
326 | to be empty. It is equally possible that nobody is yet interested in the | ||
327 | buffer; the driver should not remove it from the list or fill it until a | ||
328 | process is waiting on it. That test can be done by examining the buffer's | ||
329 | done field (a wait_queue_head_t structure) with waitqueue_active(). | ||
330 | |||
331 | A buffer's state should be set to VIDEOBUF_ACTIVE before being mapped for | ||
332 | DMA; that ensures that the videobuf layer will not try to do anything with | ||
333 | it while the device is transferring data. | ||
334 | |||
335 | For scatter/gather drivers, the needed memory pointers will be found in the | ||
336 | scatterlist structure described above. Drivers using the vmalloc() method | ||
337 | can get a memory pointer with: | ||
338 | |||
339 | void *videobuf_to_vmalloc(struct videobuf_buffer *buf); | ||
340 | |||
341 | For contiguous DMA drivers, the function to use is: | ||
342 | |||
343 | dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); | ||
344 | |||
345 | The contiguous DMA API goes out of its way to hide the kernel-space address | ||
346 | of the DMA buffer from drivers. | ||
347 | |||
348 | The final step is to set the size field of the relevant videobuf_buffer | ||
349 | structure to the actual size of the captured image, set state to | ||
350 | VIDEOBUF_DONE, then call wake_up() on the done queue. At this point, the | ||
351 | buffer is owned by the videobuf layer and the driver should not touch it | ||
352 | again. | ||
353 | |||
354 | Developers who are interested in more information can go into the relevant | ||
355 | header files; there are a few low-level functions declared there which have | ||
356 | not been talked about here. Also worthwhile is the vivi driver | ||
357 | (drivers/media/video/vivi.c), which is maintained as an example of how V4L2 | ||
358 | drivers should be written. Vivi only uses the vmalloc() API, but it's good | ||
359 | enough to get started with. Note also that all of these calls are exported | ||
360 | GPL-only, so they will not be available to non-GPL kernel modules. | ||