The patch number 8055 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Mauro Carvalho Chehab  <[EMAIL PROTECTED]>
v4l-board-dbg: Add support for saa7134 registers


Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>


---

 v4l2-apps/util/Makefile        |    3 +++
 v4l2-apps/util/v4l-board-dbg.c |   31 ++++++++++++++++++++++++++++---
 v4l2-apps/util/v4l-board-dbg.h |    3 +++
 3 files changed, 34 insertions(+), 3 deletions(-)

diff -r b8004e41dff5 -r a2cbb6ac15cd v4l2-apps/util/Makefile
--- a/v4l2-apps/util/Makefile   Mon Jun 16 16:35:52 2008 -0300
+++ b/v4l2-apps/util/Makefile   Mon Jun 16 17:41:25 2008 -0300
@@ -54,6 +54,7 @@ keytables:
        ./gen_keytables.pl ../../linux/drivers/media/common/ir-keymaps.c
 
 keytable: keytable.c parse.h keytables
+v4l-board-dbg: v4l-board-dbg.c bttv-dbg.h saa7134-dbg.h
 
 v4l2-driverids.cpp: ../../linux/include/linux/i2c-id.h
        @echo "struct driverid { const char *name; unsigned id; } driverids[] = 
{" >$@
@@ -64,3 +65,5 @@ v4l2-chipids.cpp: ../../linux/include/me
        @echo "struct chipid { const char *name; unsigned id; } chipids[] = {" 
>$@
        @grep V4L2_IDENT_ $^ | sed -e 
's/.*V4L2_IDENT_\([0-9A-Z_]*\)[^=]*=[^0-9]*\([0-9]*\).*/{ "\1", \2 },/' | tr 
A-Z a-z >>$@
        @echo "{ 0, 0 }};" >>$@
+
+
diff -r b8004e41dff5 -r a2cbb6ac15cd v4l2-apps/util/v4l-board-dbg.c
--- a/v4l2-apps/util/v4l-board-dbg.c    Mon Jun 16 16:35:52 2008 -0300
+++ b/v4l2-apps/util/v4l-board-dbg.c    Mon Jun 16 17:41:25 2008 -0300
@@ -27,11 +27,12 @@
 #include <linux/videodev2.h>
 
 #include "bttv-dbg.h"
+#include "saa7134-dbg.h"
 
 #define ARRAY_SIZE(arr) ((int)(sizeof(arr) / sizeof((arr)[0])))
 
 struct board_list {
-       char *queryname;
+       char *name;
        int prefix;             /* Register prefix size */
        struct board_regs *regs;
        int regs_size;
@@ -41,12 +42,20 @@ struct board_list {
 
 struct board_list boards[] = {
        [0] = {                         /* From bttv-dbg.h */
-               .queryname     = BTTV_IDENT,
+               .name          = BTTV_IDENT,
                .prefix        = sizeof (BTTV_PREFIX),
                .regs          = bt8xx_regs,
                .regs_size     = ARRAY_SIZE(bt8xx_regs),
                .alt_regs      = bt8xx_regs_other,
                .alt_regs_size = ARRAY_SIZE(bt8xx_regs_other),
+       },
+       [1] = {                         /* From saa7134-dbg.h */
+               .name          = SAA7134_IDENT,
+               .prefix        = sizeof (SAA7134_PREFIX),
+               .regs          = saa7134_regs,
+               .regs_size     = ARRAY_SIZE(saa7134_regs),
+               .alt_regs      = NULL,
+               .alt_regs_size = 0,
        },
 };
 
@@ -106,6 +115,7 @@ int main(int argc, char **argv)
        int i;
        int fd = -1;
        struct v4l2_register reg;
+       struct v4l2_capability cap;
        struct board_list *curr_bd;
        int board = 0;
        struct option long_options[] = {
@@ -118,6 +128,7 @@ int main(int argc, char **argv)
        };
 
        /* FIXME: need to check for 'board' */
+board=1;
        curr_bd = &boards[board];
 
        /* command args */
@@ -168,6 +179,20 @@ int main(int argc, char **argv)
        }
        free(device);
 
+       if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0) {
+               printf("Error while reading capabilities\n");
+               exit(2);
+       }
+
+       for (board = ARRAY_SIZE(boards)-1; board >= 0; board--) {
+               if (!strcasecmp((char *)cap.driver, boards[board].name))
+                       break;
+       }
+       if (board < 0) {
+               printf("This software doesn't support %s yet\n", cap.driver);
+               exit(3);
+       }
+
        reg.match_type = V4L2_CHIP_MATCH_HOST;
        reg.match_chip = 0;
 
@@ -176,7 +201,7 @@ int main(int argc, char **argv)
                        char name[256];
                        reg.reg = curr_bd->regs[i].reg;
                        if (ioctl(fd, VIDIOC_DBG_G_REGISTER, &reg) < 0) {
-                               printf("Error while reading\n");
+                               printf("Error while reading. Maybe you're not 
root?\n");
                                continue;
                        }
                        sprintf(name, "%s:", curr_bd->regs[i].name);
diff -r b8004e41dff5 -r a2cbb6ac15cd v4l2-apps/util/v4l-board-dbg.h
--- a/v4l2-apps/util/v4l-board-dbg.h    Mon Jun 16 16:35:52 2008 -0300
+++ b/v4l2-apps/util/v4l-board-dbg.h    Mon Jun 16 17:41:25 2008 -0300
@@ -14,8 +14,11 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#ifndef _V4L_BOARD_DBG
+#define _V4L_BOARD_DBG
 struct board_regs {
        unsigned int reg;
        char *name;
        int size;
 };
+#endif
\ No newline at end of file


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/a2cbb6ac15cd9e74e3903c0a9cc55cdc65dfc92c

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to