Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abca2056 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] v4l2: remove g_chip_ident from bridge drivers where it is easy to do so



VIDIOC_DBG_G_CHIP_IDENT has been replaced by VIDIOC_DBG_G_CHIP_INFO. Remove
g_chip_ident support from bridge drivers since it is no longer needed.
This patch takes care of all the trivial cases.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: default avatarScott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 191b79b0
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <media/saa7146_vv.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ctrls.h>
#include <linux/module.h>
@@ -988,26 +987,6 @@ static int vidioc_streamoff(struct file *file, void *__fh, enum v4l2_buf_type ty
	return err;
}

static int vidioc_g_chip_ident(struct file *file, void *__fh,
		struct v4l2_dbg_chip_ident *chip)
{
	struct saa7146_fh *fh = __fh;
	struct saa7146_dev *dev = fh->dev;

	chip->ident = V4L2_IDENT_NONE;
	chip->revision = 0;
	if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
		if (v4l2_chip_match_host(&chip->match))
			chip->ident = V4L2_IDENT_SAA7146;
		return 0;
	}
	if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
	    chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
		return -EINVAL;
	return v4l2_device_call_until_err(&dev->v4l2_dev, 0,
			core, g_chip_ident, chip);
}

const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
	.vidioc_querycap             = vidioc_querycap,
	.vidioc_enum_fmt_vid_cap     = vidioc_enum_fmt_vid_cap,
@@ -1018,7 +997,6 @@ const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
	.vidioc_g_fmt_vid_overlay    = vidioc_g_fmt_vid_overlay,
	.vidioc_try_fmt_vid_overlay  = vidioc_try_fmt_vid_overlay,
	.vidioc_s_fmt_vid_overlay    = vidioc_s_fmt_vid_overlay,
	.vidioc_g_chip_ident         = vidioc_g_chip_ident,

	.vidioc_overlay 	     = vidioc_overlay,
	.vidioc_g_fbuf  	     = vidioc_g_fbuf,
@@ -1039,7 +1017,6 @@ const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
const struct v4l2_ioctl_ops saa7146_vbi_ioctl_ops = {
	.vidioc_querycap             = vidioc_querycap,
	.vidioc_g_fmt_vbi_cap        = vidioc_g_fmt_vbi_cap,
	.vidioc_g_chip_ident         = vidioc_g_chip_ident,

	.vidioc_reqbufs              = vidioc_reqbufs,
	.vidioc_querybuf             = vidioc_querybuf,
+0 −38
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/v4l2-chip-ident.h>
#include <media/tvaudio.h>
#include <media/msp3400.h>

@@ -1907,28 +1906,6 @@ static int bttv_log_status(struct file *file, void *f)
	return 0;
}

static int bttv_g_chip_ident(struct file *file, void *f, struct v4l2_dbg_chip_ident *chip)
{
	struct bttv_fh *fh  = f;
	struct bttv *btv = fh->btv;

	chip->ident = V4L2_IDENT_NONE;
	chip->revision = 0;
	if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
		if (v4l2_chip_match_host(&chip->match)) {
			chip->ident = btv->id;
			if (chip->ident == PCI_DEVICE_ID_FUSION879)
				chip->ident = V4L2_IDENT_BT879;
		}
		return 0;
	}
	if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
	    chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
		return -EINVAL;
	/* TODO: is this correct? */
	return bttv_call_all_err(btv, core, g_chip_ident, chip);
}

#ifdef CONFIG_VIDEO_ADV_DEBUG
static int bttv_g_register(struct file *file, void *f,
					struct v4l2_dbg_register *reg)
