1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> 2 <HTML 3 ><HEAD 4 ><TITLE 5 >ioctl VIDIOC_G_CHIP_IDENT</TITLE 6 ><META 7 NAME="GENERATOR" 8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK 9 REL="HOME" 10 TITLE="Video for Linux Two API Specification" 11 HREF="book1.htm"><LINK 12 REL="UP" 13 TITLE="Function Reference" 14 HREF="r7624.htm"><LINK 15 REL="PREVIOUS" 16 TITLE="ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT" 17 HREF="r9688.htm"><LINK 18 REL="NEXT" 19 TITLE="ioctl VIDIOC_G_CROP, VIDIOC_S_CROP" 20 HREF="r9994.htm"></HEAD 21 ><BODY 22 CLASS="REFENTRY" 23 BGCOLOR="#FFFFFF" 24 TEXT="#000000" 25 LINK="#0000FF" 26 VLINK="#840084" 27 ALINK="#0000FF" 28 ><DIV 29 CLASS="NAVHEADER" 30 ><TABLE 31 SUMMARY="Header navigation table" 32 WIDTH="100%" 33 BORDER="0" 34 CELLPADDING="0" 35 CELLSPACING="0" 36 ><TR 37 ><TH 38 COLSPAN="3" 39 ALIGN="center" 40 >Video for Linux Two API Specification: Revision 0.24</TH 41 ></TR 42 ><TR 43 ><TD 44 WIDTH="10%" 45 ALIGN="left" 46 VALIGN="bottom" 47 ><A 48 HREF="r9688.htm" 49 ACCESSKEY="P" 50 >Prev</A 51 ></TD 52 ><TD 53 WIDTH="80%" 54 ALIGN="center" 55 VALIGN="bottom" 56 ></TD 57 ><TD 58 WIDTH="10%" 59 ALIGN="right" 60 VALIGN="bottom" 61 ><A 62 HREF="r9994.htm" 63 ACCESSKEY="N" 64 >Next</A 65 ></TD 66 ></TR 67 ></TABLE 68 ><HR 69 ALIGN="LEFT" 70 WIDTH="100%"></DIV 71 ><H1 72 ><A 73 NAME="VIDIOC-G-CHIP-IDENT" 74 ></A 75 >ioctl VIDIOC_G_CHIP_IDENT</H1 76 ><DIV 77 CLASS="REFNAMEDIV" 78 ><A 79 NAME="AEN9808" 80 ></A 81 ><H2 82 >Name</H2 83 >VIDIOC_G_CHIP_IDENT -- Identify the chips on a TV card</DIV 84 ><DIV 85 CLASS="REFSYNOPSISDIV" 86 ><A 87 NAME="AEN9811" 88 ></A 89 ><H2 90 >Synopsis</H2 91 ><DIV 92 CLASS="FUNCSYNOPSIS" 93 ><P 94 ></P 95 ><A 96 NAME="AEN9812" 97 ></A 98 ><P 99 ><CODE 100 ><CODE 101 CLASS="FUNCDEF" 102 >int ioctl</CODE 103 >(int fd, int request, struct v4l2_chip_ident 104 *argp);</CODE 105 ></P 106 ><P 107 ></P 108 ></DIV 109 ></DIV 110 ><DIV 111 CLASS="REFSECT1" 112 ><A 113 NAME="AEN9822" 114 ></A 115 ><H2 116 >Arguments</H2 117 ><P 118 ></P 119 ><DIV 120 CLASS="VARIABLELIST" 121 ><DL 122 ><DT 123 ><CODE 124 CLASS="PARAMETER" 125 >fd</CODE 126 ></DT 127 ><DD 128 ><P 129 >File descriptor returned by <A 130 HREF="r14090.htm" 131 ><CODE 132 CLASS="FUNCTION" 133 >open()</CODE 134 ></A 135 >.</P 136 ></DD 137 ><DT 138 ><CODE 139 CLASS="PARAMETER" 140 >request</CODE 141 ></DT 142 ><DD 143 ><P 144 >VIDIOC_G_CHIP_IDENT</P 145 ></DD 146 ><DT 147 ><CODE 148 CLASS="PARAMETER" 149 >argp</CODE 150 ></DT 151 ><DD 152 ><P 153 ></P 154 ></DD 155 ></DL 156 ></DIV 157 ></DIV 158 ><DIV 159 CLASS="REFSECT1" 160 ><A 161 NAME="AEN9842" 162 ></A 163 ><H2 164 >Description</H2 165 ><DIV 166 CLASS="NOTE" 167 ><BLOCKQUOTE 168 CLASS="NOTE" 169 ><P 170 ><B 171 >Experimental: </B 172 >This is an <A 173 HREF="x16453.htm" 174 >experimental</A 175 > interface and may change in 176 the future.</P 177 ></BLOCKQUOTE 178 ></DIV 179 ><P 180 >For driver debugging purposes this ioctl allows test 181 applications to query the driver about the chips present on the TV 182 card. Regular applications should not use it. When you found a chip 183 specific bug, please contact the Video4Linux mailing list (<A 184 HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list" 185 TARGET="_top" 186 >https://listman.redhat.com/mailman/listinfo/video4linux-list</A 187 >) 188 so it can be fixed.</P 189 ><P 190 >To query the driver applications must initialize the 191 <CODE 192 CLASS="STRUCTFIELD" 193 >match_type</CODE 194 > and 195 <CODE 196 CLASS="STRUCTFIELD" 197 >match_chip</CODE 198 > fields of a struct <A 199 HREF="r9804.htm#V4L2-CHIP-IDENT" 200 >v4l2_chip_ident</A 201 > 202 and call <CODE 203 CLASS="CONSTANT" 204 >VIDIOC_G_CHIP_IDENT</CODE 205 > with a pointer to 206 this structure. On success the driver stores information about the 207 selected chip in the <CODE 208 CLASS="STRUCTFIELD" 209 >ident</CODE 210 > and 211 <CODE 212 CLASS="STRUCTFIELD" 213 >revision</CODE 214 > fields. On failure the structure 215 remains unchanged.</P 216 ><P 217 >When <CODE 218 CLASS="STRUCTFIELD" 219 >match_type</CODE 220 > is 221 <CODE 222 CLASS="CONSTANT" 223 >V4L2_CHIP_MATCH_HOST</CODE 224 >, 225 <CODE 226 CLASS="STRUCTFIELD" 227 >match_chip</CODE 228 > selects the nth non-I<SUP 229 >2</SUP 230 >C chip 231 on the TV card. You can enumerate all chips by starting at zero and 232 incrementing <CODE 233 CLASS="STRUCTFIELD" 234 >match_chip</CODE 235 > by one until 236 <CODE 237 CLASS="CONSTANT" 238 >VIDIOC_G_CHIP_IDENT</CODE 239 > fails with an <SPAN 240 CLASS="ERRORCODE" 241 >EINVAL</SPAN 242 > error code. 243 Drivers may also interpret <CODE 244 CLASS="STRUCTFIELD" 245 >match_chip</CODE 246 > as a 247 random ID, but we recommend against that. The number zero always 248 selects the host chip, e. g. the chip connected to the PCI bus.</P 249 ><P 250 >When <CODE 251 CLASS="STRUCTFIELD" 252 >match_type</CODE 253 > is 254 <CODE 255 CLASS="CONSTANT" 256 >V4L2_CHIP_MATCH_I2C_DRIVER</CODE 257 >, 258 <CODE 259 CLASS="STRUCTFIELD" 260 >match_chip</CODE 261 > contains a driver ID as defined 262 in the <TT 263 CLASS="FILENAME" 264 >linux/i2c-id.h</TT 265 > header file. For instance 266 <CODE 267 CLASS="CONSTANT" 268 >I2C_DRIVERID_SAA7127</CODE 269 > will match any chip 270 supported by the saa7127 driver, regardless of its I<SUP 271 >2</SUP 272 >C bus address. 273 When multiple chips supported by the same driver are present, the 274 ioctl will return <CODE 275 CLASS="CONSTANT" 276 >V4L2_IDENT_AMBIGUOUS</CODE 277 > in the 278 <CODE 279 CLASS="STRUCTFIELD" 280 >ident</CODE 281 > field.</P 282 ><P 283 >When <CODE 284 CLASS="STRUCTFIELD" 285 >match_type</CODE 286 > is 287 <CODE 288 CLASS="CONSTANT" 289 >V4L2_CHIP_MATCH_I2C_ADDR</CODE 290 >, 291 <CODE 292 CLASS="STRUCTFIELD" 293 >match_chip</CODE 294 > selects a chip by its 7 bit 295 I<SUP 296 >2</SUP 297 >C bus address.</P 298 ><P 299 >On success, the <CODE 300 CLASS="STRUCTFIELD" 301 >ident</CODE 302 > field will 303 contain a chip ID from the Linux 304 <TT 305 CLASS="FILENAME" 306 >media/v4l2-chip-ident.h</TT 307 > header file, and the 308 <CODE 309 CLASS="STRUCTFIELD" 310 >revision</CODE 311 > field will contain a driver 312 specific value, or zero if no particular revision is associated with 313 this chip.</P 314 ><P 315 >When the driver could not identify the selected chip, 316 <CODE 317 CLASS="STRUCTFIELD" 318 >ident</CODE 319 > will contain 320 <CODE 321 CLASS="CONSTANT" 322 >V4L2_IDENT_UNKNOWN</CODE 323 >. When no chip matched 324 <CODE 325 CLASS="STRUCTFIELD" 326 >match_type</CODE 327 > and 328 <CODE 329 CLASS="STRUCTFIELD" 330 >match_chip</CODE 331 >, the ioctl will succeed but the 332 <CODE 333 CLASS="STRUCTFIELD" 334 >ident</CODE 335 > field will contain 336 <CODE 337 CLASS="CONSTANT" 338 >V4L2_IDENT_NONE</CODE 339 >. If multiple chips matched, 340 <CODE 341 CLASS="STRUCTFIELD" 342 >ident</CODE 343 > will contain 344 <CODE 345 CLASS="CONSTANT" 346 >V4L2_IDENT_AMBIGUOUS</CODE 347 >. In all these cases the 348 <CODE 349 CLASS="STRUCTFIELD" 350 >revision</CODE 351 > field remains unchanged.</P 352 ><P 353 >This ioctl is optional, not all drivers may support it. It 354 was introduced in Linux 2.6.21.</P 355 ><P 356 >We recommended the <SPAN 357 CLASS="APPLICATION" 358 >v4l2-dbg</SPAN 359 > 360 utility over calling this ioctl directly. It is available from the 361 LinuxTV v4l-dvb repository; see <A 362 HREF="http://linuxtv.org/repo/" 363 TARGET="_top" 364 >http://linuxtv.org/repo/</A 365 > for 366 access instructions.</P 367 ><DIV 368 CLASS="TABLE" 369 ><A 370 NAME="V4L2-CHIP-IDENT" 371 ></A 372 ><P 373 ><B 374 >Table 1. struct <CODE 375 CLASS="STRUCTNAME" 376 >v4l2_chip_ident</CODE 377 ></B 378 ></P 379 ><TABLE 380 BORDER="0" 381 FRAME="void" 382 WIDTH="100%" 383 CLASS="CALSTABLE" 384 ><COL 385 WIDTH="25%" 386 TITLE="C1"><COL 387 WIDTH="25%" 388 TITLE="C2"><COL 389 WIDTH="50%" 390 TITLE="C3"><TBODY 391 VALIGN="TOP" 392 ><TR 393 ><TD 394 >__u32</TD 395 ><TD 396 ><CODE 397 CLASS="STRUCTFIELD" 398 >match_type</CODE 399 ></TD 400 ><TD 401 >See <A 402 HREF="r9804.htm#IDENT-CHIP-MATCH-TYPES" 403 >Table 2</A 404 > for a list of 405 possible types.</TD 406 ></TR 407 ><TR 408 ><TD 409 >__u32</TD 410 ><TD 411 ><CODE 412 CLASS="STRUCTFIELD" 413 >match_chip</CODE 414 ></TD 415 ><TD 416 >Match a chip by this number, interpreted according 417 to the <CODE 418 CLASS="STRUCTFIELD" 419 >match_type</CODE 420 > field.</TD 421 ></TR 422 ><TR 423 ><TD 424 >__u32</TD 425 ><TD 426 ><CODE 427 CLASS="STRUCTFIELD" 428 >ident</CODE 429 ></TD 430 ><TD 431 >A chip identifier as defined in the Linux 432 <TT 433 CLASS="FILENAME" 434 >media/v4l2-chip-ident.h</TT 435 > header file, or one of 436 the values from <A 437 HREF="r9804.htm#CHIP-IDS" 438 >Table 3</A 439 >.</TD 440 ></TR 441 ><TR 442 ><TD 443 >__u32</TD 444 ><TD 445 ><CODE 446 CLASS="STRUCTFIELD" 447 >revision</CODE 448 ></TD 449 ><TD 450 >A chip revision, chip and driver specific.</TD 451 ></TR 452 ></TBODY 453 ></TABLE 454 ></DIV 455 ><DIV 456 CLASS="TABLE" 457 ><A 458 NAME="IDENT-CHIP-MATCH-TYPES" 459 ></A 460 ><P 461 ><B 462 >Table 2. Chip Match Types</B 463 ></P 464 ><TABLE 465 BORDER="0" 466 FRAME="void" 467 WIDTH="100%" 468 CLASS="CALSTABLE" 469 ><COL 470 WIDTH="38%" 471 TITLE="C1"><COL 472 WIDTH="12%" 473 TITLE="C2"><COL 474 WIDTH="50%" 475 TITLE="C3"><TBODY 476 VALIGN="TOP" 477 ><TR 478 ><TD 479 ><CODE 480 CLASS="CONSTANT" 481 >V4L2_CHIP_MATCH_HOST</CODE 482 ></TD 483 ><TD 484 >0</TD 485 ><TD 486 >Match the nth chip on the card, zero for the 487 host chip. Does not match I<SUP 488 >2</SUP 489 >C chips.</TD 490 ></TR 491 ><TR 492 ><TD 493 ><CODE 494 CLASS="CONSTANT" 495 >V4L2_CHIP_MATCH_I2C_DRIVER</CODE 496 ></TD 497 ><TD 498 >1</TD 499 ><TD 500 >Match an I<SUP 501 >2</SUP 502 >C chip by its driver ID from the 503 <TT 504 CLASS="FILENAME" 505 >linux/i2c-id.h</TT 506 > header file.</TD 507 ></TR 508 ><TR 509 ><TD 510 ><CODE 511 CLASS="CONSTANT" 512 >V4L2_CHIP_MATCH_I2C_ADDR</CODE 513 ></TD 514 ><TD 515 >2</TD 516 ><TD 517 >Match a chip by its 7 bit I<SUP 518 >2</SUP 519 >C bus address.</TD 520 ></TR 521 ></TBODY 522 ></TABLE 523 ></DIV 524 ><DIV 525 CLASS="TABLE" 526 ><A 527 NAME="CHIP-IDS" 528 ></A 529 ><P 530 ><B 531 >Table 3. Chip Identifiers</B 532 ></P 533 ><TABLE 534 BORDER="0" 535 FRAME="void" 536 WIDTH="100%" 537 CLASS="CALSTABLE" 538 ><COL 539 WIDTH="38%" 540 TITLE="C1"><COL 541 WIDTH="12%" 542 TITLE="C2"><COL 543 WIDTH="50%" 544 TITLE="C3"><TBODY 545 VALIGN="TOP" 546 ><TR 547 ><TD 548 ><CODE 549 CLASS="CONSTANT" 550 >V4L2_IDENT_NONE</CODE 551 ></TD 552 ><TD 553 >0</TD 554 ><TD 555 >No chip matched.</TD 556 ></TR 557 ><TR 558 ><TD 559 ><CODE 560 CLASS="CONSTANT" 561 >V4L2_IDENT_AMBIGUOUS</CODE 562 ></TD 563 ><TD 564 >1</TD 565 ><TD 566 >Multiple chips matched.</TD 567 ></TR 568 ><TR 569 ><TD 570 ><CODE 571 CLASS="CONSTANT" 572 >V4L2_IDENT_UNKNOWN</CODE 573 ></TD 574 ><TD 575 >2</TD 576 ><TD 577 >A chip is present at this address, but the driver 578 could not identify it.</TD 579 ></TR 580 ></TBODY 581 ></TABLE 582 ></DIV 583 ></DIV 584 ><DIV 585 CLASS="REFSECT1" 586 ><A 587 NAME="AEN9981" 588 ></A 589 ><H2 590 >Return Value</H2 591 ><P 592 >On success <SPAN 593 CLASS="RETURNVALUE" 594 >0</SPAN 595 > is returned, on error <SPAN 596 CLASS="RETURNVALUE" 597 >-1</SPAN 598 > and the <CODE 599 CLASS="VARNAME" 600 >errno</CODE 601 > variable is set appropriately:</P 602 ><P 603 ></P 604 ><DIV 605 CLASS="VARIABLELIST" 606 ><DL 607 ><DT 608 ><SPAN 609 CLASS="ERRORCODE" 610 >EINVAL</SPAN 611 ></DT 612 ><DD 613 ><P 614 >The driver does not support this ioctl, or the 615 <CODE 616 CLASS="STRUCTFIELD" 617 >match_type</CODE 618 > is invalid.</P 619 ></DD 620 ></DL 621 ></DIV 622 ></DIV 623 ><DIV 624 CLASS="NAVFOOTER" 625 ><HR 626 ALIGN="LEFT" 627 WIDTH="100%"><TABLE 628 SUMMARY="Footer navigation table" 629 WIDTH="100%" 630 BORDER="0" 631 CELLPADDING="0" 632 CELLSPACING="0" 633 ><TR 634 ><TD 635 WIDTH="33%" 636 ALIGN="left" 637 VALIGN="top" 638 ><A 639 HREF="r9688.htm" 640 ACCESSKEY="P" 641 >Prev</A 642 ></TD 643 ><TD 644 WIDTH="34%" 645 ALIGN="center" 646 VALIGN="top" 647 ><A 648 HREF="book1.htm" 649 ACCESSKEY="H" 650 >Home</A 651 ></TD 652 ><TD 653 WIDTH="33%" 654 ALIGN="right" 655 VALIGN="top" 656 ><A 657 HREF="r9994.htm" 658 ACCESSKEY="N" 659 >Next</A 660 ></TD 661 ></TR 662 ><TR 663 ><TD 664 WIDTH="33%" 665 ALIGN="left" 666 VALIGN="top" 667 >ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT</TD 668 ><TD 669 WIDTH="34%" 670 ALIGN="center" 671 VALIGN="top" 672 ><A 673 HREF="r7624.htm" 674 ACCESSKEY="U" 675 >Up</A 676 ></TD 677 ><TD 678 WIDTH="33%" 679 ALIGN="right" 680 VALIGN="top" 681 >ioctl VIDIOC_G_CROP, VIDIOC_S_CROP</TD 682 ></TR 683 ></TABLE 684 ></DIV 685 ></BODY 686 ></HTML 687 > 688