diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-02-07 08:02:58 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-02-07 08:02:58 -0200 |
commit | e650c77431a114bb3bc3b337f0bc11355e68ca03 (patch) | |
tree | 67245356869691d4679aa03e931ceeeba484a196 /v4l2-apps/util/v4l2-dbg.cpp | |
parent | 0852978825971c0dcf401c56733067a916237a96 (diff) | |
download | mediapointer-dvb-s2-e650c77431a114bb3bc3b337f0bc11355e68ca03.tar.gz mediapointer-dvb-s2-e650c77431a114bb3bc3b337f0bc11355e68ca03.tar.bz2 |
Make it work also with usb drivers
From: Mauro Carvalho Chehab <mchehab@infradead.org>
USB drivers, like em28xx and tm6000, have 8 or 16 bit registers, instead of 32,
at host.
This patch adds an option to set step 1 when listing registers on those
devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/util/v4l2-dbg.cpp')
-rw-r--r-- | v4l2-apps/util/v4l2-dbg.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/v4l2-apps/util/v4l2-dbg.cpp b/v4l2-apps/util/v4l2-dbg.cpp index ce6a9ac78..e55cbb2a8 100644 --- a/v4l2-apps/util/v4l2-dbg.cpp +++ b/v4l2-apps/util/v4l2-dbg.cpp @@ -71,6 +71,7 @@ enum Option { OptGetDriverInfo = 'D', OptScanChipIdents = 'C', OptGetChipIdent = 'c', + OptSetStride = 'w', OptHelp = 'h', OptLogStatus = 128, @@ -94,6 +95,7 @@ static struct option long_options[] = { {"verbose", no_argument, 0, OptVerbose}, {"log-status", no_argument, 0, OptLogStatus}, {"list-driverids", no_argument, 0, OptListDriverIDs}, + {"wide", required_argument, 0, OptSetStride}, {0, 0, 0, 0} }; @@ -113,6 +115,8 @@ static void usage(void) printf(" Scan the available host and i2c chips [VIDIOC_G_CHIP_IDENT]\n"); printf(" -c, --get-chip-ident=type=<host/i2cdrv/i2caddr>,chip=<chip>\n"); printf(" Get the chip identifier [VIDIOC_G_CHIP_IDENT]\n"); + printf(" -w, --wide=<reg length>\n"); + printf(" Sets step between two registers\n"); printf(" --log-status log the board status in the kernel log [VIDIOC_LOG_STATUS]\n"); printf(" --list-driverids list the known I2C driver IDs for use with the i2cdrv type\n"); printf("\n"); @@ -262,7 +266,7 @@ static int parse_subopt(char **subs, char * const *subopts, char **value) int main(int argc, char **argv) { char *value, *subs; - int i; + int i, forcedstride = 0; int fd = -1; @@ -341,6 +345,8 @@ int main(int argc, char **argv) break; } } + case OptSetStride: + forcedstride = strtoull(optarg, 0L, 0); break; case OptListRegisters: subs = optarg; @@ -470,8 +476,12 @@ int main(int argc, char **argv) if (options[OptListRegisters]) { int stride = 1; - - if (get_reg.match_type == V4L2_CHIP_MATCH_HOST) stride = 4; + if (forcedstride) { + stride = forcedstride; + } else { + if (get_reg.match_type == V4L2_CHIP_MATCH_HOST) + stride = 4; + } printf("ioctl: VIDIOC_DBG_G_REGISTER\n"); if (reg_max != 0) { |