All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugeniu Rosca <erosca@de.adit-jv.com>
To: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Jacopo Mondi" <jacopo+renesas@jmondi.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Steve Longerbeam <steve_longerbeam@mentor.com>,
	"George G. Davis" <george_davis@mentor.com>,
	<linux-media@vger.kernel.org>,
	<linux-renesas-soc@vger.kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Michael Rodin <mrodin@de.adit-jv.com>,
	Eugen Friedrich <efriedrich@de.adit-jv.com>,
	<harsha.manjulamallikarjun@in.bosch.com>,
	Eugeniu Rosca <roscaeugeniu@gmail.com>,
	Eugeniu Rosca <erosca@de.adit-jv.com>
Subject: Re: [PATCH v3 3/9] media: rcar-vin: Create a group notifier
Date: Fri, 5 Apr 2019 18:16:39 +0200	[thread overview]
Message-ID: <20190405161639.GA10433@vmlxhi-102.adit-jv.com> (raw)
In-Reply-To: <20180524101452.GC31036@bigcity.dyn.berto.se>

Hi Niklas, Jacopo cc: Steve

Apologize for reviving this old thread. Just one question below.

On 2018-05-24 10:14:52, Niklas Söderlund wrote:

> Hi Jacopo,

> Thanks for your patch.
>
> On 2018-05-18 16:40:39 +0200, Jacopo Mondi wrote:
>> As CSI-2 subdevices are shared between several VIN instances, a shared
>> notifier to collect the CSI-2 async subdevices is required. So far, the
>> rcar-vin driver used the notifier of the last VIN instance to probe but
>> with the forth-coming introduction of parallel input subdevices support
>> in mc-compliant code path, each VIN may register its own notifier if any
>> parallel subdevice is connected there.
>> 
>> To avoid registering a notifier twice (once for parallel subdev and one
>> for the CSI-2 subdevs) create a group notifier, shared by all the VIN
>> instances.
>> 
>> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
>> ---
>>  drivers/media/platform/rcar-vin/rcar-core.c | 39 +++++++++++------------------
>>  drivers/media/platform/rcar-vin/rcar-vin.h  |  7 +++---
>>  2 files changed, 18 insertions(+), 28 deletions(-)

[..]

>> +
>>  #define vin_to_source(vin)		((vin)->parallel->subdev)

> This in particular I hate and at some point I hope to remove it or
> move  it to rcar-v4l2.c. :-) But that is a task for later and not
> related to  your patch-set.

What about below patch excerpt (courtesy of Steve) which is currently
under review in our tree? If we are on the same page here, we would
happily contribute a patch to you based on below.

Subject: [PATCH] media: rcar-vin: Generalize vin_to_source()

Change the vin_to_source() macro to an inline function that will
retrieve the source subdevice for both media-control and non
media-control mode.

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
---
[..]

diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h
index 0b13b34d03e3..29d8c4a80c35 100644
--- a/drivers/media/platform/rcar-vin/rcar-vin.h
+++ b/drivers/media/platform/rcar-vin/rcar-vin.h
@@ -217,7 +217,21 @@ struct rvin_dev {
 	v4l2_std_id std;
 };
 
-#define vin_to_source(vin)		((vin)->parallel->subdev)
+static inline struct v4l2_subdev *
+vin_to_source(struct rvin_dev *vin)
+{
+	if (vin->info->use_mc) {
+		struct media_pad *pad;
+
+		pad = media_entity_remote_pad(&vin->pad);
+		if (!pad)
+			return NULL;
+
+		return media_entity_to_v4l2_subdev(pad->entity);
+	}
+
+	return vin->parallel->subdev;
+}
 
 /* Debug */
 #define vin_dbg(d, fmt, arg...)		dev_dbg(d->dev, fmt, ##arg)

Best regards,
Eugeniu.

  reply	other threads:[~2019-04-05 16:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 14:40 [PATCH v3 0/9] rcar-vin: Add support for parallel input on Gen3 Jacopo Mondi
2018-05-18 14:40 ` [PATCH v3 1/9] media: rcar-vin: Rename 'digital' to 'parallel' Jacopo Mondi
2018-05-23 22:42   ` Niklas Söderlund
2018-05-23 22:42     ` Niklas Söderlund
2018-05-24 20:19     ` jacopo mondi
2018-05-18 14:40 ` [PATCH v3 2/9] media: rcar-vin: Remove two empty lines Jacopo Mondi
2018-05-23 22:43   ` Niklas Söderlund
2018-05-23 22:43     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 3/9] media: rcar-vin: Create a group notifier Jacopo Mondi
2018-05-24 10:14   ` Niklas Söderlund
2018-05-24 10:14     ` Niklas Söderlund
2019-04-05 16:16     ` Eugeniu Rosca [this message]
2019-04-06  0:04       ` Steve Longerbeam
2019-04-08 11:12         ` Niklas Söderlund
2019-04-09  3:58           ` Steve Longerbeam
2019-04-09  9:10             ` Kieran Bingham
2019-04-09 13:25               ` Niklas Söderlund
2019-04-09 22:52                 ` Steve Longerbeam
2019-04-09 20:57             ` Laurent Pinchart
2019-04-09 22:22               ` Steve Longerbeam
2019-04-09 22:59                 ` Laurent Pinchart
2019-04-09 23:29                   ` Steve Longerbeam
2019-04-11 20:28                     ` Eugeniu Rosca
2019-04-11 20:42                       ` Niklas Söderlund
2019-04-12 14:12                         ` Eugeniu Rosca
2019-04-12 15:10                           ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 4/9] media: rcar-vin: Cache the mbus configuration flags Jacopo Mondi
2018-05-24 10:20   ` Niklas Söderlund
2018-05-24 10:20     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 5/9] media: rcar-vin: Parse parallel input on Gen3 Jacopo Mondi
2018-05-24 10:30   ` Niklas Söderlund
2018-05-24 10:30     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 6/9] media: rcar-vin: Link parallel input media entities Jacopo Mondi
2018-05-24 10:32   ` Niklas Söderlund
2018-05-24 10:32     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 7/9] media: rcar-vin: Handle parallel subdev in link_notify Jacopo Mondi
2018-05-24 10:37   ` Niklas Söderlund
2018-05-24 10:37     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 8/9] media: rcar-vin: Rename _rcar_info to rcar_info Jacopo Mondi
2018-05-19  9:33   ` Sergei Shtylyov
2018-05-24 10:38   ` Niklas Söderlund
2018-05-24 10:38     ` Niklas Söderlund
2018-05-18 14:40 ` [PATCH v3 9/9] media: rcar-vin: Add support for R-Car R8A77995 SoC 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=20190405161639.GA10433@vmlxhi-102.adit-jv.com \
    --to=erosca@de.adit-jv.com \
    --cc=efriedrich@de.adit-jv.com \
    --cc=george_davis@mentor.com \
    --cc=harsha.manjulamallikarjun@in.bosch.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jacopo+renesas@jmondi.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mrodin@de.adit-jv.com \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=roscaeugeniu@gmail.com \
    --cc=steve_longerbeam@mentor.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.