@@ -1936,13 +1913,6 @@ static int bttv_g_register(struct file *file, void *f,
	struct bttv_fh *fh = f;
	struct bttv *btv = fh->btv;

	if (!v4l2_chip_match_host(&reg->match)) {
		/* TODO: subdev errors should not be ignored, this should become a
		   subdev helper function. */
		bttv_call_all(btv, core, g_register, reg);
		return 0;
	}

	/* bt848 has a 12-bit register space */
	reg->reg &= 0xfff;
	reg->val = btread(reg->reg);
@@ -1957,13 +1927,6 @@ static int bttv_s_register(struct file *file, void *f,
	struct bttv_fh *fh = f;
	struct bttv *btv = fh->btv;

	if (!v4l2_chip_match_host(&reg->match)) {
		/* TODO: subdev errors should not be ignored, this should become a
		   subdev helper function. */
		bttv_call_all(btv, core, s_register, reg);
		return 0;
	}

	/* bt848 has a 12-bit register space */
	btwrite(reg->val, reg->reg & 0xfff);

@@ -3203,7 +3166,6 @@ static const struct v4l2_ioctl_ops bttv_ioctl_ops = {
	.vidioc_querystd		= bttv_querystd,
	.vidioc_subscribe_event		= v4l2_ctrl_subscribe_event,
	.vidioc_unsubscribe_event	= v4l2_event_unsubscribe,
	.vidioc_g_chip_ident		= bttv_g_chip_ident,
#ifdef CONFIG_VIDEO_ADV_DEBUG
	.vidioc_g_register		= bttv_g_register,
	.vidioc_s_register		= bttv_s_register,
+0 −17
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@

#include <media/saa6752hs.h>
#include <media/v4l2-common.h>
#include <media/v4l2-chip-ident.h>

/* ------------------------------------------------------------------ */

@@ -413,21 +412,6 @@ static int empress_querymenu(struct file *file, void *priv,
	return saa_call_empress(dev, core, querymenu, c);
}

static int empress_g_chip_ident(struct file *file, void *fh,
	       struct v4l2_dbg_chip_ident *chip)
{
	struct saa7134_dev *dev = file->private_data;

	chip->ident = V4L2_IDENT_NONE;
	chip->revision = 0;
	if (chip->match.type == V4L2_CHIP_MATCH_I2C_DRIVER &&
	    !strcmp(chip->match.name, "saa6752hs"))
		return saa_call_empress(dev, core, g_chip_ident, chip);
	if (chip->match.type == V4L2_CHIP_MATCH_I2C_ADDR)
		return saa_call_empress(dev, core, g_chip_ident, chip);
	return -EINVAL;
}

static int empress_s_std(struct file *file, void *priv, v4l2_std_id id)
{
	struct saa7134_dev *dev = file->private_data;
@@ -475,7 +459,6 @@ static const struct v4l2_ioctl_ops ts_ioctl_ops = {
	.vidioc_querymenu		= empress_querymenu,
	.vidioc_g_ctrl			= empress_g_ctrl,
	.vidioc_s_ctrl			= empress_s_ctrl,
	.vidioc_g_chip_ident 		= empress_g_chip_ident,
	.vidioc_s_std			= empress_s_std,
	.vidioc_g_std			= empress_g_std,
};
+0 −4
Original line number Diff line number Diff line
@@ -2258,8 +2258,6 @@ static int vidioc_g_register (struct file *file, void *priv,
	struct saa7134_fh *fh = priv;
	struct saa7134_dev *dev = fh->dev;

	if (!v4l2_chip_match_host(&reg->match))
		return -EINVAL;
	reg->val = saa_readb(reg->reg);
	reg->size = 1;
	return 0;
@@ -2271,8 +2269,6 @@ static int vidioc_s_register (struct file *file, void *priv,
	struct saa7134_fh *fh = priv;
	struct saa7134_dev *dev = fh->dev;

	if (!v4l2_chip_match_host(&reg->match))
		return -EINVAL;
	saa_writeb(reg->reg&0xffffff, reg->val);
	return 0;
}
+4 −11
Original line number Diff line number Diff line
@@ -669,25 +669,18 @@ static int vidioc_g_register(struct file *file, void *fh, struct v4l2_dbg_regist
{
	struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;

	if (v4l2_chip_match_host(&reg->match)) {
	reg->val = saa7146_read(dev, reg->reg);
	reg->size = 4;
	return 0;
}
	call_all(dev, core, g_register, reg);
	return 0;
}

static int vidioc_s_register(struct file *file, void *fh, const struct v4l2_dbg_register *reg)
{
	struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;

	if (v4l2_chip_match_host(&reg->match)) {
	saa7146_write(dev, reg->reg, reg->val);
	return 0;
}
	return call_all(dev, core, s_register, reg);
}
#endif

static struct saa7146_ext_vv vv_data;
Loading