Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367005
b: refs/heads/master
c: cd634f1
h: refs/heads/master
i:
  367003: b657c5a
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 14, 2013
1 parent 50b0548 commit 3b85f03
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dfc2e12df02d49a1567bc90989ceef870cf5b147
refs/heads/master: cd634f1bfc182e564f33809fdca33027bb99fceb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ card. Regular applications must not use it. When you found a chip
specific bug, please contact the linux-media mailing list (&v4l-ml;)
so it can be fixed.</para>

<para>Additionally the Linux kernel must be compiled with the
<constant>CONFIG_VIDEO_ADV_DEBUG</constant> option to enable this ioctl.</para>

<para>To query the driver applications must initialize the
<structfield>match.type</structfield> and
<structfield>match.addr</structfield> or <structfield>match.name</structfield>
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/usb/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,7 @@ static int vidioc_g_chip_ident(struct file *file, void *priv,
return 0;
}

#ifdef CONFIG_VIDEO_ADV_DEBUG
static int vidioc_g_chip_name(struct file *file, void *priv,
struct v4l2_dbg_chip_name *chip)
{
Expand All @@ -1346,7 +1347,6 @@ static int vidioc_g_chip_name(struct file *file, void *priv,
return 0;
}

#ifdef CONFIG_VIDEO_ADV_DEBUG
static int em28xx_reg_len(int reg)
{
switch (reg) {
Expand Down Expand Up @@ -1796,8 +1796,8 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
.vidioc_g_chip_ident = vidioc_g_chip_ident,
.vidioc_g_chip_name = vidioc_g_chip_name,
#ifdef CONFIG_VIDEO_ADV_DEBUG
.vidioc_g_chip_name = vidioc_g_chip_name,
.vidioc_g_register = vidioc_g_register,
.vidioc_s_register = vidioc_s_register,
#endif
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/v4l2-core/v4l2-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ static void determine_valid_ioctls(struct video_device *vdev)
SET_VALID_IOCTL(ops, VIDIOC_G_FREQUENCY, vidioc_g_frequency);
SET_VALID_IOCTL(ops, VIDIOC_S_FREQUENCY, vidioc_s_frequency);
SET_VALID_IOCTL(ops, VIDIOC_LOG_STATUS, vidioc_log_status);
set_bit(_IOC_NR(VIDIOC_DBG_G_CHIP_NAME), valid_ioctls);
#ifdef CONFIG_VIDEO_ADV_DEBUG
set_bit(_IOC_NR(VIDIOC_DBG_G_CHIP_NAME), valid_ioctls);
set_bit(_IOC_NR(VIDIOC_DBG_G_REGISTER), valid_ioctls);
set_bit(_IOC_NR(VIDIOC_DBG_S_REGISTER), valid_ioctls);
#endif
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/media/v4l2-core/v4l2-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1873,19 +1873,18 @@ static int v4l_dbg_g_chip_ident(const struct v4l2_ioctl_ops *ops,
static int v4l_dbg_g_chip_name(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{
#ifdef CONFIG_VIDEO_ADV_DEBUG
struct video_device *vfd = video_devdata(file);
struct v4l2_dbg_chip_name *p = arg;
struct v4l2_subdev *sd;
int idx = 0;

switch (p->match.type) {
case V4L2_CHIP_MATCH_BRIDGE:
#ifdef CONFIG_VIDEO_ADV_DEBUG
if (ops->vidioc_s_register)
p->flags |= V4L2_CHIP_FL_WRITABLE;
if (ops->vidioc_g_register)
p->flags |= V4L2_CHIP_FL_READABLE;
#endif
if (ops->vidioc_g_chip_name)
return ops->vidioc_g_chip_name(file, fh, arg);
if (p->match.addr)
Expand All @@ -1904,19 +1903,20 @@ static int v4l_dbg_g_chip_name(const struct v4l2_ioctl_ops *ops,
break;
v4l2_device_for_each_subdev(sd, vfd->v4l2_dev) {
if (v4l_dbg_found_match(&p->match, sd, idx++)) {
#ifdef CONFIG_VIDEO_ADV_DEBUG
if (sd->ops->core && sd->ops->core->s_register)
p->flags |= V4L2_CHIP_FL_WRITABLE;
if (sd->ops->core && sd->ops->core->g_register)
p->flags |= V4L2_CHIP_FL_READABLE;
#endif
strlcpy(p->name, sd->name, sizeof(p->name));
return 0;
}
}
break;
}
return -EINVAL;
#else
return -ENOTTY;
#endif
}

static int v4l_dqevent(const struct v4l2_ioctl_ops *ops,
Expand Down
6 changes: 3 additions & 3 deletions trunk/include/media/v4l2-ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ struct v4l2_ioctl_ops {
struct v4l2_dbg_register *reg);
int (*vidioc_s_register) (struct file *file, void *fh,
const struct v4l2_dbg_register *reg);
#endif
int (*vidioc_g_chip_ident) (struct file *file, void *fh,
struct v4l2_dbg_chip_ident *chip);

int (*vidioc_g_chip_name) (struct file *file, void *fh,
struct v4l2_dbg_chip_name *chip);
#endif
int (*vidioc_g_chip_ident) (struct file *file, void *fh,
struct v4l2_dbg_chip_ident *chip);

int (*vidioc_enum_framesizes) (struct file *file, void *fh,
struct v4l2_frmsizeenum *fsize);
Expand Down

0 comments on commit 3b85f03

Please sign in to comment.