summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/tvp5150.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-27 12:08:13 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-01 07:25:05 -0200
commit55606310e77f5099d01b59ea9a25401f521c5713 (patch)
treeab3fc850bc44875a3938dd95887efad179494f15 /drivers/media/i2c/tvp5150.c
parente4001e955bec5566848624635cfb2d353ebac507 (diff)
[media] tvp5150: create the expected number of pads
The tvp5150 doesn't have just one pad. It has 3 ones: - IF input - Video output - VBI output Fix it and use the macros for the pad indexes. Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c/tvp5150.c')
-rw-r--r--drivers/media/i2c/tvp5150.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 0ad122fcd632..20428f052506 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -16,6 +16,7 @@
#include <media/i2c/tvp5150.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-of.h>
+#include <media/v4l2-mc.h>
#include "tvp5150_reg.h"
@@ -37,7 +38,9 @@ MODULE_PARM_DESC(debug, "Debug level (0-2)");
struct tvp5150 {
struct v4l2_subdev sd;
- struct media_pad pad;
+#ifdef CONFIG_MEDIA_CONTROLLER
+ struct media_pad pads[DEMOD_NUM_PADS];
+#endif
struct v4l2_ctrl_handler hdl;
struct v4l2_rect rect;
@@ -1313,8 +1316,10 @@ static int tvp5150_probe(struct i2c_client *c,
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
#if defined(CONFIG_MEDIA_CONTROLLER)
- core->pad.flags = MEDIA_PAD_FL_SOURCE;
- res = media_entity_pads_init(&sd->entity, 1, &core->pad);
+ core->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK;
+ core->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE;
+ core->pads[DEMOD_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE;
+ res = media_entity_pads_init(&sd->entity, DEMOD_NUM_PADS, core->pads);
if (res < 0)
return res;
#endif