All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: mchehab@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com
Cc: p.zabel@pengutronix.de, afshin.nasser@gmail.com,
	javierm@redhat.com, sakari.ailus@linux.intel.com,
	laurent.pinchart@ideasonboard.com, linux-media@vger.kernel.org,
	devicetree@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH 18/22] partial revert of "[media] tvp5150: add HW input connectors support"
Date: Thu, 28 Jun 2018 18:20:50 +0200	[thread overview]
Message-ID: <20180628162054.25613-19-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20180628162054.25613-1-m.felsch@pengutronix.de>

From: Javier Martinez Canillas <javierm@redhat.com>

Commit f7b4b54e6364 ("[media] tvp5150: add HW input connectors support")
added input signals support for the tvp5150, but the approach was found
to be incorrect so the corresponding DT binding commit 82c2ffeb217a
("[media] tvp5150: document input connectors DT bindings") was reverted.

This left the driver with an undocumented (and wrong) DT parsing logic,
so lets get rid of this code as well until the input connectors support
is implemented properly.

It's a partial revert due other patches added on top of mentioned commit
not allowing the commit to be reverted cleanly anymore. But all the code
related to the DT parsing logic and input entities creation are removed.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[m.felsch@pengutronix.de: rm TVP5150_INPUT_NUM define]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/media/i2c/tvp5150.c         | 141 ----------------------------
 include/dt-bindings/media/tvp5150.h |   2 -
 2 files changed, 143 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 3b51b6b67736..a6fec569a610 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -48,8 +48,6 @@ struct tvp5150 {
 	struct v4l2_subdev sd;
 #ifdef CONFIG_MEDIA_CONTROLLER
 	struct media_pad pads[DEMOD_NUM_PADS];
-	struct media_entity input_ent[TVP5150_INPUT_NUM];
-	struct media_pad input_pad[TVP5150_INPUT_NUM];
 #endif
 	struct v4l2_ctrl_handler hdl;
 	struct v4l2_rect rect;
@@ -1191,40 +1189,6 @@ static int tvp5150_enum_frame_size(struct v4l2_subdev *sd,
 	return 0;
 }
 
-/****************************************************************************
-			Media entity ops
- ****************************************************************************/
-
-#ifdef CONFIG_MEDIA_CONTROLLER
-static int tvp5150_link_setup(struct media_entity *entity,
-			      const struct media_pad *local,
-			      const struct media_pad *remote, u32 flags)
-{
-	struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
-	struct tvp5150 *decoder = to_tvp5150(sd);
-	int i;
-
-	for (i = 0; i < TVP5150_INPUT_NUM; i++) {
-		if (remote->entity == &decoder->input_ent[i])
-			break;
-	}
-
-	/* Do nothing for entities that are not input connectors */
-	if (i == TVP5150_INPUT_NUM)
-		return 0;
-
-	decoder->input = i;
-
-	tvp5150_selmux(sd);
-
-	return 0;
-}
-
-static const struct media_entity_operations tvp5150_sd_media_ops = {
-	.link_setup = tvp5150_link_setup,
-};
-#endif
-
 /****************************************************************************
 			I2C Command
  ****************************************************************************/
@@ -1369,42 +1333,6 @@ static int tvp5150_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
 	return 0;
 }
 
