aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/cx231xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-01-03 14:08:07 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-13 18:10:14 -0500
commitb6a40e728099aa645d0d35896532e4f0f6f31e69 (patch)
tree86cd9ebfe02ea294e6caeb60193645a02ca425d8 /drivers/media/usb/cx231xx
parent8cd61969c8a9b564435f4f903bddc09dfd39f944 (diff)
[media] cx231xx: initialize video/vbi pads
Both video and vbi are sink pads. Initialize them as such. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/cx231xx')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c13
-rw-r--r--drivers/media/usb/cx231xx/cx231xx.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index ecea76fe07f6..f3d1a488dfa7 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -2121,7 +2121,12 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
2121 dev_err(dev->dev, "cannot allocate video_device.\n"); 2121 dev_err(dev->dev, "cannot allocate video_device.\n");
2122 return -ENODEV; 2122 return -ENODEV;
2123 } 2123 }
2124 2124#if defined(CONFIG_MEDIA_CONTROLLER)
2125 dev->video_pad.flags = MEDIA_PAD_FL_SINK;
2126 ret = media_entity_init(&dev->vdev->entity, 1, &dev->video_pad, 0);
2127 if (ret < 0)
2128 dev_err(dev->dev, "failed to initialize video media entity!\n");
2129#endif
2125 dev->vdev->ctrl_handler = &dev->ctrl_handler; 2130 dev->vdev->ctrl_handler = &dev->ctrl_handler;
2126 /* register v4l2 video video_device */ 2131 /* register v4l2 video video_device */
2127 ret = video_register_device(dev->vdev, VFL_TYPE_GRABBER, 2132 ret = video_register_device(dev->vdev, VFL_TYPE_GRABBER,
@@ -2147,6 +2152,12 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
2147 dev_err(dev->dev, "cannot allocate video_device.\n"); 2152 dev_err(dev->dev, "cannot allocate video_device.\n");
2148 return -ENODEV; 2153 return -ENODEV;
2149 } 2154 }
2155#if defined(CONFIG_MEDIA_CONTROLLER)
2156 dev->vbi_pad.flags = MEDIA_PAD_FL_SINK;
2157 ret = media_entity_init(&dev->vbi_dev->entity, 1, &dev->vbi_pad, 0);
2158 if (ret < 0)
2159 dev_err(dev->dev, "failed to initialize vbi media entity!\n");
2160#endif
2150 dev->vbi_dev->ctrl_handler = &dev->ctrl_handler; 2161 dev->vbi_dev->ctrl_handler = &dev->ctrl_handler;
2151 /* register v4l2 vbi video_device */ 2162 /* register v4l2 vbi video_device */
2152 ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, 2163 ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI,
diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h
index af9d6c4041dc..e0d3106f6b44 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -660,6 +660,7 @@ struct cx231xx {
660 660
661#if defined(CONFIG_MEDIA_CONTROLLER) 661#if defined(CONFIG_MEDIA_CONTROLLER)
662 struct media_device *media_dev; 662 struct media_device *media_dev;
663 struct media_pad video_pad, vbi_pad;
663#endif 664#endif
664 665
665 unsigned char eedata[256]; 666 unsigned char eedata[256];