aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
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/usb
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/usb')
-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
3 files changed, 6 insertions, 140 deletions
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,