Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1705429

Re: [PATCH] media: i2c: OV5647: gate clock lane before stream on

From Philipp Zabel <p.zabel@pengutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] media: i2c: OV5647: gate clock lane before stream on
Date 2017-08-07 14:30 +0200
Message-ID <ubPkt-87B-1@gated-at.bofh.it> (permalink)
References <u6XVn-5q6-7@gated-at.bofh.it> <ubKuu-59V-21@gated-at.bofh.it> <ubLqx-5J4-1@gated-at.bofh.it> <ubO54-7rt-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Jacob,

On Mon, 2017-08-07 at 19:06 +0800, Jacob Chen wrote:
[...]
> >> > --- 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;
> >> > +

So this clears BIT(1) (force clock lane to low power mode) and BIT(5)
(gate clock lane while idle) that were set by ov5647_stream_off() during
__sensor_init() due to the change below.

Is there a reason, btw, that this driver is full of magic register
addresses and values? A few #defines would make this a lot more
readable.

> >> >         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);

I see now that BIT(2) (keep bus in LP-11 while idle) is and was always
set. So the change is that initially, additionally to LP-11 mode, the
clock lane is gated and forced into low power mode, as well?

> >> >  }
> >> >
> >> >  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.
> >
> 
> Yeah, but i double that clock lane is not in LP11 when continue clock
> mode is enabled.

If indeed LP-11 state is not achieved while the sensor is idle, as long
as BIT(5) is cleared, I think this patch is correct.

regards
Philipp

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] media: i2c: OV5647: gate clock lane before stream on Jacob Chen <jacobchen110@gmail.com> - 2017-08-07 09:20 +0200
  Re: [PATCH] media: i2c: OV5647: gate clock lane before stream on Philipp Zabel <p.zabel@pengutronix.de> - 2017-08-07 10:20 +0200
    Re: [PATCH] media: i2c: OV5647: gate clock lane before stream on Jacob Chen <jacobchen110@gmail.com> - 2017-08-07 13:10 +0200
      Re: [PATCH] media: i2c: OV5647: gate clock lane before stream on Philipp Zabel <p.zabel@pengutronix.de> - 2017-08-07 14:30 +0200
        Re: [PATCH] media: i2c: OV5647: gate clock lane before stream on Luis Oliveira <Luis.Oliveira@synopsys.com> - 2017-08-07 16:50 +0200
          Re: [PATCH] media: i2c: OV5647: gate clock lane before stream on Jacob Chen <jacobchen110@gmail.com> - 2017-08-08 04:10 +0200

csiph-web