linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jacopo Mondi <jacopo@jmondi.org>
Cc: "Jacopo Mondi" <jacopo+renesas@jmondi.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
	"Sakari Ailus" <sakari.ailus@iki.fi>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Thomas NIZAN" <tnizan@witekio.com>,
	linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [RFC 4/5] media: i2c: max9286: Fetch PIXEL_RATE in s_stream
Date: Mon, 23 Aug 2021 12:34:59 +0300	[thread overview]
Message-ID: <YSNrwxluB45Xmynz@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210823072008.p6qi5lg73jsfezwn@uno.localdomain>

Hi Jacopo,

On Mon, Aug 23, 2021 at 09:20:08AM +0200, Jacopo Mondi wrote:
> On Mon, Aug 23, 2021 at 05:17:05AM +0300, Laurent Pinchart wrote:
> > On Tue, Aug 17, 2021 at 09:27:02AM +0200, Jacopo Mondi wrote:
> > > The max9286 driver needs to fetch the remote serializer PIXEL_RATE
> > > control value in order to compute its own one, as the sum of the
> >
> > s/its own one/its own/ (or its own pixel rate)
> >
> > > values reported by the connected subdevices.
> > >
> > > Currently the control is verified to be present at notifier's bound
> > > time, which requires the serializer driver to register the control at
> > > probe time. As the serializer driver might need to register the control
> > > later, by adding the control handler of its connected sensor, post-pone
> > > the max9286 check for the control availability at start stream time.
> > >
> > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > > ---
> > >  drivers/media/i2c/max9286.c | 6 +++++-
> > >  1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
> > > index 1b92d18a1f94..98fc90339a9e 100644
> > > --- a/drivers/media/i2c/max9286.c
> > > +++ b/drivers/media/i2c/max9286.c
> > > @@ -595,7 +595,7 @@ static int max9286_notify_bound(struct v4l2_async_notifier *notifier,
> > >  	max9286_check_config_link(priv, priv->source_mask);
> > >  	max9286_configure_i2c(priv, false);
> > >
> > > -	return max9286_set_pixelrate(priv);
> > > +	return 0;
> > >  }
> > >
> > >  static void max9286_notify_unbind(struct v4l2_async_notifier *notifier,
> > > @@ -674,6 +674,10 @@ static int max9286_s_stream(struct v4l2_subdev *sd, int enable)
> > >  	int ret;
> > >
> > >  	if (enable) {
> > > +		ret = max9286_set_pixelrate(priv);
> > > +		if (ret)
> > > +			return ret;
> >
> > That's very likely not going to work. The CSI-2 receiver connected to
> > the max9286 will need to know the pixel rate as part of its
> > initialization sequence, before calling .s_stream(1) on the max9286.
> 
> How so ? The R-Car CSI-2 receiver feteches the pixel rate at s_stream
> time, I thought it was customary to do so. What is it needed for before
> streamon time ?

At stream on time is usually fine, but the CSI-2 receiver usually needs
to be configured before starting the source, not after.

> > > +
> > >  		/*
> > >  		 * The frame sync between cameras is transmitted across the
> > >  		 * reverse channel as GPIO. We must open all channels while

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2021-08-23  9:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17  7:26 [RFC 0/5] media: i2c: Add MAX9271 subdevice driver Jacopo Mondi
2021-08-17  7:26 ` [RFC 1/5] media: i2c: max9271: Rename max9271 library driver Jacopo Mondi
2021-08-18 12:48   ` Kieran Bingham
2021-08-23  2:09   ` Laurent Pinchart
2021-08-17  7:27 ` [RFC 2/5] media: i2c: Add MAX9271 I2C driver Jacopo Mondi
2021-08-17 15:49   ` Kieran Bingham
2021-08-18  8:27     ` Jacopo Mondi
2021-08-18 12:38       ` Kieran Bingham
2021-08-23  2:22       ` Laurent Pinchart
2021-08-23  7:21         ` Jacopo Mondi
2021-08-23 12:05       ` Geert Uytterhoeven
2021-08-17  7:27 ` [RFC 3/5] media: i2c: rdacm20: Adapt to work with MAX9271 Jacopo Mondi
2021-08-17  7:27 ` [RFC 4/5] media: i2c: max9286: Fetch PIXEL_RATE in s_stream Jacopo Mondi
2021-08-23  2:17   ` Laurent Pinchart
2021-08-23  7:20     ` Jacopo Mondi
2021-08-23  9:34       ` Laurent Pinchart [this message]
2021-08-17  7:27 ` [RFC 5/5] arm64: dts: GMSL: Adapt to the use max9271 driver Jacopo Mondi
2021-08-18 12:47 ` [RFC 0/5] media: i2c: Add MAX9271 subdevice driver Kieran Bingham
2021-08-23  2:12   ` Laurent Pinchart
2021-08-23  2:06 ` Laurent Pinchart
2021-09-13  7:59   ` 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=YSNrwxluB45Xmynz@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo+renesas@jmondi.org \
    --cc=jacopo@jmondi.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=sakari.ailus@iki.fi \
    --cc=tnizan@witekio.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 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).