From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 1/1] mt9v032: Provide pixel rate control
Date: Fri, 16 Mar 2012 13:55:13 +0100 [thread overview]
Message-ID: <1762135.yeoBRAyros@avalon> (raw)
In-Reply-To: <20120316123653.GC5412@valkosipuli.localdomain>
Hi Sakari,
On Friday 16 March 2012 14:36:53 Sakari Ailus wrote:
> On Fri, Mar 16, 2012 at 01:31:39PM +0100, Laurent Pinchart wrote:
> > On Friday 16 March 2012 14:12:11 Sakari Ailus wrote:
> > > On Fri, Mar 16, 2012 at 12:58:30PM +0100, Laurent Pinchart wrote:
> > > > On Thursday 15 March 2012 23:01:39 Sakari Ailus wrote:
> > > > > Provide pixel rate control calculated from external clock and
> > > > > horizontal
> > > > > binning factor.
> > > > >
> > > > > Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
> > > > > ---
> > > > >
> > > > > drivers/media/video/mt9v032.c | 35
> > > > > ++++++++++++++++++++++++++++++++-
> > > > > 1 files changed, 34 insertions(+), 1 deletions(-)
> > > > >
> > > > > diff --git a/drivers/media/video/mt9v032.c
> > > > > b/drivers/media/video/mt9v032.c
> > > > > index 75e253a..e530e8d 100644
> > > > > --- a/drivers/media/video/mt9v032.c
> > > > > +++ b/drivers/media/video/mt9v032.c
> >
> > [snip]
> >
> > > > > +static void mt9v032_configure_pixel_rate(struct v4l2_subdev
> > > > > *subdev,
> > > > > + unsigned int hratio)
> > > > > +{
> > > > > + struct i2c_client *client = v4l2_get_subdevdata(subdev);
> > > > > + struct mt9v032 *mt9v032 = to_mt9v032(subdev);
> > > > > + struct v4l2_ext_controls ctrls;
> > > > > + struct v4l2_ext_control ctrl;
> > > > > +
> > > > > + memset(&ctrls, 0, sizeof(ctrls));
> > > > > + memset(&ctrl, 0, sizeof(ctrl));
> > > > > +
> > > > > + ctrls.count = 1;
> > > > > + ctrls.controls = &ctrl;
> > > > > +
> > > > > + ctrl.id = V4L2_CID_PIXEL_RATE;
> > > > > + ctrl.value64 = EXT_CLK / hratio;
> > > > > +
> > > > > + if (v4l2_s_ext_ctrls(mt9v032->pixel_rate->ctrl_handler, &ctrls)
<
> > > > > 0)
> > > > > + dev_warn(&client->dev, "bug: failed to set pixel rate\n");
> > > >
> > > > What about just calling v4l2_ctrl_s_ctrl() ?
> > >
> > > It's a 64-bit integer control, so it has to be set using
> > > v4l2_s_ext_ctrls().>
> > What about extending v4l2_ctrl_s_ctrl() to support 64-bit integer controls
> > then ?
>
> The second argument to that function is struct v4l2_control:
>
> struct v4l2_control {
> __u32 id;
> __s32 value;
> };
>
> So there's no chance to extend it. This must also be the reason why 64-bit
> controls require using extended controls.
>
> What we could do is to introduce v4l2_s_ext_ctrl without the "s" in the end
> to just set one extended control. I think that would be a reasonable
> approach, as it seems we need the functionality in multiple places.
We're talking about different functions.
int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
Extending that one wouldn't break the userspace API. We could use s64 instead
of s32, or add a new function such as v4l2_ctrl_s_ctrl64().
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2012-03-16 12:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-15 21:01 [PATCH 1/1] mt9v032: Provide pixel rate control Sakari Ailus
2012-03-16 11:58 ` Laurent Pinchart
2012-03-16 12:12 ` Sakari Ailus
2012-03-16 12:31 ` Laurent Pinchart
2012-03-16 12:36 ` Sakari Ailus
2012-03-16 12:55 ` Laurent Pinchart [this message]
2012-03-16 13:07 ` Sakari Ailus
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=1762135.yeoBRAyros@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
/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