aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-05-29 05:59:35 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-17 07:36:35 -0400
commitabca2056dc3dd0d813ba2f8b013e98cf009ba168 (patch)
tree6da342f2892b662291d686e45d83269e4c8921d5 /drivers/media
parent191b79b0883cb0e604ba63fb3f85cf50ecfc9dc3 (diff)
[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: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/saa7146/saa7146_video.c23
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c38
-rw-r--r--drivers/media/pci/saa7134/saa7134-empress.c17
-rw-r--r--drivers/media/pci/saa7134/saa7134-video.c4
-rw-r--r--drivers/media/pci/saa7146/mxb.c15
-rw-r--r--drivers/media/pci/saa7164/saa7164-encoder.c37
-rw-r--r--drivers/media/pci/saa7164/saa7164-vbi.c9
-rw-r--r--drivers/media/pci/saa7164/saa7164.h1
-rw-r--r--drivers/media/platform/blackfin/bfin_capture.c41
-rw-r--r--drivers/media/platform/davinci/vpif_capture.c66
-rw-r--r--drivers/media/platform/davinci/vpif_display.c66
-rw-r--r--drivers/media/platform/sh_vou.c31
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c34
-rw-r--r--drivers/media/platform/via-camera.c16
-rw-r--r--drivers/media/radio/radio-si476x.c11
-rw-r--r--drivers/media/usb/au0828/au0828-video.c39
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c66
-rw-r--r--drivers/media/usb/stk1160/stk1160-v4l.c41
18 files changed, 10 insertions, 545 deletions
diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c
index fe907f2e8f59..30779498c173 100644
--- a/drivers/media/common/saa7146/saa7146_video.c
+++ b/drivers/media/common/saa7146/saa7146_video.c
@@ -1,7 +1,6 @@
1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2 2
3#include <media/saa7146_vv.h> 3#include <media/saa7146_vv.h>
4#include <media/v4l2-chip-ident.h>
5#include <media/v4l2-event.h> 4#include <media/v4l2-event.h>
6#include <media/v4l2-ctrls.h> 5#include <media/v4l2-ctrls.h>
7#include <linux/module.h> 6#include <linux/module.h>
@@ -988,26 +987,6 @@ static int vidioc_streamoff(struct file *file, void *__fh, enum v4l2_buf_type ty
988 return err; 987 return err;
989} 988}
990 989
991static int vidioc_g_chip_ident(struct file *file, void *__fh,
992 struct v4l2_dbg_chip_ident *chip)
993{
994 struct saa7146_fh *fh = __fh;
995 struct saa7146_dev *dev = fh->dev;
996
997 chip->ident = V4L2_IDENT_NONE;
998 chip->revision = 0;
999 if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
1000 if (v4l2_chip_match_host(&chip->match))
1001 chip->ident = V4L2_IDENT_SAA7146;
1002 return 0;
1003 }
1004 if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
1005 chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
1006 return -EINVAL;
1007 return v4l2_device_call_until_err(&dev->v4l2_dev, 0,
1008 core, g_chip_ident, chip);
1009}
1010
1011const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = { 990const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
1012 .vidioc_querycap = vidioc_querycap, 991 .vidioc_querycap = vidioc_querycap,
1013 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, 992 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
@@ -1018,7 +997,6 @@ const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
1018 .vidioc_g_fmt_vid_overlay = vidioc_g_fmt_vid_overlay, 997 .vidioc_g_fmt_vid_overlay = vidioc_g_fmt_vid_overlay,
1019 .vidioc_try_fmt_vid_overlay = vidioc_try_fmt_vid_overlay, 998 .vidioc_try_fmt_vid_overlay = vidioc_try_fmt_vid_overlay,
1020 .vidioc_s_fmt_vid_overlay = vidioc_s_fmt_vid_overlay, 999 .vidioc_s_fmt_vid_overlay = vidioc_s_fmt_vid_overlay,
1021 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1022 1000
1023 .vidioc_overlay = vidioc_overlay, 1001 .vidioc_overlay = vidioc_overlay,
1024 .vidioc_g_fbuf = vidioc_g_fbuf, 1002 .vidioc_g_fbuf = vidioc_g_fbuf,
@@ -1039,7 +1017,6 @@ const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = {
1039const struct v4l2_ioctl_ops saa7146_vbi_ioctl_ops = { 1017const struct v4l2_ioctl_ops saa7146_vbi_ioctl_ops = {
1040 .vidioc_querycap = vidioc_querycap, 1018 .vidioc_querycap = vidioc_querycap,
1041 .vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap, 1019 .vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap,
1042 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1043 1020
1044 .vidioc_reqbufs = vidioc_reqbufs, 1021 .vidioc_reqbufs = vidioc_reqbufs,
1045 .vidioc_querybuf = vidioc_querybuf, 1022 .vidioc_querybuf = vidioc_querybuf,
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index a334c94a303d..bfcfa3e8543e 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -50,7 +50,6 @@
50#include <media/v4l2-common.h> 50#include <media/v4l2-common.h>
51#include <media/v4l2-ioctl.h> 51#include <media/v4l2-ioctl.h>
52#include <media/v4l2-event.h> 52#include <media/v4l2-event.h>
53#include <media/v4l2-chip-ident.h>
54#include <media/tvaudio.h> 53#include <media/tvaudio.h>
55#include <media/msp3400.h> 54#include <media/msp3400.h>
56 55
@@ -1907,28 +1906,6 @@ static int bttv_log_status(struct file *file, void *f)
1907 return 0; 1906 return 0;
1908} 1907}
1909 1908
1910static int bttv_g_chip_ident(struct file *file, void *f, struct v4l2_dbg_chip_ident *chip)
1911{
1912 struct bttv_fh *fh = f;
1913 struct bttv *btv = fh->btv;
1914
1915 chip->ident = V4L2_IDENT_NONE;
1916 chip->revision = 0;
1917 if (chip->match.type == V4L2_CHIP_MATCH_HOST) {
1918 if (v4l2_chip_match_host(&chip->match)) {
1919 chip->ident = btv->id;
1920 if (chip->ident == PCI_DEVICE_ID_FUSION879)
1921 chip->ident = V4L2_IDENT_BT879;
1922 }
1923 return 0;
1924 }
1925 if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
1926 chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
1927 return -EINVAL;
1928 /* TODO: is this correct? */
1929 return bttv_call_all_err(btv, core, g_chip_ident, chip);
1930}
1931
1932#ifdef CONFIG_VIDEO_ADV_DEBUG 1909#ifdef CONFIG_VIDEO_ADV_DEBUG
1933static int bttv_g_register(struct file *file, void *f, 1910static int bttv_g_register(struct file *file, void *f,
1934 struct v4l2_dbg_register *reg) 1911 struct v4l2_dbg_register *reg)
@@ -1936,13 +1913,6 @@ static int bttv_g_register(struct file *file, void *f,
1936 struct bttv_fh *fh = f; 1913 struct bttv_fh *fh = f;
1937 struct bttv *btv = fh->btv; 1914 struct bttv *btv = fh->btv;
1938 1915
1939 if (!v4l2_chip_match_host(&reg->match)) {
1940 /* TODO: subdev errors should not be ignored, this should become a
1941 subdev helper function. */
1942 bttv_call_all(btv, core, g_register, reg);
1943 return 0;
1944 }
1945
1946 /* bt848 has a 12-bit register space */ 1916 /* bt848 has a 12-bit register space */
1947 reg->reg &= 0xfff; 1917 reg->reg &= 0xfff;
1948 reg->val = btread(reg->reg); 1918 reg->val = btread(reg->reg);
@@ -1957,13 +1927,6 @@ static int bttv_s_register(struct file *file, void *f,
1957 struct bttv_fh *fh = f; 1927 struct bttv_fh *fh = f;
1958 struct bttv *btv = fh->btv; 1928 struct bttv *btv = fh->btv;
1959 1929
1960 if (!v4l2_chip_match_host(&reg->match)) {
1961 /* TODO: subdev errors should not be ignored, this should become a
1962 subdev helper function. */
1963 bttv_call_all(btv, core, s_register, reg);
1964 return 0;
1965 }
1966
1967 /* bt848 has a 12-bit register space */ 1930 /* bt848 has a 12-bit register space */
1968 btwrite(reg->val, reg->reg & 0xfff); 1931 btwrite(reg->val, reg->reg & 0xfff);
1969 1932
@@ -3203,7 +3166,6 @@ static const struct v4l2_ioctl_ops bttv_ioctl_ops = {
3203 .vidioc_querystd = bttv_querystd, 3166 .vidioc_querystd = bttv_querystd,
3204 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 3167 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
3205 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 3168 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
3206 .vidioc_g_chip_ident = bttv_g_chip_ident,
3207#ifdef CONFIG_VIDEO_ADV_DEBUG 3169#ifdef CONFIG_VIDEO_ADV_DEBUG
3208 .vidioc_g_register = bttv_g_register, 3170 .vidioc_g_register = bttv_g_register,
3209 .vidioc_s_register = bttv_s_register, 3171 .vidioc_s_register = bttv_s_register,
diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c
index 66a70814004c..05ab2cb7ef3c 100644
--- a/drivers/media/pci/saa7134/saa7134-empress.c
+++ b/drivers/media/pci/saa7134/saa7134-empress.c
@@ -28,7 +28,6 @@
28 28
29#include <media/saa6752hs.h> 29#include <media/saa6752hs.h>
30#include <media/v4l2-common.h> 30#include <media/v4l2-common.h>
31#include <media/v4l2-chip-ident.h>
32 31
33/* ------------------------------------------------------------------ */ 32/* ------------------------------------------------------------------ */
34 33
@@ -413,21 +412,6 @@ static int empress_querymenu(struct file *file, void *priv,
413 return saa_call_empress(dev, core, querymenu, c); 412 return saa_call_empress(dev, core, querymenu, c);
414} 413}
415 414
416static int empress_g_chip_ident(struct file *file, void *fh,
417 struct v4l2_dbg_chip_ident *chip)
418{
419 struct saa7134_dev *dev = file->private_data;
420
421 chip->ident = V4L2_IDENT_NONE;
422 chip->revision = 0;
423 if (chip->match.type == V4L2_CHIP_MATCH_I2C_DRIVER &&
424 !strcmp(chip->match.name, "saa6752hs"))
425 return saa_call_empress(dev, core, g_chip_ident, chip);
426 if (chip->match.type == V4L2_CHIP_MATCH_I2C_ADDR)
427 return saa_call_empress(dev, core, g_chip_ident, chip);
428 return -EINVAL;
429}
430
431static int empress_s_std(struct file *file, void *priv, v4l2_std_id id) 415static int empress_s_std(struct file *file, void *priv, v4l2_std_id id)
432{ 416{
433 struct saa7134_dev *dev = file->private_data; 417 struct saa7134_dev *dev = file->private_data;
@@ -475,7 +459,6 @@ static const struct v4l2_ioctl_ops ts_ioctl_ops = {
475 .vidioc_querymenu = empress_querymenu, 459 .vidioc_querymenu = empress_querymenu,
476 .vidioc_g_ctrl = empress_g_ctrl, 460 .vidioc_g_ctrl = empress_g_ctrl,
477 .vidioc_s_ctrl = empress_s_ctrl, 461 .vidioc_s_ctrl = empress_s_ctrl,
478 .vidioc_g_chip_ident = empress_g_chip_ident,
479 .vidioc_s_std = empress_s_std, 462 .vidioc_s_std = empress_s_std,
480 .vidioc_g_std = empress_g_std, 463 .vidioc_g_std = empress_g_std,
481}; 464};
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index cc409380ee16..737e643be27a 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -2258,8 +2258,6 @@ static int vidioc_g_register (struct file *file, void *priv,
2258 struct saa7134_fh *fh = priv; 2258 struct saa7134_fh *fh = priv;
2259 struct saa7134_dev *dev = fh->dev; 2259 struct saa7134_dev *dev = fh->dev;
2260 2260
2261 if (!v4l2_chip_match_host(&reg->match))
2262 return -EINVAL;
2263 reg->val = saa_readb(reg->reg); 2261 reg->val = saa_readb(reg->reg);
2264 reg->size = 1; 2262 reg->size = 1;
2265 return 0; 2263 return 0;
@@ -2271,8 +2269,6 @@ static int vidioc_s_register (struct file *file, void *priv,
2271 struct saa7134_fh *fh = priv; 2269 struct saa7134_fh *fh = priv;
2272 struct saa7134_dev *dev = fh->dev; 2270 struct saa7134_dev *dev = fh->dev;
2273 2271
2274 if (!v4l2_chip_match_host(&reg->match))
2275 return -EINVAL;
2276 saa_writeb(reg->reg&0xffffff, reg->val); 2272 saa_writeb(reg->reg&0xffffff, reg->val);
2277 return 0; 2273 return 0;
2278} 2274}
diff --git a/drivers/media/pci/saa7146/mxb.c b/drivers/media/pci/saa7146/mxb.c
index 52cbe7a027cc..8d177691cd7c 100644
--- a/drivers/media/pci/saa7146/mxb.c
+++ b/drivers/media/pci/saa7146/mxb.c
@@ -669,12 +669,8 @@ static int vidioc_g_register(struct file *file, void *fh, struct v4l2_dbg_regist
669{ 669{
670 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; 670 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
671 671
672 if (v4l2_chip_match_host(&reg->match)) { 672 reg->val = saa7146_read(dev, reg->reg);
673 reg->val = saa7146_read(dev, reg->reg); 673 reg->size = 4;
674 reg->size = 4;
675 return 0;
676 }
677 call_all(dev, core, g_register, reg);
678 return 0; 674 return 0;
679} 675}
680 676
@@ -682,11 +678,8 @@ static int vidioc_s_register(struct file *file, void *fh, const struct v4l2_dbg_
682{ 678{
683 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; 679 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
684 680
685 if (v4l2_chip_match_host(&reg->match)) { 681 saa7146_write(dev, reg->reg, reg->val);
686 saa7146_write(dev, reg->reg, reg->val); 682 return 0;
687 return 0;
688 }
689 return call_all(dev, core, s_register, reg);
690} 683}
691#endif 684#endif
692 685
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index 63a72fb71f30..e4f53a55eab1 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -1288,38 +1288,6 @@ static const struct v4l2_file_operations mpeg_fops = {
1288 .unlocked_ioctl = video_ioctl2, 1288 .unlocked_ioctl = video_ioctl2,
1289}; 1289};
1290 1290
1291static int saa7164_g_chip_ident(struct file *file, void *fh,
1292 struct v4l2_dbg_chip_ident *chip)
1293{
1294 struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port;
1295 struct saa7164_dev *dev = port->dev;
1296 dprintk(DBGLVL_ENC, "%s()\n", __func__);
1297
1298 return 0;
1299}
1300
1301#ifdef CONFIG_VIDEO_ADV_DEBUG
1302static int saa7164_g_register(struct file *file, void *fh,
1303 struct v4l2_dbg_register *reg)
1304{
1305 struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port;
1306 struct saa7164_dev *dev = port->dev;
1307 dprintk(DBGLVL_ENC, "%s()\n", __func__);
1308
1309 return 0;
1310}
1311
1312static int saa7164_s_register(struct file *file, void *fh,
1313 const struct v4l2_dbg_register *reg)
1314{
1315 struct saa7164_port *port = ((struct saa7164_encoder_fh *)fh)->port;
1316 struct saa7164_dev *dev = port->dev;
1317 dprintk(DBGLVL_ENC, "%s()\n", __func__);
1318
1319 return 0;
1320}
1321#endif
1322
1323static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { 1291static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
1324 .vidioc_s_std = vidioc_s_std, 1292 .vidioc_s_std = vidioc_s_std,
1325 .vidioc_enum_input = vidioc_enum_input, 1293 .vidioc_enum_input = vidioc_enum_input,
@@ -1340,11 +1308,6 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
1340 .vidioc_s_ext_ctrls = vidioc_s_ext_ctrls, 1308 .vidioc_s_ext_ctrls = vidioc_s_ext_ctrls,
1341 .vidioc_try_ext_ctrls = vidioc_try_ext_ctrls, 1309 .vidioc_try_ext_ctrls = vidioc_try_ext_ctrls,
1342 .vidioc_queryctrl = vidioc_queryctrl, 1310 .vidioc_queryctrl = vidioc_queryctrl,
1343 .vidioc_g_chip_ident = saa7164_g_chip_ident,
1344#ifdef CONFIG_VIDEO_ADV_DEBUG
1345 .vidioc_g_register = saa7164_g_register,
1346 .vidioc_s_register = saa7164_s_register,
1347#endif
1348}; 1311};
1349 1312
1350static struct video_device saa7164_mpeg_template = { 1313static struct video_device saa7164_mpeg_template = {
diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c
index da224eb39b95..5a1a69b3dd15 100644
--- a/drivers/media/pci/saa7164/saa7164-vbi.c
+++ b/drivers/media/pci/saa7164/saa7164-vbi.c
@@ -1254,15 +1254,6 @@ static const struct v4l2_ioctl_ops vbi_ioctl_ops = {
1254 .vidioc_s_ext_ctrls = vidioc_s_ext_ctrls, 1254 .vidioc_s_ext_ctrls = vidioc_s_ext_ctrls,
1255 .vidioc_try_ext_ctrls = vidioc_try_ext_ctrls, 1255 .vidioc_try_ext_ctrls = vidioc_try_ext_ctrls,
1256 .vidioc_queryctrl = vidioc_queryctrl, 1256 .vidioc_queryctrl = vidioc_queryctrl,
1257#if 0
1258 .vidioc_g_chip_ident = saa7164_g_chip_ident,
1259#endif
1260#ifdef CONFIG_VIDEO_ADV_DEBUG
1261#if 0
1262 .vidioc_g_register = saa7164_g_register,
1263 .vidioc_s_register = saa7164_s_register,
1264#endif
1265#endif
1266 .vidioc_g_fmt_vbi_cap = saa7164_vbi_fmt, 1257 .vidioc_g_fmt_vbi_cap = saa7164_vbi_fmt,
1267 .vidioc_try_fmt_vbi_cap = saa7164_vbi_fmt, 1258 .vidioc_try_fmt_vbi_cap = saa7164_vbi_fmt,
1268 .vidioc_s_fmt_vbi_cap = saa7164_vbi_fmt, 1259 .vidioc_s_fmt_vbi_cap = saa7164_vbi_fmt,
diff --git a/drivers/media/pci/saa7164/saa7164.h b/drivers/media/pci/saa7164/saa7164.h
index 437284e747c9..8d9c7e692242 100644
--- a/drivers/media/pci/saa7164/saa7164.h
+++ b/drivers/media/pci/saa7164/saa7164.h
@@ -63,7 +63,6 @@
63#include <dmxdev.h> 63#include <dmxdev.h>
64#include <media/v4l2-common.h> 64#include <media/v4l2-common.h>
65#include <media/v4l2-ioctl.h> 65#include <media/v4l2-ioctl.h>
66#include <media/v4l2-chip-ident.h>
67 66
68#include "saa7164-reg.h" 67#include "saa7164-reg.h"
69#include "saa7164-types.h" 68#include "saa7164-types.h"
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c
index ca8d56aecfb0..6652e71ea794 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -32,7 +32,6 @@
32#include <linux/time.h> 32#include <linux/time.h>
33#include <linux/types.h> 33#include <linux/types.h>
34 34
35#include <media/v4l2-chip-ident.h>
36#include <media/v4l2-common.h> 35#include <media/v4l2-common.h>
37#include <media/v4l2-ctrls.h> 36#include <media/v4l2-ctrls.h>
38#include <media/v4l2-device.h> 37#include <media/v4l2-device.h>
@@ -876,41 +875,6 @@ static int bcap_s_parm(struct file *file, void *fh,
876 return v4l2_subdev_call(bcap_dev->sd, video, s_parm, a); 875 return v4l2_subdev_call(bcap_dev->sd, video, s_parm, a);
877} 876}
878 877
879static int bcap_g_chip_ident(struct file *file, void *priv,
880 struct v4l2_dbg_chip_ident *chip)
881{
882 struct bcap_device *bcap_dev = video_drvdata(file);
883
884 chip->ident = V4L2_IDENT_NONE;
885 chip->revision = 0;
886 if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
887 chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
888 return -EINVAL;
889
890 return v4l2_subdev_call(bcap_dev->sd, core,
891 g_chip_ident, chip);
892}
893
894#ifdef CONFIG_VIDEO_ADV_DEBUG
895static int bcap_dbg_g_register(struct file *file, void *priv,
896 struct v4l2_dbg_register *reg)
897{
898 struct bcap_device *bcap_dev = video_drvdata(file);
899
900 return v4l2_subdev_call(bcap_dev->sd, core,
901 g_register, reg);
902}
903
904static int bcap_dbg_s_register(struct file *file, void *priv,
905 const struct v4l2_dbg_register *reg)
906{
907 struct bcap_device *bcap_dev = video_drvdata(file);
908
909 return v4l2_subdev_call(bcap_dev->sd, core,
910 s_register, reg);
911}
912#endif
913
914static int bcap_log_status(struct file *file, void *priv) 878static int bcap_log_status(struct file *file, void *priv)
915{ 879{
916 struct bcap_device *bcap_dev = video_drvdata(file); 880 struct bcap_device *bcap_dev = video_drvdata(file);
@@ -943,11 +907,6 @@ static const struct v4l2_ioctl_ops bcap_ioctl_ops = {
943 .vidioc_streamoff = bcap_streamoff, 907 .vidioc_streamoff = bcap_streamoff,
944 .vidioc_g_parm = bcap_g_parm, 908 .vidioc_g_parm = bcap_g_parm,
945 .vidioc_s_parm = bcap_s_parm, 909 .vidioc_s_parm = bcap_s_parm,
946 .vidioc_g_chip_ident = bcap_g_chip_ident,
947#ifdef CONFIG_VIDEO_ADV_DEBUG
948 .vidioc_g_register = bcap_dbg_g_register,
949 .vidioc_s_register = bcap_dbg_s_register,
950#endif
951 .vidioc_log_status = bcap_log_status, 910 .vidioc_log_status = bcap_log_status,
952}; 911};
953 912
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index caaf4fedadec..d004531e740d 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -24,7 +24,6 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26 26
27#include <media/v4l2-chip-ident.h>
28#include <media/v4l2-ioctl.h> 27#include <media/v4l2-ioctl.h>
29 28
30#include "vpif.h" 29#include "vpif.h"
@@ -1863,66 +1862,6 @@ static int vpif_g_dv_timings(struct file *file, void *priv,
1863} 1862}
1864 1863
1865/* 1864/*
1866 * vpif_g_chip_ident() - Identify the chip
1867 * @file: file ptr
1868 * @priv: file handle
1869 * @chip: chip identity
1870 *
1871 * Returns zero or -EINVAL if read operations fails.
1872 */
1873static int vpif_g_chip_ident(struct file *file, void *priv,
1874 struct v4l2_dbg_chip_ident *chip)
1875{
1876 chip->ident = V4L2_IDENT_NONE;
1877 chip->revision = 0;
1878 if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
1879 chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
1880 vpif_dbg(2, debug, "match_type is invalid.\n");
1881 return -EINVAL;
1882 }
1883
1884 return v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core,
1885 g_chip_ident, chip);
1886}
1887
1888#ifdef CONFIG_VIDEO_ADV_DEBUG
1889/*
1890 * vpif_dbg_g_register() - Read register
1891 * @file: file ptr
1892 * @priv: file handle
1893 * @reg: register to be read
1894 *
1895 * Debugging only
1896 * Returns zero or -EINVAL if read operations fails.
1897 */
1898static int vpif_dbg_g_register(struct file *file, void *priv,
1899 struct v4l2_dbg_register *reg){
1900 struct vpif_fh *fh = priv;
1901 struct channel_obj *ch = fh->channel;
1902
1903 return v4l2_subdev_call(ch->sd, core, g_register, reg);
1904}
1905
1906/*
1907 * vpif_dbg_s_register() - Write to register
1908 * @file: file ptr
1909 * @priv: file handle
1910 * @reg: register to be modified
1911 *
1912 * Debugging only
1913 * Returns zero or -EINVAL if write operations fails.
1914 */
1915static int vpif_dbg_s_register(struct file *file, void *priv,
1916 const struct v4l2_dbg_register *reg)
1917{
1918 struct vpif_fh *fh = priv;
1919 struct channel_obj *ch = fh->channel;
1920
1921 return v4l2_subdev_call(ch->sd, core, s_register, reg);
1922}
1923#endif
1924
1925/*
1926 * vpif_log_status() - Status information 1865 * vpif_log_status() - Status information
1927 * @file: file ptr 1866 * @file: file ptr
1928 * @priv: file handle 1867 * @priv: file handle
@@ -1963,11 +1902,6 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
1963 .vidioc_query_dv_timings = vpif_query_dv_timings, 1902 .vidioc_query_dv_timings = vpif_query_dv_timings,
1964 .vidioc_s_dv_timings = vpif_s_dv_timings, 1903 .vidioc_s_dv_timings = vpif_s_dv_timings,
1965 .vidioc_g_dv_timings = vpif_g_dv_timings, 1904 .vidioc_g_dv_timings = vpif_g_dv_timings,
1966 .vidioc_g_chip_ident = vpif_g_chip_ident,
1967#ifdef CONFIG_VIDEO_ADV_DEBUG
1968 .vidioc_g_register = vpif_dbg_g_register,
1969 .vidioc_s_register = vpif_dbg_s_register,
1970#endif
1971 .vidioc_log_status = vpif_log_status, 1905 .vidioc_log_status = vpif_log_status,
1972}; 1906};
1973 1907
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 5b6f9065b881..6c521f23e40e 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -19,7 +19,6 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21 21
22#include <media/v4l2-chip-ident.h>
23#include <media/v4l2-ioctl.h> 22#include <media/v4l2-ioctl.h>
24 23
25#include "vpif.h" 24#include "vpif.h"
@@ -1501,66 +1500,6 @@ static int vpif_g_dv_timings(struct file *file, void *priv,
1501} 1500}
1502 1501
1503/* 1502/*
1504 * vpif_g_chip_ident() - Identify the chip
1505 * @file: file ptr
1506 * @priv: file handle
1507 * @chip: chip identity
1508 *
1509 * Returns zero or -EINVAL if read operations fails.
1510 */
1511static int vpif_g_chip_ident(struct file *file, void *priv,
1512 struct v4l2_dbg_chip_ident *chip)
1513{
1514 chip->ident = V4L2_IDENT_NONE;
1515 chip->revision = 0;
1516 if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
1517 chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
1518 vpif_dbg(2, debug, "match_type is invalid.\n");
1519 return -EINVAL;
1520 }
1521
1522 return v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core,
1523 g_chip_ident, chip);
1524}
1525
1526#ifdef CONFIG_VIDEO_ADV_DEBUG
1527/*
1528 * vpif_dbg_g_register() - Read register
1529 * @file: file ptr
1530 * @priv: file handle
1531 * @reg: register to be read
1532 *
1533 * Debugging only
1534 * Returns zero or -EINVAL if read operations fails.
1535 */
1536static int vpif_dbg_g_register(struct file *file, void *priv,
1537 struct v4l2_dbg_register *reg){
1538 struct vpif_fh *fh = priv;
1539 struct channel_obj *ch = fh->channel;
1540
1541 return v4l2_subdev_call(ch->sd, core, g_register, reg);
1542}
1543
1544/*
1545 * vpif_dbg_s_register() - Write to register
1546 * @file: file ptr
1547 * @priv: file handle
1548 * @reg: register to be modified
1549 *
1550 * Debugging only
1551 * Returns zero or -EINVAL if write operations fails.
1552 */
1553static int vpif_dbg_s_register(struct file *file, void *priv,
1554 const struct v4l2_dbg_register *reg)
1555{
1556 struct vpif_fh *fh = priv;
1557 struct channel_obj *ch = fh->channel;
1558
1559 return v4l2_subdev_call(ch->sd, core, s_register, reg);
1560}
1561#endif
1562
1563/*
1564 * vpif_log_status() - Status information 1503 * vpif_log_status() - Status information
1565 * @file: file ptr 1504 * @file: file ptr
1566 * @priv: file handle 1505 * @priv: file handle
@@ -1599,11 +1538,6 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
1599 .vidioc_enum_dv_timings = vpif_enum_dv_timings, 1538 .vidioc_enum_dv_timings = vpif_enum_dv_timings,
1600 .vidioc_s_dv_timings = vpif_s_dv_timings, 1539 .vidioc_s_dv_timings = vpif_s_dv_timings,
1601 .vidioc_g_dv_timings = vpif_g_dv_timings, 1540 .vidioc_g_dv_timings = vpif_g_dv_timings,
1602 .vidioc_g_chip_ident = vpif_g_chip_ident,
1603#ifdef CONFIG_VIDEO_ADV_DEBUG
1604 .vidioc_g_register = vpif_dbg_g_register,
1605 .vidioc_s_register = vpif_dbg_s_register,
1606#endif
1607 .vidioc_log_status = vpif_log_status, 1541 .vidioc_log_status = vpif_log_status,
1608}; 1542};
1609 1543
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index 7d0235069c87..fa8ae7241521 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -1248,32 +1248,6 @@ static unsigned int sh_vou_poll(struct file *file, poll_table *wait)
1248 return res; 1248 return res;
1249} 1249}
1250 1250
1251static int sh_vou_g_chip_ident(struct file *file, void *fh,
1252 struct v4l2_dbg_chip_ident *id)
1253{
1254 struct sh_vou_device *vou_dev = video_drvdata(file);
1255
1256 return v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, core, g_chip_ident, id);
1257}
1258
1259#ifdef CONFIG_VIDEO_ADV_DEBUG
1260static int sh_vou_g_register(struct file *file, void *fh,
1261 struct v4l2_dbg_register *reg)
1262{
1263 struct sh_vou_device *vou_dev = video_drvdata(file);
1264
1265 return v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, core, g_register, reg);
1266}
1267
1268static int sh_vou_s_register(struct file *file, void *fh,
1269 const struct v4l2_dbg_register *reg)
1270{
1271 struct sh_vou_device *vou_dev = video_drvdata(file);
1272
1273 return v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, core, s_register, reg);
1274}
1275#endif
1276
1277/* sh_vou display ioctl operations */ 1251/* sh_vou display ioctl operations */
1278static const struct v4l2_ioctl_ops sh_vou_ioctl_ops = { 1252static const struct v4l2_ioctl_ops sh_vou_ioctl_ops = {
1279 .vidioc_querycap = sh_vou_querycap, 1253 .vidioc_querycap = sh_vou_querycap,
@@ -1292,11 +1266,6 @@ static const struct v4l2_ioctl_ops sh_vou_ioctl_ops = {
1292 .vidioc_cropcap = sh_vou_cropcap, 1266 .vidioc_cropcap = sh_vou_cropcap,
1293 .vidioc_g_crop = sh_vou_g_crop, 1267 .vidioc_g_crop = sh_vou_g_crop,
1294 .vidioc_s_crop = sh_vou_s_crop, 1268 .vidioc_s_crop = sh_vou_s_crop,
1295 .vidioc_g_chip_ident = sh_vou_g_chip_ident,
1296#ifdef CONFIG_VIDEO_ADV_DEBUG
1297 .vidioc_g_register = sh_vou_g_register,
1298 .vidioc_s_register = sh_vou_s_register,
1299#endif
1300}; 1269};
1301 1270
1302static const struct v4l2_file_operations sh_vou_fops = { 1271static const struct v4l2_file_operations sh_vou_fops = {
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index eea832c5fd01..68efade15a7c 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1036,35 +1036,6 @@ static int soc_camera_s_parm(struct file *file, void *fh,
1036 return -ENOIOCTLCMD; 1036 return -ENOIOCTLCMD;
1037} 1037}
1038 1038
1039static int soc_camera_g_chip_ident(struct file *file, void *fh,
1040 struct v4l2_dbg_chip_ident *id)
1041{
1042 struct soc_camera_device *icd = file->private_data;
1043 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1044
1045 return v4l2_subdev_call(sd, core, g_chip_ident, id);
1046}
1047
1048#ifdef CONFIG_VIDEO_ADV_DEBUG
1049static int soc_camera_g_register(struct file *file, void *fh,
1050 struct v4l2_dbg_register *reg)
1051{
1052 struct soc_camera_device *icd = file->private_data;
1053 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1054
1055 return v4l2_subdev_call(sd, core, g_register, reg);
1056}
1057
1058static int soc_camera_s_register(struct file *file, void *fh,
1059 const struct v4l2_dbg_register *reg)
1060{
1061 struct soc_camera_device *icd = file->private_data;
1062 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1063
1064 return v4l2_subdev_call(sd, core, s_register, reg);
1065}
1066#endif
1067
1068static int soc_camera_probe(struct soc_camera_device *icd); 1039static int soc_camera_probe(struct soc_camera_device *icd);
1069 1040
1070/* So far this function cannot fail */ 1041/* So far this function cannot fail */
@@ -1495,11 +1466,6 @@ static const struct v4l2_ioctl_ops soc_camera_ioctl_ops = {
1495 .vidioc_s_selection = soc_camera_s_selection, 1466 .vidioc_s_selection = soc_camera_s_selection,
1496 .vidioc_g_parm = soc_camera_g_parm, 1467 .vidioc_g_parm = soc_camera_g_parm,
1497 .vidioc_s_parm = soc_camera_s_parm, 1468 .vidioc_s_parm = soc_camera_s_parm,
1498 .vidioc_g_chip_ident = soc_camera_g_chip_ident,
1499#ifdef CONFIG_VIDEO_ADV_DEBUG
1500 .vidioc_g_register = soc_camera_g_register,
1501 .vidioc_s_register = soc_camera_s_register,
1502#endif
1503}; 1469};
1504 1470
1505static int video_dev_create(struct soc_camera_device *icd) 1471static int video_dev_create(struct soc_camera_device *icd)
diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c
index a794cd6c4441..e3438277b80b 100644
--- a/drivers/media/platform/via-camera.c
+++ b/drivers/media/platform/via-camera.c
@@ -17,7 +17,6 @@
17#include <linux/videodev2.h> 17#include <linux/videodev2.h>
18#include <media/v4l2-device.h> 18#include <media/v4l2-device.h>
19#include <media/v4l2-ioctl.h> 19#include <media/v4l2-ioctl.h>
20#include <media/v4l2-chip-ident.h>
21#include <media/v4l2-ctrls.h> 20#include <media/v4l2-ctrls.h>
22#include <media/ov7670.h> 21#include <media/ov7670.h>
23#include <media/videobuf-dma-sg.h> 22#include <media/videobuf-dma-sg.h>
@@ -805,20 +804,6 @@ static const struct v4l2_file_operations viacam_fops = {
805 * The long list of v4l2 ioctl ops 804 * The long list of v4l2 ioctl ops
806 */ 805 */
807 806
808static int viacam_g_chip_ident(struct file *file, void *priv,
809 struct v4l2_dbg_chip_ident *ident)
810{
811 struct via_camera *cam = priv;
812
813 ident->ident = V4L2_IDENT_NONE;
814 ident->revision = 0;
815 if (v4l2_chip_match_host(&ident->match)) {
816 ident->ident = V4L2_IDENT_VIA_VX855;
817 return 0;
818 }
819 return sensor_call(cam, core, g_chip_ident, ident);
820}
821
822/* 807/*
823 * Only one input. 808 * Only one input.
824 */ 809 */
@@ -1174,7 +1159,6 @@ static int viacam_enum_frameintervals(struct file *filp, void *priv,
1174 1159
1175 1160
1176static const struct v4l2_ioctl_ops viacam_ioctl_ops = { 1161static const struct v4l2_ioctl_ops viacam_ioctl_ops = {
1177 .vidioc_g_chip_ident = viacam_g_chip_ident,
1178 .vidioc_enum_input = viacam_enum_input, 1162 .vidioc_enum_input = viacam_enum_input,
1179 .vidioc_g_input = viacam_g_input, 1163 .vidioc_g_input = viacam_g_input,
1180 .vidioc_s_input = viacam_s_input, 1164 .vidioc_s_input = viacam_s_input,
diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c
index 9430c6a29937..e039d0332831 100644
--- a/drivers/media/radio/radio-si476x.c
+++ b/drivers/media/radio/radio-si476x.c
@@ -1018,16 +1018,6 @@ static int si476x_radio_s_ctrl(struct v4l2_ctrl *ctrl)
1018 return retval; 1018 return retval;
1019} 1019}
1020 1020
1021static int si476x_radio_g_chip_ident(struct file *file, void *fh,
1022 struct v4l2_dbg_chip_ident *chip)
1023{
1024 if (chip->match.type == V4L2_CHIP_MATCH_HOST &&
1025 v4l2_chip_match_host(&chip->match))
1026 return 0;
1027 return -EINVAL;
1028}
1029
1030
1031#ifdef CONFIG_VIDEO_ADV_DEBUG 1021#ifdef CONFIG_VIDEO_ADV_DEBUG
1032static int si476x_radio_g_register(struct file *file, void *fh, 1022static int si476x_radio_g_register(struct file *file, void *fh,
1033 struct v4l2_dbg_register *reg) 1023 struct v4l2_dbg_register *reg)
@@ -1203,7 +1193,6 @@ static const struct v4l2_ioctl_ops si4761_ioctl_ops = {
1203 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 1193 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
1204 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 1194 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
1205 1195
1206 .vidioc_g_chip_ident = si476x_radio_g_chip_ident,
1207#ifdef CONFIG_VIDEO_ADV_DEBUG 1196#ifdef CONFIG_VIDEO_ADV_DEBUG
1208 .vidioc_g_register = si476x_radio_g_register, 1197 .vidioc_g_register = si476x_radio_g_register,
1209 .vidioc_s_register = si476x_radio_s_register, 1198 .vidioc_s_register = si476x_radio_s_register,
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 75ac9947cdac..4944a365570a 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -36,7 +36,6 @@
36#include <media/v4l2-common.h> 36#include <media/v4l2-common.h>
37#include <media/v4l2-ioctl.h> 37#include <media/v4l2-ioctl.h>
38#include <media/v4l2-event.h> 38#include <media/v4l2-event.h>
39#include <media/v4l2-chip-ident.h>
40#include <media/tuner.h> 39#include <media/tuner.h>
41#include "au0828.h" 40#include "au0828.h"
42#include "au0828-reg.h" 41#include "au0828-reg.h"
@@ -1638,26 +1637,6 @@ static int vidioc_g_fmt_vbi_cap(struct file *file, void *priv,
1638 return 0; 1637 return 0;
1639} 1638}
1640 1639
1641static int vidioc_g_chip_ident(struct file *file, void *priv,
1642 struct v4l2_dbg_chip_ident *chip)
1643{
1644 struct au0828_fh *fh = priv;
1645 struct au0828_dev *dev = fh->dev;
1646 chip->ident = V4L2_IDENT_NONE;
1647 chip->revision = 0;
1648
1649 if (v4l2_chip_match_host(&chip->match)) {
1650 chip->ident = V4L2_IDENT_AU0828;
1651 return 0;
1652 }
1653
1654 v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_chip_ident, chip);
1655 if (chip->ident == V4L2_IDENT_NONE)
1656 return -EINVAL;
1657
1658 return 0;
1659}
1660
1661static int vidioc_cropcap(struct file *file, void *priv, 1640static int vidioc_cropcap(struct file *file, void *priv,
1662 struct v4l2_cropcap *cc) 1641 struct v4l2_cropcap *cc)
1663{ 1642{
@@ -1779,15 +1758,6 @@ static int vidioc_g_register(struct file *file, void *priv,
1779 struct au0828_fh *fh = priv; 1758 struct au0828_fh *fh = priv;
1780 struct au0828_dev *dev = fh->dev; 1759 struct au0828_dev *dev = fh->dev;
1781 1760
1782 switch (reg->match.type) {
1783 case V4L2_CHIP_MATCH_I2C_DRIVER:
1784 v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_register, reg);
1785 return 0;
1786 default:
1787 if (!v4l2_chip_match_host(&reg->match))
1788 return -EINVAL;
1789 }
1790
1791 reg->val = au0828_read(dev, reg->reg); 1761 reg->val = au0828_read(dev, reg->reg);
1792 return 0; 1762 return 0;
1793} 1763}
@@ -1798,14 +1768,6 @@ static int vidioc_s_register(struct file *file, void *priv,
1798 struct au0828_fh *fh = priv; 1768 struct au0828_fh *fh = priv;
1799 struct au0828_dev *dev = fh->dev; 1769 struct au0828_dev *dev = fh->dev;
1800 1770
1801 switch (reg->match.type) {
1802 case V4L2_CHIP_MATCH_I2C_DRIVER:
1803 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_register, reg);
1804 return 0;
1805 default:
1806 if (!v4l2_chip_match_host(&reg->match))
1807 return -EINVAL;
1808 }
1809 return au0828_writereg(dev, reg->reg, reg->val); 1771 return au0828_writereg(dev, reg->reg, reg->val);
1810} 1772}
1811#endif 1773#endif
@@ -1943,7 +1905,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
1943 .vidioc_g_register = vidioc_g_register, 1905 .vidioc_g_register = vidioc_g_register,
1944 .vidioc_s_register = vidioc_s_register, 1906 .vidioc_s_register = vidioc_s_register,
1945#endif 1907#endif
1946 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1947 .vidioc_log_status = vidioc_log_status, 1908 .vidioc_log_status = vidioc_log_status,
1948 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 1909 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
1949 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 1910 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 32d60e5546bc..1a577ed8ea0c 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -41,7 +41,6 @@
41#include <media/v4l2-common.h> 41#include <media/v4l2-common.h>
42#include <media/v4l2-ioctl.h> 42#include <media/v4l2-ioctl.h>
43#include <media/v4l2-event.h> 43#include <media/v4l2-event.h>
44#include <media/v4l2-chip-ident.h>
45#include <media/msp3400.h> 44#include <media/msp3400.h>
46#include <media/tuner.h> 45#include <media/tuner.h>
47 46
@@ -1309,28 +1308,6 @@ static int vidioc_s_frequency(struct file *file, void *priv,
1309 return 0; 1308 return 0;
1310} 1309}
1311 1310
1312static int vidioc_g_chip_ident(struct file *file, void *priv,
1313 struct v4l2_dbg_chip_ident *chip)
1314{
1315 struct em28xx_fh *fh = priv;
1316 struct em28xx *dev = fh->dev;
1317
1318 chip->ident = V4L2_IDENT_NONE;
1319 chip->revision = 0;
1320 if (chip->match.type == V4L2_CHIP_MATCH_BRIDGE) {
1321 if (chip->match.addr > 1)
1322 return -EINVAL;
1323 return 0;
1324 }
1325 if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
1326 chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
1327 return -EINVAL;
1328
1329 v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_chip_ident, chip);
1330
1331 return 0;
1332}
1333
1334#ifdef CONFIG_VIDEO_ADV_DEBUG 1311#ifdef CONFIG_VIDEO_ADV_DEBUG
1335static int vidioc_g_chip_info(struct file *file, void *priv, 1312static int vidioc_g_chip_info(struct file *file, void *priv,
1336 struct v4l2_dbg_chip_info *chip) 1313 struct v4l2_dbg_chip_info *chip)
@@ -1366,14 +1343,9 @@ static int vidioc_g_register(struct file *file, void *priv,
1366 struct em28xx *dev = fh->dev; 1343 struct em28xx *dev = fh->dev;
1367 int ret; 1344 int ret;
1368 1345
1369 switch (reg->match.type) { 1346 if (reg->match.addr > 1)
1370 case V4L2_CHIP_MATCH_BRIDGE: 1347 return -EINVAL;
1371 if (reg->match.addr > 1) 1348 if (reg->match.addr) {
1372 return -EINVAL;
1373 if (!reg->match.addr)
1374 break;
1375 /* fall-through */
1376 case V4L2_CHIP_MATCH_AC97:
1377 ret = em28xx_read_ac97(dev, reg->reg); 1349 ret = em28xx_read_ac97(dev, reg->reg);
1378 if (ret < 0) 1350 if (ret < 0)
1379 return ret; 1351 return ret;
@@ -1381,15 +1353,6 @@ static int vidioc_g_register(struct file *file, void *priv,
1381 reg->val = ret; 1353 reg->val = ret;
1382 reg->size = 1; 1354 reg->size = 1;
1383 return 0; 1355 return 0;
1384 case V4L2_CHIP_MATCH_I2C_DRIVER:
1385 v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_register, reg);
1386 return 0;
1387 case V4L2_CHIP_MATCH_I2C_ADDR:
1388 /* TODO: is this correct? */
1389 v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_register, reg);
1390 return 0;
1391 default:
1392 return -EINVAL;
1393 } 1356 }
1394 1357
1395 /* Match host */ 1358 /* Match host */
@@ -1421,25 +1384,10 @@ static int vidioc_s_register(struct file *file, void *priv,
1421 struct em28xx *dev = fh->dev; 1384 struct em28xx *dev = fh->dev;
1422 __le16 buf; 1385 __le16 buf;
1423 1386
1424 switch (reg->match.type) { 1387 if (reg->match.addr > 1)
1425 case V4L2_CHIP_MATCH_BRIDGE:
1426 if (reg->match.addr > 1)
1427 return -EINVAL;
1428 if (!reg->match.addr)
1429 break;
1430 /* fall-through */
1431 case V4L2_CHIP_MATCH_AC97:
1432 return em28xx_write_ac97(dev, reg->reg, reg->val);
1433 case V4L2_CHIP_MATCH_I2C_DRIVER:
1434 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_register, reg);
1435 return 0;
1436 case V4L2_CHIP_MATCH_I2C_ADDR:
1437 /* TODO: is this correct? */
1438 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_register, reg);
1439 return 0;
1440 default:
1441 return -EINVAL; 1388 return -EINVAL;
1442 } 1389 if (reg->match.addr)
1390 return em28xx_write_ac97(dev, reg->reg, reg->val);
1443 1391
1444 /* Match host */ 1392 /* Match host */
1445 buf = cpu_to_le16(reg->val); 1393 buf = cpu_to_le16(reg->val);
@@ -1795,7 +1743,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
1795 .vidioc_s_frequency = vidioc_s_frequency, 1743 .vidioc_s_frequency = vidioc_s_frequency,
1796 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 1744 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
1797 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 1745 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
1798 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1799#ifdef CONFIG_VIDEO_ADV_DEBUG 1746#ifdef CONFIG_VIDEO_ADV_DEBUG
1800 .vidioc_g_chip_info = vidioc_g_chip_info, 1747 .vidioc_g_chip_info = vidioc_g_chip_info,
1801 .vidioc_g_register = vidioc_g_register, 1748 .vidioc_g_register = vidioc_g_register,
@@ -1826,7 +1773,6 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = {
1826 .vidioc_s_frequency = vidioc_s_frequency, 1773 .vidioc_s_frequency = vidioc_s_frequency,
1827 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 1774 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
1828 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 1775 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
1829 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1830#ifdef CONFIG_VIDEO_ADV_DEBUG 1776#ifdef CONFIG_VIDEO_ADV_DEBUG
1831 .vidioc_g_chip_info = vidioc_g_chip_info, 1777 .vidioc_g_chip_info = vidioc_g_chip_info,
1832 .vidioc_g_register = vidioc_g_register, 1778 .vidioc_g_register = vidioc_g_register,
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index a59153d2f8bf..876fc26565e3 100644
--- a/drivers/media/usb/stk1160/stk1160-v4l.c
+++ b/drivers/media/usb/stk1160/stk1160-v4l.c
@@ -31,7 +31,6 @@
31#include <media/v4l2-ioctl.h> 31#include <media/v4l2-ioctl.h>
32#include <media/v4l2-fh.h> 32#include <media/v4l2-fh.h>
33#include <media/v4l2-event.h> 33#include <media/v4l2-event.h>
34#include <media/v4l2-chip-ident.h>
35#include <media/videobuf2-vmalloc.h> 34#include <media/videobuf2-vmalloc.h>
36 35
37#include <media/saa7115.h> 36#include <media/saa7115.h>
@@ -454,19 +453,6 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
454 return 0; 453 return 0;
455} 454}
456 455
457static int vidioc_g_chip_ident(struct file *file, void *priv,
458 struct v4l2_dbg_chip_ident *chip)
459{
460 switch (chip->match.type) {
461 case V4L2_CHIP_MATCH_BRIDGE:
462 chip->ident = V4L2_IDENT_NONE;
463 chip->revision = 0;
464 return 0;
465 default:
466 return -EINVAL;
467 }
468}
469
470#ifdef CONFIG_VIDEO_ADV_DEBUG 456#ifdef CONFIG_VIDEO_ADV_DEBUG
471static int vidioc_g_register(struct file *file, void *priv, 457static int vidioc_g_register(struct file *file, void *priv,
472 struct v4l2_dbg_register *reg) 458 struct v4l2_dbg_register *reg)
@@ -475,19 +461,6 @@ static int vidioc_g_register(struct file *file, void *priv,
475 int rc; 461 int rc;
476 u8 val; 462 u8 val;
477 463
478 switch (reg->match.type) {
479 case V4L2_CHIP_MATCH_I2C_DRIVER:
480 v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_register, reg);
481 return 0;
482 case V4L2_CHIP_MATCH_I2C_ADDR:
483 /* TODO: is this correct? */
484 v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_register, reg);
485 return 0;
486 default:
487 if (!v4l2_chip_match_host(&reg->match))
488 return -EINVAL;
489 }
490
491 /* Match host */ 464 /* Match host */
492 rc = stk1160_read_reg(dev, reg->reg, &val); 465 rc = stk1160_read_reg(dev, reg->reg, &val);
493 reg->val = val; 466 reg->val = val;
@@ -501,19 +474,6 @@ static int vidioc_s_register(struct file *file, void *priv,
501{ 474{
502 struct stk1160 *dev = video_drvdata(file); 475 struct stk1160 *dev = video_drvdata(file);
503 476
504 switch (reg->match.type) {
505 case V4L2_CHIP_MATCH_I2C_DRIVER:
506 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_register, reg);
507 return 0;
508 case V4L2_CHIP_MATCH_I2C_ADDR:
509 /* TODO: is this correct? */
510 v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_register, reg);
511 return 0;
512 default:
513 if (!v4l2_chip_match_host(&reg->match))
514 return -EINVAL;
515 }
516
517 /* Match host */ 477 /* Match host */
518 return stk1160_write_reg(dev, reg->reg, cpu_to_le16(reg->val)); 478 return stk1160_write_reg(dev, reg->reg, cpu_to_le16(reg->val));
519} 479}
@@ -543,7 +503,6 @@ static const struct v4l2_ioctl_ops stk1160_ioctl_ops = {
543 .vidioc_log_status = v4l2_ctrl_log_status, 503 .vidioc_log_status = v4l2_ctrl_log_status,
544 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 504 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
545 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 505 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
546 .vidioc_g_chip_ident = vidioc_g_chip_ident,
547 506
548#ifdef CONFIG_VIDEO_ADV_DEBUG 507#ifdef CONFIG_VIDEO_ADV_DEBUG
549 .vidioc_g_register = vidioc_g_register, 508 .vidioc_g_register = vidioc_g_register,