All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Marco Felsch <m.felsch@pengutronix.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Nasser Afshin <afshin.nasser@gmail.com>,
	Javier Martinez Canillas <javierm@redhat.com>
Subject: [PATCH 09/13] media: tvp5150: declare its own pads
Date: Wed,  1 Aug 2018 12:55:11 -0300	[thread overview]
Message-ID: <e3a1c6054573773db373d0fc88b7d710a8f9bfcf.1533138685.git.mchehab+samsung@kernel.org> (raw)
In-Reply-To: <cover.1533138685.git.mchehab+samsung@kernel.org>
In-Reply-To: <cover.1533138685.git.mchehab+samsung@kernel.org>

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

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
---
 drivers/media/i2c/tvp5150.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 5037a03b5442..a9f7c70ca25c 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -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;
 
-- 
2.17.1

  parent reply	other threads:[~2018-08-01 17:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01 15:55 [PATCH 00/13] Better handle pads for tuning/decoder part of the devices Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 01/13] media: v4l2: remove VBI output pad Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 02/13] media: v4l2: taint pads with the signal types for consumer devices Mauro Carvalho Chehab
2018-09-26 14:09   ` Laurent Pinchart
2018-09-27 10:01     ` Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 03/13] v4l2-mc: switch it to use the new approach to setup pipelines Mauro Carvalho Chehab
2018-09-26 14:44   ` Laurent Pinchart
2018-09-27 10:40     ` Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 04/13] media: dvb: use signals to discover pads Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 05/13] media: au0828: use signals instead of hardcoding a pad number Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 06/13] media: au8522: declare its own pads Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 07/13] media: msp3400: " Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 08/13] media: saa7115: " Mauro Carvalho Chehab
2018-08-01 15:55 ` Mauro Carvalho Chehab [this message]
2018-08-01 15:55 ` [PATCH 10/13] media: si2157: " Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 11/13] media: saa7134: " Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 12/13] media: mxl111sf: " Mauro Carvalho Chehab
2018-08-01 15:55 ` [PATCH 13/13] media: v4l2-mc: get rid of global pad indexes Mauro Carvalho Chehab
2018-08-02  9:08   ` Hans Verkuil
2018-08-02  9:30     ` Mauro Carvalho Chehab
2018-08-02  9:12 ` [PATCH 00/13] Better handle pads for tuning/decoder part of the devices Hans Verkuil
2018-08-02  9:39   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3a1c6054573773db373d0fc88b7d710a8f9bfcf.1533138685.git.mchehab+samsung@kernel.org \
    --to=mchehab+samsung@kernel.org \
    --cc=afshin.nasser@gmail.com \
    --cc=javierm@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=mchehab@infradead.org \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.