diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-22 16:01:46 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-22 16:01:46 -0200 |
commit | 508d4c2d232f61a3ffc92c05bee7a9afe7559081 (patch) | |
tree | 44bf1905b8d3edeafa8f967c9d6f6f881c2a850c | |
parent | 5b8cbae207001dd7cd7e4a4f09a987b4194d0a8f (diff) | |
download | mediapointer-dvb-s2-508d4c2d232f61a3ffc92c05bee7a9afe7559081.tar.gz mediapointer-dvb-s2-508d4c2d232f61a3ffc92c05bee7a9afe7559081.tar.bz2 |
v4l2-dbg: Use aliases for debug, on available chips
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | v4l2-apps/util/v4l2-dbg.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/v4l2-apps/util/v4l2-dbg.cpp b/v4l2-apps/util/v4l2-dbg.cpp index 412d3bea5..c7ef1206b 100644 --- a/v4l2-apps/util/v4l2-dbg.cpp +++ b/v4l2-apps/util/v4l2-dbg.cpp @@ -487,6 +487,7 @@ int main(int argc, char **argv) subs = optarg; if (subs == NULL) break; + while (*subs != '\0') { static const char * const subopts[] = { "min", @@ -658,6 +659,43 @@ int main(int argc, char **argv) } printf("ioctl: VIDIOC_DBG_G_REGISTER\n"); + if (curr_bd) { + if (reg_min_arg.empty()) + reg_min = 0; + else + reg_min = parse_reg(curr_bd, reg_min_arg); + + + if (reg_max_arg.empty()) + reg_max = 1<<31 - 1; + else + reg_max = parse_reg(curr_bd, reg_max_arg); + + for (int i = 0; i < curr_bd->regs_size; i++) { + if (reg_min_arg.empty() || ((curr_bd->regs[i].reg >= reg_min) && curr_bd->regs[i].reg <= reg_max)) { + get_reg.reg = curr_bd->regs[i].reg; + + if (ioctl(fd, VIDIOC_DBG_G_REGISTER, &get_reg) < 0) + fprintf(stderr, "ioctl: VIDIOC_DBG_G_REGISTER " + "failed for 0x%llx\n", get_reg.reg); + else { + const char *name = reg_name(curr_bd, get_reg.reg); + + printf("Register "); + + if (name) + printf("%s (0x%08llx)", name, get_reg.reg); + else + printf("0x%08llx", get_reg.reg); + + printf(" = %llxh (%lldd %sb)\n", + get_reg.val, get_reg.val, binary(get_reg.val)); + } + } + } + goto list_done; + } + if (!reg_min_arg.empty()) { reg_min = parse_reg(curr_bd, reg_min_arg); if (reg_max_arg.empty()) @@ -668,6 +706,7 @@ int main(int argc, char **argv) print_regs(fd, &get_reg, reg_min, reg_max, stride); goto list_done; } + /* try to match the i2c chip */ switch (get_reg.match_chip) { case I2C_DRIVERID_SAA711X: |