From: Jacopo Mondi <jacopo+renesas@jmondi.org>
To: kieran.bingham+renesas@ideasonboard.com,
laurent.pinchart@ideasonboard.com, niklas.soderlund@ragnatech.se
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
linux-renesas-soc@vger.kernel.org
Subject: [RFC 07/11] media: i2c: max9286: Move notifiers operations
Date: Mon, 16 Dec 2019 18:16:16 +0100 [thread overview]
Message-ID: <20191216171620.372683-8-jacopo+renesas@jmondi.org> (raw)
In-Reply-To: <20191216171620.372683-1-jacopo+renesas@jmondi.org>
In preparation to move the call to max9286_check_config_link() in
the notifier's bound callback, move the notifier's ops below the
max9286_check_config_link() function.
Cosmetic change, no functional changes intended.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
drivers/media/i2c/max9286.c | 114 ++++++++++++++++++------------------
1 file changed, 57 insertions(+), 57 deletions(-)
diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index ab84f0fa66dc..3c2c1f506983 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -445,63 +445,6 @@ static void max9286_configure_i2c(struct max9286_priv *priv, bool localack)
usleep_range(3000, 5000);
}
-/* -----------------------------------------------------------------------------
- * V4L2 Subdev
- */
-
-static int max9286_notify_bound(struct v4l2_async_notifier *notifier,
- struct v4l2_subdev *subdev,
- struct v4l2_async_subdev *asd)
-{
- struct max9286_priv *priv = sd_to_max9286(notifier->sd);
- struct max9286_source *source = asd_to_max9286_source(asd);
- unsigned int index = to_index(priv, source);
- unsigned int src_pad;
- int ret;
-
- ret = media_entity_get_fwnode_pad(&subdev->entity,
- source->fwnode,
- MEDIA_PAD_FL_SOURCE);
- if (ret < 0) {
- dev_err(&priv->client->dev,
- "Failed to find pad for %s\n", subdev->name);
- return ret;
- }
-
- source->sd = subdev;
- src_pad = ret;
-
- ret = media_create_pad_link(&source->sd->entity, src_pad,
- &priv->sd.entity, index,
- MEDIA_LNK_FL_ENABLED |
- MEDIA_LNK_FL_IMMUTABLE);
- if (ret) {
- dev_err(&priv->client->dev,
- "Unable to link %s:%u -> %s:%u\n",
- source->sd->name, src_pad, priv->sd.name, index);
- return ret;
- }
-
- dev_dbg(&priv->client->dev, "Bound %s pad: %u on index %u\n",
- subdev->name, src_pad, index);
-
- return 0;
-}
-
-static void max9286_notify_unbind(struct v4l2_async_notifier *notifier,
- struct v4l2_subdev *subdev,
- struct v4l2_async_subdev *asd)
-{
- struct max9286_source *source = asd_to_max9286_source(asd);
-
- source->sd = NULL;
-}
-
-static const struct v4l2_async_notifier_operations max9286_notify_ops = {
- .bound = max9286_notify_bound,
- .unbind = max9286_notify_unbind,
-};
-
/*
* max9286_check_config_link() - Detect and wait for configuration links
*
@@ -602,6 +545,63 @@ static int max9286_check_video_links(struct max9286_priv *priv)
return 0;
}
+/* -----------------------------------------------------------------------------
+ * V4L2 Subdev
+ */
+
+static int max9286_notify_bound(struct v4l2_async_notifier *notifier,
+ struct v4l2_subdev *subdev,
+ struct v4l2_async_subdev *asd)
+{
+ struct max9286_priv *priv = sd_to_max9286(notifier->sd);
+ struct max9286_source *source = asd_to_max9286_source(asd);
+ unsigned int index = to_index(priv, source);
+ unsigned int src_pad;
+ int ret;
+
+ ret = media_entity_get_fwnode_pad(&subdev->entity,
+ source->fwnode,
+ MEDIA_PAD_FL_SOURCE);
+ if (ret < 0) {
+ dev_err(&priv->client->dev,
+ "Failed to find pad for %s\n", subdev->name);
+ return ret;
+ }
+
+ source->sd = subdev;
+ src_pad = ret;
+
+ ret = media_create_pad_link(&source->sd->entity, src_pad,
+ &priv->sd.entity, index,
+ MEDIA_LNK_FL_ENABLED |
+ MEDIA_LNK_FL_IMMUTABLE);
+ if (ret) {
+ dev_err(&priv->client->dev,
+ "Unable to link %s:%u -> %s:%u\n",
+ source->sd->name, src_pad, priv->sd.name, index);
+ return ret;
+ }
+
+ dev_dbg(&priv->client->dev, "Bound %s pad: %u on index %u\n",
+ subdev->name, src_pad, index);
+
+ return 0;
+}
+
+static void max9286_notify_unbind(struct v4l2_async_notifier *notifier,
+ struct v4l2_subdev *subdev,
+ struct v4l2_async_subdev *asd)
+{
+ struct max9286_source *source = asd_to_max9286_source(asd);
+
+ source->sd = NULL;
+}
+
+static const struct v4l2_async_notifier_operations max9286_notify_ops = {
+ .bound = max9286_notify_bound,
+ .unbind = max9286_notify_unbind,
+};
+
static int max9286_s_stream(struct v4l2_subdev *sd, int enable)
{
struct max9286_priv *priv = sd_to_max9286(sd);
--
2.24.0
next prev parent reply other threads:[~2019-12-16 17:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-16 17:16 [RFC 00/11] GMSL: Initial RDACM21 support Jacopo Mondi
2019-12-16 17:16 ` [RFC 01/11] fixup! DNI: Debug Jacopo Mondi
2019-12-16 22:34 ` Kieran Bingham
2019-12-16 17:16 ` [RFC 02/11] fixup! arm64: dts: renesas: salvator-x: Add MAX9286 expansion board Jacopo Mondi
2019-12-16 22:37 ` Kieran Bingham
2019-12-16 17:16 ` [RFC 03/11] fixup! arm64: dts: renesas: eagle: Provide Eagle FAKRA dynamic overlay Jacopo Mondi
2019-12-16 22:40 ` Kieran Bingham
2019-12-16 17:16 ` [RFC 04/11] fixup! arm64: dts: renesas: eagle: Provide MAX9286 GMSL deserialiser Jacopo Mondi
2019-12-16 22:41 ` Kieran Bingham
2019-12-16 17:16 ` [RFC 05/11] fixup! dt-bindings: media: i2c: Add bindings for IMI RDACM20 Jacopo Mondi
2019-12-16 22:42 ` Laurent Pinchart
2020-02-14 9:07 ` Kieran Bingham
2019-12-16 17:16 ` [RFC 06/11] media: i2c: Break out max9271 from rdacm20 driver Jacopo Mondi
2019-12-16 17:16 ` Jacopo Mondi [this message]
2019-12-16 17:16 ` [RFC 08/11] media: i2c: max9286: Move link setup to completion Jacopo Mondi
2019-12-16 17:16 ` [RFC 09/11] media: i2c: max9286: Expand reverse chanenl amplitude Jacopo Mondi
2019-12-16 17:16 ` [RFC 10/11] WIP: media: i2c: rdacm20: Add RDACM21 support Jacopo Mondi
2019-12-16 17:16 ` [RFC 11/11] arm64: boot: dts: Eagle: Enable RDACM21 Jacopo Mondi
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=20191216171620.372683-8-jacopo+renesas@jmondi.org \
--to=jacopo+renesas@jmondi.org \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).