Commit bc322c0d authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: tvp5150: declare its own pads



As we don't need anymore to share pad numbers with similar
drivers, use its own pad definition instead of a global
model.

Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 87f99717
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -38,10 +38,16 @@ MODULE_PARM_DESC(debug, "Debug level (0-2)");

#define dprintk0(__dev, __arg...) dev_dbg_lvl(__dev, 0, 0, __arg)

enum tvp5150_pads {
	TVP5150_PAD_IF_INPUT,
	TVP5150_PAD_VID_OUT,
	TVP5150_NUM_PADS
};

struct tvp5150 {
	struct v4l2_subdev sd;
#ifdef CONFIG_MEDIA_CONTROLLER
	struct media_pad pads[DEMOD_NUM_PADS];
	struct media_pad pads[TVP5150_NUM_PADS];
	struct media_entity input_ent[TVP5150_INPUT_NUM];
	struct media_pad input_pad[TVP5150_INPUT_NUM];
#endif
@@ -866,7 +872,7 @@ static int tvp5150_fill_fmt(struct v4l2_subdev *sd,
	struct v4l2_mbus_framefmt *f;
	struct tvp5150 *decoder = to_tvp5150(sd);

	if (!format || (format->pad != DEMOD_PAD_VID_OUT))
	if (!format || (format->pad != TVP5150_PAD_VID_OUT))
		return -EINVAL;

	f = &format->format;
@@ -1217,7 +1223,7 @@ static int tvp5150_registered(struct v4l2_subdev *sd)
			return ret;

		ret = media_create_pad_link(input, 0, &sd->entity,
					    DEMOD_PAD_IF_INPUT, 0);
					    TVP5150_PAD_IF_INPUT, 0);
		if (ret < 0) {
			media_device_unregister_entity(input);
			return ret;
@@ -1499,14 +1505,14 @@ static int tvp5150_probe(struct i2c_client *c,
	sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;

#if defined(CONFIG_MEDIA_CONTROLLER)
	core->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK;
	core->pads[DEMOD_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG;
	core->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE;
	core->pads[DEMOD_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV;
	core->pads[TVP5150_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK;
	core->pads[TVP5150_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG;
	core->pads[TVP5150_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE;
	core->pads[TVP5150_PAD_VID_OUT].sig_type = PAD_SIGNAL_DV;

	sd->entity.function = MEDIA_ENT_F_ATV_DECODER;

	res = media_entity_pads_init(&sd->entity, DEMOD_NUM_PADS, core->pads);
	res = media_entity_pads_init(&sd->entity, TVP5150_NUM_PADS, core->pads);
	if (res < 0)
		return res;