diff options
Diffstat (limited to 'Documentation')
| -rw-r--r-- | Documentation/CodingStyle | 126 | ||||
| -rw-r--r-- | Documentation/SubmitChecklist | 6 | ||||
| -rw-r--r-- | Documentation/accounting/getdelays.c | 64 | ||||
| -rw-r--r-- | Documentation/dvb/cards.txt | 4 | ||||
| -rw-r--r-- | Documentation/ioctl/ioctl-decoding.txt | 24 | ||||
| -rw-r--r-- | Documentation/networking/dccp.txt | 6 | ||||
| -rw-r--r-- | Documentation/spi/pxa2xx | 16 | ||||
| -rw-r--r-- | Documentation/video4linux/CARDLIST.cx88 | 2 | ||||
| -rw-r--r-- | Documentation/video4linux/CARDLIST.saa7134 | 7 | ||||
| -rw-r--r-- | Documentation/video4linux/cafe_ccic | 54 | ||||
| -rw-r--r-- | Documentation/video4linux/zr36120.txt | 162 |
11 files changed, 270 insertions, 201 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 29c18966b050..0ad6dcb5d45f 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
| @@ -35,12 +35,37 @@ In short, 8-char indents make things easier to read, and have the added | |||
| 35 | benefit of warning you when you're nesting your functions too deep. | 35 | benefit of warning you when you're nesting your functions too deep. |
| 36 | Heed that warning. | 36 | Heed that warning. |
| 37 | 37 | ||
| 38 | The preferred way to ease multiple indentation levels in a switch statement is | ||
| 39 | to align the "switch" and its subordinate "case" labels in the same column | ||
| 40 | instead of "double-indenting" the "case" labels. E.g.: | ||
| 41 | |||
| 42 | switch (suffix) { | ||
| 43 | case 'G': | ||
| 44 | case 'g': | ||
| 45 | mem <<= 30; | ||
| 46 | break; | ||
| 47 | case 'M': | ||
| 48 | case 'm': | ||
| 49 | mem <<= 20; | ||
| 50 | break; | ||
| 51 | case 'K': | ||
| 52 | case 'k': | ||
| 53 | mem <<= 10; | ||
| 54 | /* fall through */ | ||
| 55 | default: | ||
| 56 | break; | ||
| 57 | } | ||
| 58 | |||
| 59 | |||
| 38 | Don't put multiple statements on a single line unless you have | 60 | Don't put multiple statements on a single line unless you have |
| 39 | something to hide: | 61 | something to hide: |
| 40 | 62 | ||
| 41 | if (condition) do_this; | 63 | if (condition) do_this; |
| 42 | do_something_everytime; | 64 | do_something_everytime; |
| 43 | 65 | ||
| 66 | Don't put multiple assignments on a single line either. Kernel coding style | ||
| 67 | is super simple. Avoid tricky expressions. | ||
| 68 | |||
| 44 | Outside of comments, documentation and except in Kconfig, spaces are never | 69 | Outside of comments, documentation and except in Kconfig, spaces are never |
| 45 | used for indentation, and the above example is deliberately broken. | 70 | used for indentation, and the above example is deliberately broken. |
| 46 | 71 | ||
| @@ -69,7 +94,7 @@ void fun(int a, int b, int c) | |||
| 69 | next_statement; | 94 | next_statement; |
| 70 | } | 95 | } |
| 71 | 96 | ||
| 72 | Chapter 3: Placing Braces | 97 | Chapter 3: Placing Braces and Spaces |
| 73 | 98 | ||
| 74 | The other issue that always comes up in C styling is the placement of | 99 | The other issue that always comes up in C styling is the placement of |
| 75 | braces. Unlike the indent size, there are few technical reasons to | 100 | braces. Unlike the indent size, there are few technical reasons to |
| @@ -81,6 +106,20 @@ brace last on the line, and put the closing brace first, thusly: | |||
| 81 | we do y | 106 | we do y |
| 82 | } | 107 | } |
| 83 | 108 | ||
| 109 | This applies to all non-function statement blocks (if, switch, for, | ||
| 110 | while, do). E.g.: | ||
| 111 | |||
| 112 | switch (action) { | ||
| 113 | case KOBJ_ADD: | ||
| 114 | return "add"; | ||
| 115 | case KOBJ_REMOVE: | ||
| 116 | return "remove"; | ||
| 117 | case KOBJ_CHANGE: | ||
| 118 | return "change"; | ||
| 119 | default: | ||
| 120 | return NULL; | ||
| 121 | } | ||
| 122 | |||
| 84 | However, there is one special case, namely functions: they have the | 123 | However, there is one special case, namely functions: they have the |
| 85 | opening brace at the beginning of the next line, thus: | 124 | opening brace at the beginning of the next line, thus: |
| 86 | 125 | ||
| @@ -121,6 +160,49 @@ supply of new-lines on your screen is not a renewable resource (think | |||
| 121 | 25-line terminal screens here), you have more empty lines to put | 160 | 25-line terminal screens here), you have more empty lines to put |
| 122 | comments on. | 161 | comments on. |
| 123 | 162 | ||
| 163 | 3.1: Spaces | ||
| 164 | |||
| 165 | Linux kernel style for use of spaces depends (mostly) on | ||
| 166 | function-versus-keyword usage. Use a space after (most) keywords. The | ||
| 167 | notable exceptions are sizeof, typeof, alignof, and __attribute__, which look | ||
| 168 | somewhat like functions (and are usually used with parentheses in Linux, | ||
| 169 | although they are not required in the language, as in: "sizeof info" after | ||
| 170 | "struct fileinfo info;" is declared). | ||
| 171 | |||
| 172 | So use a space after these keywords: | ||
| 173 | if, switch, case, for, do, while | ||
| 174 | but not with sizeof, typeof, alignof, or __attribute__. E.g., | ||
| 175 | s = sizeof(struct file); | ||
| 176 | |||
| 177 | Do not add spaces around (inside) parenthesized expressions. This example is | ||
| 178 | *bad*: | ||
| 179 | |||
| 180 | s = sizeof( struct file ); | ||
| 181 | |||
| 182 | When declaring pointer data or a function that returns a pointer type, the | ||
| 183 | preferred use of '*' is adjacent to the data name or function name and not | ||
| 184 | adjacent to the type name. Examples: | ||
| 185 | |||
| 186 | char *linux_banner; | ||
| 187 | unsigned long long memparse(char *ptr, char **retptr); | ||
| 188 | char *match_strdup(substring_t *s); | ||
| 189 | |||
| 190 | Use one space around (on each side of) most binary and ternary operators, | ||
| 191 | such as any of these: | ||
| 192 | |||
| 193 | = + - < > * / % | & ^ <= >= == != ? : | ||
| 194 | |||
| 195 | but no space after unary operators: | ||
| 196 | & * + - ~ ! sizeof typeof alignof __attribute__ defined | ||
| 197 | |||
| 198 | no space before the postfix increment & decrement unary operators: | ||
| 199 | ++ -- | ||
| 200 | |||
| 201 | no space after the prefix increment & decrement unary operators: | ||
| 202 | ++ -- | ||
| 203 | |||
| 204 | and no space around the '.' and "->" structure member operators. | ||
| 205 | |||
| 124 | 206 | ||
| 125 | Chapter 4: Naming | 207 | Chapter 4: Naming |
| 126 | 208 | ||
| @@ -152,7 +234,7 @@ variable that is used to hold a temporary value. | |||
| 152 | 234 | ||
| 153 | If you are afraid to mix up your local variable names, you have another | 235 | If you are afraid to mix up your local variable names, you have another |
| 154 | problem, which is called the function-growth-hormone-imbalance syndrome. | 236 | problem, which is called the function-growth-hormone-imbalance syndrome. |
| 155 | See next chapter. | 237 | See chapter 6 (Functions). |
| 156 | 238 | ||
| 157 | 239 | ||
| 158 | Chapter 5: Typedefs | 240 | Chapter 5: Typedefs |
| @@ -258,6 +340,20 @@ generally easily keep track of about 7 different things, anything more | |||
| 258 | and it gets confused. You know you're brilliant, but maybe you'd like | 340 | and it gets confused. You know you're brilliant, but maybe you'd like |
| 259 | to understand what you did 2 weeks from now. | 341 | to understand what you did 2 weeks from now. |
| 260 | 342 | ||
| 343 | In source files, separate functions with one blank line. If the function is | ||
| 344 | exported, the EXPORT* macro for it should follow immediately after the closing | ||
| 345 | function brace line. E.g.: | ||
| 346 | |||
| 347 | int system_is_up(void) | ||
| 348 | { | ||
| 349 | return system_state == SYSTEM_RUNNING; | ||
| 350 | } | ||
| 351 | EXPORT_SYMBOL(system_is_up); | ||
| 352 | |||
| 353 | In function prototypes, include parameter names with their data types. | ||
| 354 | Although this is not required by the C language, it is preferred in Linux | ||
| 355 | because it is a simple way to add valuable information for the reader. | ||
| 356 | |||
| 261 | 357 | ||
| 262 | Chapter 7: Centralized exiting of functions | 358 | Chapter 7: Centralized exiting of functions |
| 263 | 359 | ||
| @@ -306,16 +402,36 @@ time to explain badly written code. | |||
| 306 | Generally, you want your comments to tell WHAT your code does, not HOW. | 402 | Generally, you want your comments to tell WHAT your code does, not HOW. |
| 307 | Also, try to avoid putting comments inside a function body: if the | 403 | Also, try to avoid putting comments inside a function body: if the |
| 308 | function is so complex that you need to separately comment parts of it, | 404 | function is so complex that you need to separately comment parts of it, |
| 309 | you should probably go back to chapter 5 for a while. You can make | 405 | you should probably go back to chapter 6 for a while. You can make |
| 310 | small comments to note or warn about something particularly clever (or | 406 | small comments to note or warn about something particularly clever (or |
| 311 | ugly), but try to avoid excess. Instead, put the comments at the head | 407 | ugly), but try to avoid excess. Instead, put the comments at the head |
| 312 | of the function, telling people what it does, and possibly WHY it does | 408 | of the function, telling people what it does, and possibly WHY it does |
| 313 | it. | 409 | it. |
| 314 | 410 | ||
| 315 | When commenting the kernel API functions, please use the kerneldoc format. | 411 | When commenting the kernel API functions, please use the kernel-doc format. |
| 316 | See the files Documentation/kernel-doc-nano-HOWTO.txt and scripts/kernel-doc | 412 | See the files Documentation/kernel-doc-nano-HOWTO.txt and scripts/kernel-doc |
| 317 | for details. | 413 | for details. |
| 318 | 414 | ||
| 415 | Linux style for comments is the C89 "/* ... */" style. | ||
| 416 | Don't use C99-style "// ..." comments. | ||
| 417 | |||
| 418 | The preferred style for long (multi-line) comments is: | ||
| 419 | |||
| 420 | /* | ||
| 421 | * This is the preferred style for multi-line | ||
| 422 | * comments in the Linux kernel source code. | ||
| 423 | * Please use it consistently. | ||
| 424 | * | ||
| 425 | * Description: A column of asterisks on the left side, | ||
| 426 | * with beginning and ending almost-blank lines. | ||
| 427 | */ | ||
| 428 | |||
| 429 | It's also important to comment data, whether they are basic types or derived | ||
| 430 | types. To this end, use just one data declaration per line (no commas for | ||
| 431 | multiple data declarations). This leaves you room for a small comment on each | ||
| 432 | item, explaining its use. | ||
| 433 | |||
| 434 | |||
| 319 | Chapter 9: You've made a mess of it | 435 | Chapter 9: You've made a mess of it |
| 320 | 436 | ||
| 321 | That's OK, we all do. You've probably been told by your long-time Unix | 437 | That's OK, we all do. You've probably been told by your long-time Unix |
| @@ -591,4 +707,4 @@ Kernel CodingStyle, by greg@kroah.com at OLS 2002: | |||
| 591 | http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/ | 707 | http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/ |
| 592 | 708 | ||
| 593 | -- | 709 | -- |
| 594 | Last updated on 30 April 2006. | 710 | Last updated on 2006-December-06. |
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist index 7ac61f60037a..2270efa10153 100644 --- a/Documentation/SubmitChecklist +++ b/Documentation/SubmitChecklist | |||
| @@ -66,3 +66,9 @@ kernel patches. | |||
| 66 | See Documentation/ABI/README for more information. | 66 | See Documentation/ABI/README for more information. |
| 67 | 67 | ||
| 68 | 20: Check that it all passes `make headers_check'. | 68 | 20: Check that it all passes `make headers_check'. |
| 69 | |||
| 70 | 21: Has been checked with injection of at least slab and page-allocation | ||
| 71 | fauilures. See Documentation/fault-injection/. | ||
| 72 | |||
| 73 | If the new code is substantial, addition of subsystem-specific fault | ||
| 74 | injection might be appropriate. | ||
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index bf2b0e2f87e1..e9126e794ed7 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | * Copyright (C) Balbir Singh, IBM Corp. 2006 | 7 | * Copyright (C) Balbir Singh, IBM Corp. 2006 |
| 8 | * Copyright (c) Jay Lan, SGI. 2006 | 8 | * Copyright (c) Jay Lan, SGI. 2006 |
| 9 | * | 9 | * |
| 10 | * Compile with | ||
| 11 | * gcc -I/usr/src/linux/include getdelays.c -o getdelays | ||
| 10 | */ | 12 | */ |
| 11 | 13 | ||
| 12 | #include <stdio.h> | 14 | #include <stdio.h> |
| @@ -35,13 +37,20 @@ | |||
| 35 | #define NLA_DATA(na) ((void *)((char*)(na) + NLA_HDRLEN)) | 37 | #define NLA_DATA(na) ((void *)((char*)(na) + NLA_HDRLEN)) |
| 36 | #define NLA_PAYLOAD(len) (len - NLA_HDRLEN) | 38 | #define NLA_PAYLOAD(len) (len - NLA_HDRLEN) |
| 37 | 39 | ||
| 38 | #define err(code, fmt, arg...) do { printf(fmt, ##arg); exit(code); } while (0) | 40 | #define err(code, fmt, arg...) \ |
| 39 | int done = 0; | 41 | do { \ |
| 40 | int rcvbufsz=0; | 42 | fprintf(stderr, fmt, ##arg); \ |
| 41 | 43 | exit(code); \ | |
| 42 | char name[100]; | 44 | } while (0) |
| 43 | int dbg=0, print_delays=0; | 45 | |
| 46 | int done; | ||
| 47 | int rcvbufsz; | ||
| 48 | char name[100]; | ||
| 49 | int dbg; | ||
| 50 | int print_delays; | ||
| 51 | int print_io_accounting; | ||
| 44 | __u64 stime, utime; | 52 | __u64 stime, utime; |
| 53 | |||
| 45 | #define PRINTF(fmt, arg...) { \ | 54 | #define PRINTF(fmt, arg...) { \ |
| 46 | if (dbg) { \ | 55 | if (dbg) { \ |
| 47 | printf(fmt, ##arg); \ | 56 | printf(fmt, ##arg); \ |
| @@ -78,8 +87,9 @@ static int create_nl_socket(int protocol) | |||
| 78 | if (rcvbufsz) | 87 | if (rcvbufsz) |
| 79 | if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, | 88 | if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, |
| 80 | &rcvbufsz, sizeof(rcvbufsz)) < 0) { | 89 | &rcvbufsz, sizeof(rcvbufsz)) < 0) { |
| 81 | printf("Unable to set socket rcv buf size to %d\n", | 90 | fprintf(stderr, "Unable to set socket rcv buf size " |
| 82 | rcvbufsz); | 91 | "to %d\n", |
| 92 | rcvbufsz); | ||
| 83 | return -1; | 93 | return -1; |
| 84 | } | 94 | } |
| 85 | 95 | ||
| @@ -186,6 +196,15 @@ void print_delayacct(struct taskstats *t) | |||
| 186 | "count", "delay total", t->swapin_count, t->swapin_delay_total); | 196 | "count", "delay total", t->swapin_count, t->swapin_delay_total); |
| 187 | } | 197 | } |
| 188 | 198 | ||
| 199 | void print_ioacct(struct taskstats *t) | ||
| 200 | { | ||
| 201 | printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n", | ||
| 202 | t->ac_comm, | ||
| 203 | (unsigned long long)t->read_bytes, | ||
| 204 | (unsigned long long)t->write_bytes, | ||
| 205 | (unsigned long long)t->cancelled_write_bytes); | ||
| 206 | } | ||
| 207 | |||
| 189 | int main(int argc, char *argv[]) | 208 | int main(int argc, char *argv[]) |
| 190 | { | 209 | { |
| 191 | int c, rc, rep_len, aggr_len, len2, cmd_type; | 210 | int c, rc, rep_len, aggr_len, len2, cmd_type; |
| @@ -208,7 +227,7 @@ int main(int argc, char *argv[]) | |||
| 208 | struct msgtemplate msg; | 227 | struct msgtemplate msg; |
| 209 | 228 | ||
| 210 | while (1) { | 229 | while (1) { |
| 211 | c = getopt(argc, argv, "dw:r:m:t:p:v:l"); | 230 | c = getopt(argc, argv, "diw:r:m:t:p:v:l"); |
| 212 | if (c < 0) | 231 | if (c < 0) |
| 213 | break; | 232 | break; |
| 214 | 233 | ||
| @@ -217,6 +236,10 @@ int main(int argc, char *argv[]) | |||
| 217 | printf("print delayacct stats ON\n"); | 236 | printf("print delayacct stats ON\n"); |
| 218 | print_delays = 1; | 237 | print_delays = 1; |
| 219 | break; | 238 | break; |
| 239 | case 'i': | ||
| 240 | printf("printing IO accounting\n"); | ||
| 241 | print_io_accounting = 1; | ||
| 242 | break; | ||
| 220 | case 'w': | 243 | case 'w': |
| 221 | strncpy(logfile, optarg, MAX_FILENAME); | 244 | strncpy(logfile, optarg, MAX_FILENAME); |
| 222 | printf("write to file %s\n", logfile); | 245 | printf("write to file %s\n", logfile); |
| @@ -238,14 +261,12 @@ int main(int argc, char *argv[]) | |||
| 238 | if (!tid) | 261 | if (!tid) |
| 239 | err(1, "Invalid tgid\n"); | 262 | err(1, "Invalid tgid\n"); |
| 240 | cmd_type = TASKSTATS_CMD_ATTR_TGID; | 263 | cmd_type = TASKSTATS_CMD_ATTR_TGID; |
| 241 | print_delays = 1; | ||
| 242 | break; | 264 | break; |
| 243 | case 'p': | 265 | case 'p': |
| 244 | tid = atoi(optarg); | 266 | tid = atoi(optarg); |
| 245 | if (!tid) | 267 | if (!tid) |
| 246 | err(1, "Invalid pid\n"); | 268 | err(1, "Invalid pid\n"); |
| 247 | cmd_type = TASKSTATS_CMD_ATTR_PID; | 269 | cmd_type = TASKSTATS_CMD_ATTR_PID; |
| 248 | print_delays = 1; | ||
| 249 | break; | 270 | break; |
| 250 | case 'v': | 271 | case 'v': |
| 251 | printf("debug on\n"); | 272 | printf("debug on\n"); |
| @@ -277,7 +298,7 @@ int main(int argc, char *argv[]) | |||
| 277 | mypid = getpid(); | 298 | mypid = getpid(); |
| 278 | id = get_family_id(nl_sd); | 299 | id = get_family_id(nl_sd); |
| 279 | if (!id) { | 300 | if (!id) { |
| 280 | printf("Error getting family id, errno %d", errno); | 301 | fprintf(stderr, "Error getting family id, errno %d\n", errno); |
| 281 | goto err; | 302 | goto err; |
| 282 | } | 303 | } |
| 283 | PRINTF("family id %d\n", id); | 304 | PRINTF("family id %d\n", id); |
| @@ -288,7 +309,7 @@ int main(int argc, char *argv[]) | |||
| 288 | &cpumask, strlen(cpumask) + 1); | 309 | &cpumask, strlen(cpumask) + 1); |
| 289 | PRINTF("Sent register cpumask, retval %d\n", rc); | 310 | PRINTF("Sent register cpumask, retval %d\n", rc); |
| 290 | if (rc < 0) { | 311 | if (rc < 0) { |
| 291 | printf("error sending register cpumask\n"); | 312 | fprintf(stderr, "error sending register cpumask\n"); |
| 292 | goto err; | 313 | goto err; |
| 293 | } | 314 | } |
| 294 | } | 315 | } |
| @@ -298,7 +319,7 @@ int main(int argc, char *argv[]) | |||
| 298 | cmd_type, &tid, sizeof(__u32)); | 319 | cmd_type, &tid, sizeof(__u32)); |
| 299 | PRINTF("Sent pid/tgid, retval %d\n", rc); | 320 | PRINTF("Sent pid/tgid, retval %d\n", rc); |
| 300 | if (rc < 0) { | 321 | if (rc < 0) { |
| 301 | printf("error sending tid/tgid cmd\n"); | 322 | fprintf(stderr, "error sending tid/tgid cmd\n"); |
| 302 | goto done; | 323 | goto done; |
| 303 | } | 324 | } |
| 304 | } | 325 | } |
| @@ -310,13 +331,15 @@ int main(int argc, char *argv[]) | |||
| 310 | PRINTF("received %d bytes\n", rep_len); | 331 | PRINTF("received %d bytes\n", rep_len); |
| 311 | 332 | ||
| 312 | if (rep_len < 0) { | 333 | if (rep_len < 0) { |
| 313 | printf("nonfatal reply error: errno %d\n", errno); | 334 | fprintf(stderr, "nonfatal reply error: errno %d\n", |
| 335 | errno); | ||
| 314 | continue; | 336 | continue; |
| 315 | } | 337 | } |
| 316 | if (msg.n.nlmsg_type == NLMSG_ERROR || | 338 | if (msg.n.nlmsg_type == NLMSG_ERROR || |
| 317 | !NLMSG_OK((&msg.n), rep_len)) { | 339 | !NLMSG_OK((&msg.n), rep_len)) { |
| 318 | struct nlmsgerr *err = NLMSG_DATA(&msg); | 340 | struct nlmsgerr *err = NLMSG_DATA(&msg); |
| 319 | printf("fatal reply error, errno %d\n", err->error); | 341 | fprintf(stderr, "fatal reply error, errno %d\n", |
| 342 | err->error); | ||
| 320 | goto done; | 343 | goto done; |
| 321 | } | 344 | } |
| 322 | 345 | ||
| @@ -356,6 +379,8 @@ int main(int argc, char *argv[]) | |||
| 356 | count++; | 379 | count++; |
| 357 | if (print_delays) | 380 | if (print_delays) |
| 358 | print_delayacct((struct taskstats *) NLA_DATA(na)); | 381 | print_delayacct((struct taskstats *) NLA_DATA(na)); |
| 382 | if (print_io_accounting) | ||
| 383 | print_ioacct((struct taskstats *) NLA_DATA(na)); | ||
| 359 | if (fd) { | 384 | if (fd) { |
| 360 | if (write(fd, NLA_DATA(na), na->nla_len) < 0) { | 385 | if (write(fd, NLA_DATA(na), na->nla_len) < 0) { |
| 361 | err(1,"write error\n"); | 386 | err(1,"write error\n"); |
| @@ -365,7 +390,9 @@ int main(int argc, char *argv[]) | |||
| 365 | goto done; | 390 | goto done; |
| 366 | break; | 391 | break; |
| 367 | default: | 392 | default: |
| 368 | printf("Unknown nested nla_type %d\n", na->nla_type); | 393 | fprintf(stderr, "Unknown nested" |
| 394 | " nla_type %d\n", | ||
| 395 | na->nla_type); | ||
| 369 | break; | 396 | break; |
| 370 | } | 397 | } |
| 371 | len2 += NLA_ALIGN(na->nla_len); | 398 | len2 += NLA_ALIGN(na->nla_len); |
| @@ -374,7 +401,8 @@ int main(int argc, char *argv[]) | |||
| 374 | break; | 401 | break; |
| 375 | 402 | ||
| 376 | default: | 403 | default: |
| 377 | printf("Unknown nla_type %d\n", na->nla_type); | 404 | fprintf(stderr, "Unknown nla_type %d\n", |
| 405 | na->nla_type); | ||
| 378 | break; | 406 | break; |
| 379 | } | 407 | } |
| 380 | na = (struct nlattr *) (GENLMSG_DATA(&msg) + len); | 408 | na = (struct nlattr *) (GENLMSG_DATA(&msg) + len); |
diff --git a/Documentation/dvb/cards.txt b/Documentation/dvb/cards.txt index ca58e339d85f..cc09187a5db7 100644 --- a/Documentation/dvb/cards.txt +++ b/Documentation/dvb/cards.txt | |||
| @@ -22,10 +22,10 @@ o Frontends drivers: | |||
| 22 | - ves1x93 : Alps BSRV2 (ves1893 demodulator) and dbox2 (ves1993) | 22 | - ves1x93 : Alps BSRV2 (ves1893 demodulator) and dbox2 (ves1993) |
| 23 | - cx24110 : Conexant HM1221/HM1811 (cx24110 or cx24106 demod, cx24108 PLL) | 23 | - cx24110 : Conexant HM1221/HM1811 (cx24110 or cx24106 demod, cx24108 PLL) |
| 24 | - grundig_29504-491 : Grundig 29504-491 (Philips TDA8083 demodulator), tsa5522 PLL | 24 | - grundig_29504-491 : Grundig 29504-491 (Philips TDA8083 demodulator), tsa5522 PLL |
| 25 | - mt312 : Zarlink mt312 or Mitel vp310 demodulator, sl1935 or tsa5059 PLL | 25 | - mt312 : Zarlink mt312 or Mitel vp310 demodulator, sl1935 or tsa5059 PLLi, Technisat Sky2Pc with bios Rev. 2.3 |
| 26 | - stv0299 : Alps BSRU6 (tsa5059 PLL), LG TDQB-S00x (tsa5059 PLL), | 26 | - stv0299 : Alps BSRU6 (tsa5059 PLL), LG TDQB-S00x (tsa5059 PLL), |
| 27 | LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL), | 27 | LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL), |
| 28 | Philips SU1278SH (tsa5059 PLL), Samsung TBMU24112IMB | 28 | Philips SU1278SH (tsa5059 PLL), Samsung TBMU24112IMB, Technisat Sky2Pc with bios Rev. 2.6 |
| 29 | DVB-C: | 29 | DVB-C: |
| 30 | - ves1820 : various (ves1820 demodulator, sp5659c or spXXXX PLL) | 30 | - ves1820 : various (ves1820 demodulator, sp5659c or spXXXX PLL) |
| 31 | - at76c651 : Atmel AT76c651(B) with DAT7021 PLL | 31 | - at76c651 : Atmel AT76c651(B) with DAT7021 PLL |
diff --git a/Documentation/ioctl/ioctl-decoding.txt b/Documentation/ioctl/ioctl-decoding.txt new file mode 100644 index 000000000000..bfdf7f3ee4f0 --- /dev/null +++ b/Documentation/ioctl/ioctl-decoding.txt | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | To decode a hex IOCTL code: | ||
| 2 | |||
| 3 | Most architecures use this generic format, but check | ||
| 4 | include/ARCH/ioctl.h for specifics, e.g. powerpc | ||
| 5 | uses 3 bits to encode read/write and 13 bits for size. | ||
| 6 | |||
| 7 | bits meaning | ||
| 8 | 31-30 00 - no parameters: uses _IO macro | ||
| 9 | 10 - read: _IOR | ||
| 10 | 01 - write: _IOW | ||
| 11 | 11 - read/write: _IOWR | ||
| 12 | |||
| 13 | 29-16 size of arguments | ||
| 14 | |||
| 15 | 15-8 ascii character supposedly | ||
| 16 | unique to each driver | ||
| 17 | |||
| 18 | 7-0 function # | ||
| 19 | |||
| 20 | |||
| 21 | So for example 0x82187201 is a read with arg length of 0x218, | ||
| 22 | character 'r' function 1. Grepping the source reveals this is: | ||
| 23 | |||
| 24 | #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) | ||
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt index dda15886bcb5..387482e46c47 100644 --- a/Documentation/networking/dccp.txt +++ b/Documentation/networking/dccp.txt | |||
| @@ -19,7 +19,8 @@ for real time and multimedia traffic. | |||
| 19 | 19 | ||
| 20 | It has a base protocol and pluggable congestion control IDs (CCIDs). | 20 | It has a base protocol and pluggable congestion control IDs (CCIDs). |
| 21 | 21 | ||
| 22 | It is at experimental RFC status and the homepage for DCCP as a protocol is at: | 22 | It is at proposed standard RFC status and the homepage for DCCP as a protocol |
| 23 | is at: | ||
| 23 | http://www.read.cs.ucla.edu/dccp/ | 24 | http://www.read.cs.ucla.edu/dccp/ |
| 24 | 25 | ||
| 25 | Missing features | 26 | Missing features |
| @@ -34,9 +35,6 @@ The known bugs are at: | |||
| 34 | Socket options | 35 | Socket options |
| 35 | ============== | 36 | ============== |
| 36 | 37 | ||
| 37 | DCCP_SOCKOPT_PACKET_SIZE is used for CCID3 to set default packet size for | ||
| 38 | calculations. | ||
| 39 | |||
| 40 | DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of | 38 | DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of |
| 41 | service codes (RFC 4340, sec. 8.1.2); if this socket option is not set, | 39 | service codes (RFC 4340, sec. 8.1.2); if this socket option is not set, |
| 42 | the socket will fall back to 0 (which means that no meaningful service code | 40 | the socket will fall back to 0 (which means that no meaningful service code |
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx index a1e0ee20f595..f9717fe9bd85 100644 --- a/Documentation/spi/pxa2xx +++ b/Documentation/spi/pxa2xx | |||
| @@ -102,7 +102,7 @@ struct pxa2xx_spi_chip { | |||
| 102 | u8 tx_threshold; | 102 | u8 tx_threshold; |
| 103 | u8 rx_threshold; | 103 | u8 rx_threshold; |
| 104 | u8 dma_burst_size; | 104 | u8 dma_burst_size; |
| 105 | u32 timeout_microsecs; | 105 | u32 timeout; |
| 106 | u8 enable_loopback; | 106 | u8 enable_loopback; |
| 107 | void (*cs_control)(u32 command); | 107 | void (*cs_control)(u32 command); |
| 108 | }; | 108 | }; |
| @@ -121,7 +121,7 @@ the PXA2xx "Developer Manual" sections on the DMA controller and SSP Controllers | |||
| 121 | to determine the correct value. An SSP configured for byte-wide transfers would | 121 | to determine the correct value. An SSP configured for byte-wide transfers would |
| 122 | use a value of 8. | 122 | use a value of 8. |
| 123 | 123 | ||
| 124 | The "pxa2xx_spi_chip.timeout_microsecs" fields is used to efficiently handle | 124 | The "pxa2xx_spi_chip.timeout" fields is used to efficiently handle |
| 125 | trailing bytes in the SSP receiver fifo. The correct value for this field is | 125 | trailing bytes in the SSP receiver fifo. The correct value for this field is |
| 126 | dependent on the SPI bus speed ("spi_board_info.max_speed_hz") and the specific | 126 | dependent on the SPI bus speed ("spi_board_info.max_speed_hz") and the specific |
| 127 | slave device. Please note that the PXA2xx SSP 1 does not support trailing byte | 127 | slave device. Please note that the PXA2xx SSP 1 does not support trailing byte |
| @@ -162,18 +162,18 @@ static void cs8405a_cs_control(u32 command) | |||
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | static struct pxa2xx_spi_chip cs8415a_chip_info = { | 164 | static struct pxa2xx_spi_chip cs8415a_chip_info = { |
| 165 | .tx_threshold = 12, /* SSP hardward FIFO threshold */ | 165 | .tx_threshold = 8, /* SSP hardward FIFO threshold */ |
| 166 | .rx_threshold = 4, /* SSP hardward FIFO threshold */ | 166 | .rx_threshold = 8, /* SSP hardward FIFO threshold */ |
| 167 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ | 167 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ |
| 168 | .timeout_microsecs = 64, /* Wait at least 64usec to handle trailing */ | 168 | .timeout = 235, /* See Intel documentation */ |
| 169 | .cs_control = cs8415a_cs_control, /* Use external chip select */ | 169 | .cs_control = cs8415a_cs_control, /* Use external chip select */ |
| 170 | }; | 170 | }; |
| 171 | 171 | ||
| 172 | static struct pxa2xx_spi_chip cs8405a_chip_info = { | 172 | static struct pxa2xx_spi_chip cs8405a_chip_info = { |
| 173 | .tx_threshold = 12, /* SSP hardward FIFO threshold */ | 173 | .tx_threshold = 8, /* SSP hardward FIFO threshold */ |
| 174 | .rx_threshold = 4, /* SSP hardward FIFO threshold */ | 174 | .rx_threshold = 8, /* SSP hardward FIFO threshold */ |
| 175 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ | 175 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ |
| 176 | .timeout_microsecs = 64, /* Wait at least 64usec to handle trailing */ | 176 | .timeout = 235, /* See Intel documentation */ |
| 177 | .cs_control = cs8405a_cs_control, /* Use external chip select */ | 177 | .cs_control = cs8405a_cs_control, /* Use external chip select */ |
| 178 | }; | 178 | }; |
| 179 | 179 | ||
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index 8755b3e7b09e..62e32b49cec9 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
| @@ -43,7 +43,7 @@ | |||
| 43 | 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025,1822:0019] | 43 | 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025,1822:0019] |
| 44 | 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1,12ab:2300] | 44 | 43 -> KWorld/VStream XPert DVB-T with cx22702 [17de:08a1,12ab:2300] |
| 45 | 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54] | 45 | 44 -> DViCO FusionHDTV DVB-T Dual Digital [18ac:db50,18ac:db54] |
| 46 | 45 -> KWorld HardwareMpegTV XPert [17de:0840] | 46 | 45 -> KWorld HardwareMpegTV XPert [17de:0840,1421:0305] |
| 47 | 46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44] | 47 | 46 -> DViCO FusionHDTV DVB-T Hybrid [18ac:db40,18ac:db44] |
| 48 | 47 -> pcHDTV HD5500 HDTV [7063:5500] | 48 | 47 -> pcHDTV HD5500 HDTV [7063:5500] |
| 49 | 48 -> Kworld MCE 200 Deluxe [17de:0841] | 49 | 48 -> Kworld MCE 200 Deluxe [17de:0841] |
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 53ce6a39083c..f6201cc37ec5 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
| @@ -76,7 +76,7 @@ | |||
| 76 | 75 -> AVerMedia AVerTVHD MCE A180 [1461:1044] | 76 | 75 -> AVerMedia AVerTVHD MCE A180 [1461:1044] |
| 77 | 76 -> SKNet MonsterTV Mobile [1131:4ee9] | 77 | 76 -> SKNet MonsterTV Mobile [1131:4ee9] |
| 78 | 77 -> Pinnacle PCTV 40i/50i/110i (saa7133) [11bd:002e] | 78 | 77 -> Pinnacle PCTV 40i/50i/110i (saa7133) [11bd:002e] |
| 79 | 78 -> ASUSTeK P7131 Dual [1043:4862] | 79 | 78 -> ASUSTeK P7131 Dual [1043:4862,1043:4876] |
| 80 | 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B) | 80 | 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B) |
| 81 | 80 -> ASUS Digimatrix TV [1043:0210] | 81 | 80 -> ASUS Digimatrix TV [1043:0210] |
| 82 | 81 -> Philips Tiger reference design [1131:2018] | 82 | 81 -> Philips Tiger reference design [1131:2018] |
| @@ -99,3 +99,8 @@ | |||
| 99 | 98 -> Proteus Pro 2309 [0919:2003] | 99 | 98 -> Proteus Pro 2309 [0919:2003] |
| 100 | 99 -> AVerMedia TV Hybrid A16AR [1461:2c00] | 100 | 99 -> AVerMedia TV Hybrid A16AR [1461:2c00] |
| 101 | 100 -> Asus Europa2 OEM [1043:4860] | 101 | 100 -> Asus Europa2 OEM [1043:4860] |
| 102 | 101 -> Pinnacle PCTV 310i [11bd:002f] | ||
| 103 | 102 -> Avermedia AVerTV Studio 507 [1461:9715] | ||
| 104 | 103 -> Compro Videomate DVB-T200A | ||
| 105 | 104 -> Hauppauge WinTV-HVR1110 DVB-T/Hybrid [0070:6701] | ||
| 106 | 105 -> Terratec Cinergy HT PCMCIA [153b:1172] | ||
diff --git a/Documentation/video4linux/cafe_ccic b/Documentation/video4linux/cafe_ccic new file mode 100644 index 000000000000..88821022a5de --- /dev/null +++ b/Documentation/video4linux/cafe_ccic | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | "cafe_ccic" is a driver for the Marvell 88ALP01 "cafe" CMOS camera | ||
| 2 | controller. This is the controller found in first-generation OLPC systems, | ||
| 3 | and this driver was written with support from the OLPC project. | ||
| 4 | |||
| 5 | Current status: the core driver works. It can generate data in YUV422, | ||
| 6 | RGB565, and RGB444 formats. (Anybody looking at the code will see RGB32 as | ||
| 7 | well, but that is a debugging aid which will be removed shortly). VGA and | ||
| 8 | QVGA modes work; CIF is there but the colors remain funky. Only the OV7670 | ||
| 9 | sensor is known to work with this controller at this time. | ||
| 10 | |||
| 11 | To try it out: either of these commands will work: | ||
| 12 | |||
| 13 | mplayer tv:// -tv driver=v4l2:width=640:height=480 -nosound | ||
| 14 | mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=bgr16 -nosound | ||
| 15 | |||
| 16 | The "xawtv" utility also works; gqcam does not, for unknown reasons. | ||
| 17 | |||
| 18 | There are a few load-time options, most of which can be changed after | ||
| 19 | loading via sysfs as well: | ||
| 20 | |||
| 21 | - alloc_bufs_at_load: Normally, the driver will not allocate any DMA | ||
| 22 | buffers until the time comes to transfer data. If this option is set, | ||
| 23 | then worst-case-sized buffers will be allocated at module load time. | ||
| 24 | This option nails down the memory for the life of the module, but | ||
| 25 | perhaps decreases the chances of an allocation failure later on. | ||
| 26 | |||
| 27 | - dma_buf_size: The size of DMA buffers to allocate. Note that this | ||
| 28 | option is only consulted for load-time allocation; when buffers are | ||
| 29 | allocated at run time, they will be sized appropriately for the current | ||
| 30 | camera settings. | ||
| 31 | |||
| 32 | - n_dma_bufs: The controller can cycle through either two or three DMA | ||
| 33 | buffers. Normally, the driver tries to use three buffers; on faster | ||
| 34 | systems, however, it will work well with only two. | ||
| 35 | |||
| 36 | - min_buffers: The minimum number of streaming I/O buffers that the driver | ||
| 37 | will consent to work with. Default is one, but, on slower systems, | ||
| 38 | better behavior with mplayer can be achieved by setting to a higher | ||
| 39 | value (like six). | ||
| 40 | |||
| 41 | - max_buffers: The maximum number of streaming I/O buffers; default is | ||
| 42 | ten. That number was carefully picked out of a hat and should not be | ||
| 43 | assumed to actually mean much of anything. | ||
| 44 | |||
| 45 | - flip: If this boolean parameter is set, the sensor will be instructed to | ||
| 46 | invert the video image. Whether it makes sense is determined by how | ||
| 47 | your particular camera is mounted. | ||
| 48 | |||
| 49 | Work is ongoing with this driver, stay tuned. | ||
| 50 | |||
| 51 | jon | ||
| 52 | |||
| 53 | Jonathan Corbet | ||
| 54 | corbet@lwn.net | ||
diff --git a/Documentation/video4linux/zr36120.txt b/Documentation/video4linux/zr36120.txt deleted file mode 100644 index 1a1c2d03a5c8..000000000000 --- a/Documentation/video4linux/zr36120.txt +++ /dev/null | |||
| @@ -1,162 +0,0 @@ | |||
| 1 | Driver for Trust Computer Products Framegrabber, version 0.6.1 | ||
| 2 | ------ --- ----- -------- -------- ------------ ------- - - - | ||
| 3 | |||
| 4 | - ZORAN ------------------------------------------------------ | ||
| 5 | Author: Pauline Middelink <middelin@polyware.nl> | ||
| 6 | Date: 18 September 1999 | ||
| 7 | Version: 0.6.1 | ||
| 8 | |||
| 9 | - Description ------------------------------------------------ | ||
| 10 | |||
| 11 | Video4Linux compatible driver for an unknown brand framegrabber | ||
| 12 | (Sold in the Netherlands by TRUST Computer Products) and various | ||
| 13 | other zoran zr36120 based framegrabbers. | ||
| 14 | |||
| 15 | The card contains a ZR36120 Multimedia PCI Interface and a Philips | ||
| 16 | SAA7110 Onechip Frontend videodecoder. There is also an DSP of | ||
| 17 | which I have forgotten the number, since i will never get that thing | ||
| 18 | to work without specs from the vendor itself. | ||
| 19 | |||
| 20 | The SAA711x are capable of processing 6 different video inputs, | ||
| 21 | CVBS1..6 and Y1+C1, Y2+C2, Y3+C3. All in 50/60Hz, NTSC, PAL or | ||
| 22 | SECAM and delivering a YUV datastream. On my card the input | ||
| 23 | 'CVBS-0' corresponds to channel CVBS2 and 'S-Video' to Y2+C2. | ||
| 24 | |||
| 25 | I have some reports of other cards working with the mentioned | ||
| 26 | chip sets. For a list of other working cards please have a look | ||
| 27 | at the cards named in the tvcards struct in the beginning of | ||
| 28 | zr36120.c | ||
| 29 | |||
| 30 | After some testing, I discovered that the carddesigner messed up | ||
| 31 | on the I2C interface. The Zoran chip includes 2 lines SDA and SCL | ||
| 32 | which (s)he connected reversely. So we have to clock on the SDA | ||
| 33 | and r/w data on the SCL pin. Life is fun... Each cardtype now has | ||
| 34 | a bit which signifies if you have a card with the same deficiency. | ||
| 35 | |||
| 36 | Oh, for the completeness of this story I must mention that my | ||
| 37 | card delivers the VSYNC pulse of the SAA chip to GIRQ1, not | ||
| 38 | GIRQ0 as some other cards have. This is also incorporated in | ||
| 39 | the driver be clearing/setting the 'useirq1' bit in the tvcard | ||
| 40 | description. | ||
| 41 | |||
| 42 | Another problems of continuous capturing data with a Zoran chip | ||
| 43 | is something nasty inside the chip. It effectively halves the | ||
| 44 | fps we ought to get... Here is the scenario: capturing frames | ||
| 45 | to memory is done in the so-called snapshot mode. In this mode | ||
| 46 | the Zoran stops after capturing a frame worth of data and wait | ||
| 47 | till the application set GRAB bit to indicate readiness for the | ||
| 48 | next frame. After detecting a set bit, the chip neatly waits | ||
| 49 | till the start of a frame, captures it and it goes back to off. | ||
| 50 | Smart ppl will notice the problem here. Its the waiting on the | ||
| 51 | _next_ frame each time we set the GRAB bit... Oh well, 12,5 fps | ||
| 52 | is still plenty fast for me. | ||
| 53 | -- update 28/7/1999 -- | ||
| 54 | Don't believe a word I just said... Proof is the output | ||
| 55 | of `streamer -t 300 -r 25 -f avi15 -o /dev/null` | ||
| 56 | ++--+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 57 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 58 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 59 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 60 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 61 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 62 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 63 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 64 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 65 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 66 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- 25/25 | ||
| 67 | +-s+-+-+-+-+-+-+-+-+-+-+-+-+-s+-+-+-+-+-+-+-+-+-+-+- | ||
| 68 | syncer: done | ||
| 69 | writer: done | ||
| 70 | (note the /dev/null is prudent here, my system is not able to | ||
| 71 | grab /and/ write 25 fps to a file... gifts welcome :) ) | ||
| 72 | The technical reasoning follows: The zoran completed the last | ||
| 73 | frame, the VSYNC goes low, and GRAB is cleared. The interrupt | ||
| 74 | routine starts to work since its VSYNC driven, and again | ||
| 75 | activates the GRAB bit. A few ms later the VSYNC (re-)rises and | ||
| 76 | the zoran starts to work on a new and freshly broadcasted frame.... | ||
| 77 | |||
| 78 | For pointers I used the specs of both chips. Below are the URLs: | ||
| 79 | http://www.zoran.com/ftp/download/devices/pci/ZR36120/36120data.pdf | ||
| 80 | http://www-us.semiconductor.philips.com/acrobat/datasheets/SAA_7110_A_1.pdf | ||
| 81 | Some alternatives for the Philips SAA 7110 datasheet are: | ||
| 82 | http://www.datasheetcatalog.com/datasheets_pdf/S/A/A/7/SAA7110.shtml | ||
| 83 | http://www.datasheetarchive.com/search.php?search=SAA7110&sType=part | ||
| 84 | |||
| 85 | The documentation has very little on absolute numbers or timings | ||
| 86 | needed for the various modes/resolutions, but there are other | ||
| 87 | programs you can borrow those from. | ||
| 88 | |||
| 89 | ------ Install -------------------------------------------- | ||
| 90 | Read the file called TODO. Note its long list of limitations. | ||
| 91 | |||
| 92 | Build a kernel with VIDEO4LINUX enabled. Activate the | ||
| 93 | BT848 driver; we need this because we have need for the | ||
| 94 | other modules (i2c and videodev) it enables. | ||
| 95 | |||
| 96 | To install this software, extract it into a suitable directory. | ||
| 97 | Examine the makefile and change anything you don't like. Type "make". | ||
| 98 | |||
| 99 | After making the modules check if you have the much needed | ||
| 100 | /dev/video devices. If not, execute the following 4 lines: | ||
| 101 | mknod /dev/video c 81 0 | ||
| 102 | mknod /dev/video1 c 81 1 | ||
| 103 | mknod /dev/video2 c 81 2 | ||
| 104 | mknod /dev/video3 c 81 3 | ||
| 105 | mknod /dev/video4 c 81 4 | ||
| 106 | |||
| 107 | After making/checking the devices do: | ||
| 108 | modprobe i2c | ||
| 109 | modprobe videodev | ||
| 110 | modprobe saa7110 (optional) | ||
| 111 | modprobe saa7111 (optional) | ||
| 112 | modprobe tuner (optional) | ||
| 113 | insmod zoran cardtype=<n> | ||
| 114 | |||
| 115 | <n> is the cardtype of the card you have. The cardnumber can | ||
| 116 | be found in the source of zr36120. Look for tvcards. If your | ||
| 117 | card is not there, please try if any other card gives some | ||
| 118 | response, and mail me if you got a working tvcard addition. | ||
| 119 | |||
| 120 | PS. <TVCard editors behold!) | ||
| 121 | Don't forget to set video_input to the number of inputs | ||
| 122 | you defined in the video_mux part of the tvcard definition. | ||
| 123 | It's a common error to add a channel but not incrementing | ||
| 124 | video_input and getting angry with me/v4l/linux/linus :( | ||
| 125 | |||
| 126 | You are now ready to test the framegrabber with your favorite | ||
| 127 | video4linux compatible tool | ||
| 128 | |||
| 129 | ------ Application ---------------------------------------- | ||
| 130 | |||
| 131 | This device works with all Video4Linux compatible applications, | ||
| 132 | given the limitations in the TODO file. | ||
| 133 | |||
| 134 | ------ API ------------------------------------------------ | ||
| 135 | |||
| 136 | This uses the V4L interface as of kernel release 2.1.116, and in | ||
| 137 | fact has not been tested on any lower version. There are a couple | ||
| 138 | of minor differences due to the fact that the amount of data returned | ||
| 139 | with each frame varies, and no doubt there are discrepancies due to my | ||
| 140 | misunderstanding of the API. I intend to convert this driver to the | ||
| 141 | new V4L2 API when it has stabilized more. | ||
| 142 | |||
| 143 | ------ Current state -------------------------------------- | ||
| 144 | |||
| 145 | The driver is capable of overlaying a video image in screen, and | ||
| 146 | even capable of grabbing frames. It uses the BIGPHYSAREA patch | ||
| 147 | to allocate lots of large memory blocks when tis patch is | ||
| 148 | found in the kernel, but it doesn't need it. | ||
| 149 | The consequence is that, when loading the driver as a module, | ||
| 150 | the module may tell you it's out of memory, but 'free' says | ||
| 151 | otherwise. The reason is simple; the modules wants its memory | ||
| 152 | contiguous, not fragmented, and after a long uptime there | ||
| 153 | probably isn't a fragment of memory large enough... | ||
| 154 | |||
| 155 | The driver uses a double buffering scheme, which should really | ||
| 156 | be an n-way buffer, depending on the size of allocated framebuffer | ||
| 157 | and the requested grab-size/format. | ||
| 158 | This current version also fixes a dead-lock situation during irq | ||
| 159 | time, which really, really froze my system... :) | ||
| 160 | |||
| 161 | Good luck. | ||
| 162 | Pauline | ||