-static int tvp5150_registered(struct v4l2_subdev *sd)
-{
-#ifdef CONFIG_MEDIA_CONTROLLER
-	struct tvp5150 *decoder = to_tvp5150(sd);
-	int ret = 0;
-	int i;
-
-	for (i = 0; i < TVP5150_INPUT_NUM; i++) {
-		struct media_entity *input = &decoder->input_ent[i];
-		struct media_pad *pad = &decoder->input_pad[i];
-
-		if (!input->name)
-			continue;
-
-		decoder->input_pad[i].flags = MEDIA_PAD_FL_SOURCE;
-
-		ret = media_entity_pads_init(input, 1, pad);
-		if (ret < 0)
-			return ret;
-
-		ret = media_device_register_entity(sd->v4l2_dev->mdev, input);
-		if (ret < 0)
-			return ret;
-
-		ret = media_create_pad_link(input, 0, &sd->entity,
-					    DEMOD_PAD_IF_INPUT, 0);
-		if (ret < 0) {
-			media_device_unregister_entity(input);
-			return ret;
-		}
-	}
-#endif
-
-	return 0;
-}
-
 /* ----------------------------------------------------------------------- */
 
 static const struct v4l2_ctrl_ops tvp5150_ctrl_ops = {
@@ -1458,10 +1386,6 @@ static const struct v4l2_subdev_ops tvp5150_ops = {
 	.pad = &tvp5150_pad_ops,
 };
 
-static const struct v4l2_subdev_internal_ops tvp5150_internal_ops = {
-	.registered = tvp5150_registered,
-};
-
 /****************************************************************************
 			I2C Client & Driver
  ****************************************************************************/
@@ -1614,12 +1538,6 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 {
 	struct v4l2_fwnode_endpoint bus_cfg;
 	struct device_node *ep;
-#ifdef CONFIG_MEDIA_CONTROLLER
-	struct device_node *connectors, *child;
-	struct media_entity *input;
-	const char *name;
-	u32 input_type;
-#endif
 	unsigned int flags;
 	int ret = 0;
 
@@ -1643,63 +1561,6 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 
 	decoder->mbus_type = bus_cfg.bus_type;
 
-#ifdef CONFIG_MEDIA_CONTROLLER
-	connectors = of_get_child_by_name(np, "connectors");
-
-	if (!connectors)
-		goto err;
-
-	for_each_available_child_of_node(connectors, child) {
-		ret = of_property_read_u32(child, "input", &input_type);
-		if (ret) {
-			dev_err(decoder->sd.dev,
-				 "missing type property in node %s\n",
-				 child->name);
-			goto err_connector;
-		}
-
-		if (input_type >= TVP5150_INPUT_NUM) {
-			ret = -EINVAL;
-			goto err_connector;
-		}
-
-		input = &decoder->input_ent[input_type];
-
-		/* Each input connector can only be defined once */
-		if (input->name) {
-			dev_err(decoder->sd.dev,
-				 "input %s with same type already exists\n",
-				 input->name);
-			ret = -EINVAL;
-			goto err_connector;
-		}
-
-		switch (input_type) {
-		case TVP5150_COMPOSITE0:
-		case TVP5150_COMPOSITE1:
-			input->function = MEDIA_ENT_F_CONN_COMPOSITE;
-			break;
-		case TVP5150_SVIDEO:
-			input->function = MEDIA_ENT_F_CONN_SVIDEO;
-			break;
-		}
-
-		input->flags = MEDIA_ENT_FL_CONNECTOR;
-
-		ret = of_property_read_string(child, "label", &name);
-		if (ret < 0) {
-			dev_err(decoder->sd.dev,
-				 "missing label property in node %s\n",
-				 child->name);
-			goto err_connector;
-		}
-
-		input->name = name;
-	}
-
-err_connector:
-	of_node_put(connectors);
-#endif
 err:
 	of_node_put(ep);
 	return ret;
@@ -1751,7 +1612,6 @@ static int tvp5150_probe(struct i2c_client *c,
 	}
 
 	v4l2_i2c_subdev_init(sd, c, &tvp5150_ops);
-	sd->internal_ops = &tvp5150_internal_ops;
 	sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
 #if defined(CONFIG_MEDIA_CONTROLLER)
@@ -1765,7 +1625,6 @@ static int tvp5150_probe(struct i2c_client *c,
 	if (res < 0)
 		return res;
 
-	sd->entity.ops = &tvp5150_sd_media_ops;
 #endif
 
 	res = tvp5150_detect_version(core);
diff --git a/include/dt-bindings/media/tvp5150.h b/include/dt-bindings/media/tvp5150.h
index c852a35e916e..8637910aae76 100644
--- a/include/dt-bindings/media/tvp5150.h
+++ b/include/dt-bindings/media/tvp5150.h
@@ -26,8 +26,6 @@
 #define TVP5150_COMPOSITE1 1
 #define TVP5150_SVIDEO     2
 
-#define TVP5150_INPUT_NUM  3
-
 /* TVP5150 HW outputs */
 #define TVP5150_NORMAL       0
 #define TVP5150_BLACK_SCREEN 1
-- 
2.17.1

  parent reply	other threads:[~2018-06-28 16:20 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28 16:20 [PATCH 00/21] TVP5150 fixes and new features Marco Felsch
2018-06-28 16:20 ` [PATCH 01/22] [media] tvp5150: fix width alignment during set_selection() Marco Felsch
2018-06-28 16:20 ` [PATCH 02/22] [media] tvp5150: fix switch exit in set control handler Marco Felsch
2018-06-28 16:20 ` [PATCH 03/22] [media] tvp5150: convert register access to regmap Marco Felsch
2018-06-28 16:20 ` [PATCH 04/22] [media] tvp5150: make use of regmap_update_bits Marco Felsch
2018-06-28 16:20 ` [PATCH 05/22] [media] v4l2-rect.h: add position and equal helpers Marco Felsch
2018-06-29 14:12   ` Sakari Ailus
2018-06-28 16:20 ` [PATCH 06/22] [media] tvp5150: add FORMAT_TRY support for get/set selection handlers Marco Felsch
2018-07-31  0:01   ` Mauro Carvalho Chehab
2018-08-09 13:52     ` Marco Felsch
2018-06-28 16:20 ` [PATCH 07/22] [media] tvp5150: add default format helper Marco Felsch
2018-06-28 16:20 ` [PATCH 08/22] [media] tvp5150: trigger autodetection on subdev open to reset cropping Marco Felsch
2018-06-28 16:20 ` [PATCH 09/22] [media] tvp5150: fix standard autodetection Marco Felsch
2018-06-28 16:20 ` [PATCH 10/22] [media] tvp5150: split reset/enable routine Marco Felsch
2018-06-28 16:20 ` [PATCH 11/22] [media] tvp5150: remove pin configuration from initialization tables Marco Felsch
2018-06-28 16:20 ` [PATCH 12/22] [media] tvp5150: Add sync lock interrupt handling Marco Felsch
2018-06-28 16:20 ` [PATCH 13/22] [media] tvp5150: disable output while signal not locked Marco Felsch
2018-07-30 18:00   ` Mauro Carvalho Chehab
2018-07-30 18:06     ` Mauro Carvalho Chehab
2018-07-31  6:02     ` Marco Felsch
2018-06-28 16:20 ` [PATCH 14/22] [media] tvp5150: issue source change events Marco Felsch
2018-06-28 16:20 ` [PATCH 15/22] [media] tvp5150: add sync lock/loss signal debug messages Marco Felsch
2018-06-28 16:20 ` [PATCH 16/22] [media] tvp5150: add querystd Marco Felsch
2018-07-30 18:09   ` Mauro Carvalho Chehab
2018-08-01 13:21     ` Marco Felsch
2018-08-01 14:22       ` Mauro Carvalho Chehab
2018-08-01 14:49         ` Marco Felsch
2018-08-01 15:50           ` Mauro Carvalho Chehab
2018-08-02  8:01             ` Marco Felsch
2018-08-02  9:49               ` Mauro Carvalho Chehab
2018-08-02 10:16                 ` Marco Felsch
2018-08-02 14:38                   ` Mauro Carvalho Chehab
2018-08-02 10:54                 ` Ian Arkver
2018-08-02 11:58                   ` Marco Felsch
2018-06-28 16:20 ` [PATCH 17/22] [media] tvp5150: add g_std callback Marco Felsch
2018-06-28 16:20 ` Marco Felsch [this message]
2018-07-03 23:19   ` [PATCH 18/22] partial revert of "[media] tvp5150: add HW input connectors support" Rob Herring
2018-07-30 18:18   ` Mauro Carvalho Chehab
2018-07-31  7:01     ` Marco Felsch
2018-07-31  8:52     ` Javier Martinez Canillas
2018-07-31 10:06       ` Mauro Carvalho Chehab
2018-07-31 11:26         ` Javier Martinez Canillas
2018-07-31 12:36           ` Marco Felsch
2018-07-31 12:52             ` Javier Martinez Canillas
2018-07-31 13:30               ` Marco Felsch
2018-07-31 19:56                 ` Mauro Carvalho Chehab
2018-08-01 12:10                   ` Marco Felsch
2018-08-01 13:32                     ` Mauro Carvalho Chehab
2018-08-01 15:49                 ` Marco Felsch
2018-08-01 16:23                   ` Javier Martinez Canillas
2018-07-31 13:01             ` Mauro Carvalho Chehab
2018-07-31 13:22         ` Mauro Carvalho Chehab
2018-06-28 16:20 ` [PATCH 19/22] [media] tvp5150: add input source selection of_graph support Marco Felsch
2018-07-30 18:29   ` Mauro Carvalho Chehab
2018-08-08 15:29     ` Marco Felsch
2018-08-08 18:52       ` Mauro Carvalho Chehab
2018-08-09 12:55         ` Marco Felsch
2018-08-09 13:36           ` Mauro Carvalho Chehab
2018-08-09 14:35             ` Marco Felsch
2018-08-09 16:04               ` Mauro Carvalho Chehab
2018-08-09 16:34                 ` Marco Felsch
2018-06-28 16:20 ` [PATCH 20/22] [media] tvp5150: Add input port connectors DT bindings Marco Felsch
2018-07-03 23:23   ` Rob Herring
2018-07-11  8:50     ` Marco Felsch
2018-08-03  7:29     ` Marco Felsch
2018-08-03 17:30       ` Mauro Carvalho Chehab
2018-08-04  9:04         ` Marco Felsch
2018-06-28 16:20 ` [PATCH 21/22] [media] tvp5150: initialize subdev before parsing device tree Marco Felsch
2018-06-28 16:20 ` [PATCH 22/22] [media] tvp5150: Change default input source selection behaviour Marco Felsch
2018-06-28 20:57 ` [PATCH 00/21] TVP5150 fixes and new features Javier Martinez Canillas

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=20180628162054.25613-19-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=afshin.nasser@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=javierm@redhat.com \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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.