From: Philipp Zabel <p.zabel@pengutronix.de>
To: Jacob Chen <jacobchen110@gmail.com>
Cc: "open list:ARM/Rockchip SoC..."
<linux-rockchip@lists.infradead.org>,
linux-kernel@vger.kernel.org, roliveir@synopsys.com,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
vladimir_zapolskiy@mentor.com,
Hans Verkuil <hans.verkuil@cisco.com>,
sakari.ailus@linux.intel.com, Jacob Chen <jacob-chen@iotwrt.com>,
slongerbeam@gmail.com, robh+dt@kernel.org, lolivei@synopsys.com
Subject: Re: [PATCH] media: i2c: OV5647: gate clock lane before stream on
Date: Mon, 07 Aug 2017 10:17:31 +0200 [thread overview]
Message-ID: <1502093851.2490.4.camel@pengutronix.de> (raw)
In-Reply-To: <CAFLEztQHYWAk39+gQCD0XkKPVqmUY5kPZydWgw8+zu53+D2_pA@mail.gmail.com>
Hi Jacob,
On Mon, 2017-08-07 at 15:11 +0800, Jacob Chen wrote:
> Hi all,
>
> 2017-07-25 10:34 GMT+08:00 Jacob Chen <jacob-chen@iotwrt.com>:
> > According to datasheet, BIT5 in reg-0x4800 are used to
> > enable/disable clock lane gate.
> >
> > It's wrong to make clock lane free running before
> > sensor stream on was called, while the mipi phy
> > are not initialized.
> >
> > Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
>>
> > ---
> > drivers/media/i2c/ov5647.c | 10 +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
> > index 95ce90f..d3e6fd0 100644
> > --- a/drivers/media/i2c/ov5647.c
> > +++ b/drivers/media/i2c/ov5647.c
> > @@ -253,6 +253,10 @@ static int ov5647_stream_on(struct v4l2_subdev *sd)
> > {
> > int ret;
> >
> > + ret = ov5647_write(sd, 0x4800, 0x04);
> > + if (ret < 0)
> > + return ret;
> > +
> > ret = ov5647_write(sd, 0x4202, 0x00);
> > if (ret < 0)
> > return ret;
> > @@ -264,6 +268,10 @@ static int ov5647_stream_off(struct v4l2_subdev *sd)
> > {
> > int ret;
> >
> > + ret = ov5647_write(sd, 0x4800, 0x25);
> > + if (ret < 0)
> > + return ret;
> > +
> > ret = ov5647_write(sd, 0x4202, 0x0f);
> > if (ret < 0)
> > return ret;
> > @@ -320,7 +328,7 @@ static int __sensor_init(struct v4l2_subdev *sd)
> > return ret;
> > }
> >
> > - return ov5647_write(sd, 0x4800, 0x04);
> > + return ov5647_stream_off(sd);
> > }
> >
> > static int ov5647_sensor_power(struct v4l2_subdev *sd, int on)
> > --
> > 2.7.4
> >
>
> Can anyone comment on it?
>
> I saw there is a same discussion in https://patchwork.kernel.org/patch/9569031/
> There is a comment in i.MX CSI2 driver.
> "
> Configure MIPI Camera Sensor to put all Tx lanes in LP-11 state.
> This must be carried out by the MIPI sensor's s_power(ON) subdev
> op.
> "
> That's what this patch do, sensor driver should make sure that clock
> lanes are in stop state while not streaming.
This is not the same, as far as I can tell. BIT(5) is just clock lane
gating, as you describe above. To put the bus into LP-11 state, BIT(2)
needs to be set.
regards
Philipp
next prev parent reply other threads:[~2017-08-07 8:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 2:34 [PATCH] media: i2c: OV5647: gate clock lane before stream on Jacob Chen
2017-08-07 7:11 ` Jacob Chen
2017-08-07 8:17 ` Philipp Zabel [this message]
2017-08-07 11:06 ` Jacob Chen
2017-08-07 12:26 ` Philipp Zabel
2017-08-07 14:48 ` Luis Oliveira
2017-08-08 2:01 ` Jacob Chen
2017-09-11 1:59 ` Jacob Chen
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=1502093851.2490.4.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=hans.verkuil@cisco.com \
--cc=jacob-chen@iotwrt.com \
--cc=jacobchen110@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=lolivei@synopsys.com \
--cc=mchehab@kernel.org \
--cc=robh+dt@kernel.org \
--cc=roliveir@synopsys.com \
--cc=sakari.ailus@linux.intel.com \
--cc=slongerbeam@gmail.com \
--cc=vladimir_zapolskiy@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 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).