linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	Michael Grzeschik <m.grzeschik@pengutronix.de>,
	enrico.scholz@sigma-chemnitz.de, akinobu.mita@gmail.com,
	robh+dt@kernel.org, sakari.ailus@linux.intel.com,
	mchehab@kernel.org, graphics@pengutronix.de,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v2 4/6] media: mt9m111: allow to setup pixclk polarity
Date: Mon, 26 Nov 2018 15:16:56 +0100	[thread overview]
Message-ID: <20181126141656.42fehzooxd6aruf7@pengutronix.de> (raw)
In-Reply-To: <20181116133235.kge7xept2sgfnnwo@valkosipuli.retiisi.org.uk>

Hi Sakari,

On 18-11-16 15:32, Sakari Ailus wrote:
> Hi Marco, Enrico,
> 
> On Mon, Oct 29, 2018 at 07:24:08PM +0100, Marco Felsch wrote:
> > From: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
> > 
> > The chip can be configured to output data transitions on the
> > rising or falling edge of PIXCLK (Datasheet R58:1[9]), default is on the
> > falling edge.
> > 
> > Parsing the fw-node is made in a subfunction to bundle all (future)
> > dt-parsing / fw-parsing stuff.
> > 
> > Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
> > (m.grzeschik@pengutronix.de: Fix inverting clock. INV_PIX_CLOCK bit is set
> > per default. Set bit to 0 (enable mask bit without value) to enable
> > falling edge sampling.)
> > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > (m.felsch@pengutronix.de: use fwnode helpers)
> > (m.felsch@pengutronix.de: mv fw parsing into own function)
> > (m.felsch@pengutronix.de: adapt commit msg)
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > 
> > ---
> > Changelog:
> > 
> > v2:
> > - make use of fwnode_*() to drop OF dependency and ifdef's
> > - mt9m111_g_mbus_config: fix pclk_sample logic which I made due the
> >   conversion from Enrico's patch.
> > 
> >  drivers/media/i2c/mt9m111.c | 46 ++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 45 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
> > index e9879e111f58..112eaa5ba917 100644
> > --- a/drivers/media/i2c/mt9m111.c
> > +++ b/drivers/media/i2c/mt9m111.c
> > @@ -15,12 +15,14 @@
> >  #include <linux/delay.h>
> >  #include <linux/v4l2-mediabus.h>
> >  #include <linux/module.h>
> > +#include <linux/property.h>
> >  
> >  #include <media/v4l2-async.h>
> >  #include <media/v4l2-clk.h>
> >  #include <media/v4l2-common.h>
> >  #include <media/v4l2-ctrls.h>
> >  #include <media/v4l2-device.h>
> > +#include <media/v4l2-fwnode.h>
> >  
> >  /*
> >   * MT9M111, MT9M112 and MT9M131:
> > @@ -239,6 +241,8 @@ struct mt9m111 {
> >  	const struct mt9m111_datafmt *fmt;
> >  	int lastpage;	/* PageMap cache value */
> >  	bool is_streaming;
> > +	/* user point of view - 0: falling 1: rising edge */
> > +	unsigned int pclk_sample:1;
> 
> You could use a bool. Up to you.

I find it more precise to use a unsigned int, because using a bool is
more like a statement e.g. invert_pclk.

[Snip]

> >  static int mt9m111_probe(struct i2c_client *client,
> >  			 const struct i2c_device_id *did)
> >  {
> > @@ -1147,6 +1187,10 @@ static int mt9m111_probe(struct i2c_client *client,
> >  	/* Default HIGHPOWER context */
> >  	mt9m111->ctx = &context_b;
> >  
> > +	ret = mt9m111_probe_fw(client, mt9m111);
> > +	if (ret)
> > +		return ret;
> 
> Can you do this before v4l2_clk_get()? That'll go anyway, but for now,
> you'd need extra error handling for it.

Sure, I will move it above v4l2_clk_get().

> > +
> >  	v4l2_i2c_subdev_init(&mt9m111->subdev, client, &mt9m111_subdev_ops);
> >  	mt9m111->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> >  
> 
> Please also put this patch after the DT binding changes.

Okay, I will reorder it.

Regards,
Marco

> -- 
> Kind regards,
> 
> Sakari Ailus
> e-mail: sakari.ailus@iki.fi

  reply	other threads:[~2018-11-27  1:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 18:24 [PATCH v2 0/6] media: mt9m111 features Marco Felsch
2018-10-29 18:24 ` [PATCH v2 1/6] media: mt9m111: add s_stream callback Marco Felsch
2018-10-29 18:24 ` [PATCH v2 2/6] media: mt9m111: add streaming check to set_fmt Marco Felsch
2018-10-29 18:24 ` [PATCH v2 3/6] media: mt9m111: add support to select formats and fps for {Q,SXGA} Marco Felsch
2018-11-16 13:26   ` Sakari Ailus
2018-11-16 13:31     ` Hans Verkuil
2018-11-16 13:33       ` Sakari Ailus
2018-11-26 16:01         ` Marco Felsch
2018-10-29 18:24 ` [PATCH v2 4/6] media: mt9m111: allow to setup pixclk polarity Marco Felsch
2018-11-16 13:32   ` Sakari Ailus
2018-11-26 14:16     ` Marco Felsch [this message]
2018-10-29 18:24 ` [PATCH v2 5/6] dt-bindings: media: mt9m111: adapt documentation to be more clear Marco Felsch
2018-10-30 22:30   ` Rob Herring
2018-10-29 18:24 ` [PATCH v2 6/6] dt-bindings: media: mt9m111: add pclk-sample property Marco Felsch
2018-10-30 22:31   ` Rob Herring

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=20181126141656.42fehzooxd6aruf7@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=akinobu.mita@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=enrico.scholz@sigma-chemnitz.de \
    --cc=graphics@pengutronix.de \
    --cc=linux-media@vger.kernel.org \
    --cc=m.grzeschik@pengutronix.de \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=sakari.ailus@linux.intel.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).