linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	Jacopo Mondi <jacopo@jmondi.org>,
	linux-media <linux-media@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 7/7] media: imx214: Add new control with V4L2_CID_UNIT_CELL_SIZE
Date: Fri, 27 Sep 2019 09:33:53 +0200	[thread overview]
Message-ID: <CAPybu_3ga6rJ8pzw3wAP=nMOHDqeQEWWa-reto7Xk_FzRFVLyw@mail.gmail.com> (raw)
In-Reply-To: <6e4c1969-a80d-4747-7a44-b7a46804fe12@xs4all.nl>

Hi Hans

On Fri, 27 Sep 2019, 09:14 Hans Verkuil, <hverkuil-cisco@xs4all.nl> wrote:
>
> On 9/20/19 3:51 PM, Ricardo Ribalda Delgado wrote:
> > From: Ricardo Ribalda Delgado <ribalda@kernel.org>
> >
> > According to the product brief, the unit cell size is 1120 nanometers^2.
> >
> > https://www.sony-semicon.co.jp/products_en/IS/sensor1/img/products/ProductBrief_IMX214_20150428.pdf
> >
> > Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
> > ---
> >  drivers/media/i2c/imx214.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> >
> > diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c
> > index 159a3a604f0e..57562e20c4ca 100644
> > --- a/drivers/media/i2c/imx214.c
> > +++ b/drivers/media/i2c/imx214.c
> > @@ -47,6 +47,7 @@ struct imx214 {
> >       struct v4l2_ctrl *pixel_rate;
> >       struct v4l2_ctrl *link_freq;
> >       struct v4l2_ctrl *exposure;
> > +     struct v4l2_ctrl *unit_size;
> >
> >       struct regulator_bulk_data      supplies[IMX214_NUM_SUPPLIES];
> >
> > @@ -948,6 +949,13 @@ static int imx214_probe(struct i2c_client *client)
> >       static const s64 link_freq[] = {
> >               IMX214_DEFAULT_LINK_FREQ,
> >       };
> > +     struct v4l2_area unit_size = {
> > +             .width = 1120,
> > +             .height = 1120,
> > +     };
> > +     union v4l2_ctrl_ptr p_def = {
> > +             .p_area = &unit_size,
> > +     };
>
> Use static const for both.
>
> I think you should add a small static inline helper function to v4l2-ctrls.h that
> takes a void pointer and returns a union v4l2_ctrl_ptr.
>
> Then you don't need to make a union v4l2_ctrl_ptr just to pass the unit_size pointer.
>

That sounds useful, but can we warantee for all the arches that
sizeof(v4l2_ctrl_ptr) <= sizeof (void *)

Of course, it sounds logic, that a union of pointers is the same size
than a pointer... but you never know.

No matter what I will make the helper and resend. with all the changes
from Jacopo

Thanks!

> Regards,



>
>         Hans
>
> >       int ret;
> >
> >       ret = imx214_parse_fwnode(dev);
> > @@ -1029,6 +1037,10 @@ static int imx214_probe(struct i2c_client *client)
> >                                            V4L2_CID_EXPOSURE,
> >                                            0, 3184, 1, 0x0c70);
> >
> > +     imx214->unit_size = v4l2_ctrl_new_std_compound(&imx214->ctrls,
> > +                                                    NULL,
> > +                                                    V4L2_CID_UNIT_CELL_SIZE,
> > +                                                    p_def);
> >       ret = imx214->ctrls.error;
> >       if (ret) {
> >               dev_err(&client->dev, "%s control init failed (%d)\n",
> >
>

  reply	other threads:[~2019-09-27  7:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 13:51 [PATCH v6 0/7] Implement UNIT_CELL_SIZE control Ricardo Ribalda Delgado
2019-09-20 13:51 ` [PATCH v6 1/7] media: v4l2-core: Implement v4l2_ctrl_new_std_compound Ricardo Ribalda Delgado
2019-09-25  8:19   ` Jacopo Mondi
2019-09-25 20:55     ` Ricardo Ribalda Delgado
2019-09-20 13:51 ` [PATCH v6 2/7] Documentation: v4l2_ctrl_new_std_compound Ricardo Ribalda Delgado
2019-09-25  8:22   ` Jacopo Mondi
2019-09-25 21:00     ` Ricardo Ribalda Delgado
2019-09-20 13:51 ` [PATCH v6 3/7] media: add V4L2_CTRL_TYPE_AREA control type Ricardo Ribalda Delgado
2019-09-25  8:30   ` Jacopo Mondi
2019-09-20 13:51 ` [PATCH v6 4/7] Documentation: media: Document V4L2_CTRL_TYPE_AREA Ricardo Ribalda Delgado
2019-09-25  8:34   ` Jacopo Mondi
2019-09-25 21:08     ` Ricardo Ribalda Delgado
2019-09-20 13:51 ` [PATCH v6 5/7] media: add V4L2_CID_UNIT_CELL_SIZE control Ricardo Ribalda Delgado
2019-09-20 13:51 ` [PATCH v6 6/7] Documentation: media: Describe V4L2_CID_UNIT_CELL_SIZE Ricardo Ribalda Delgado
2019-09-20 13:51 ` [PATCH v6 7/7] media: imx214: Add new control with V4L2_CID_UNIT_CELL_SIZE Ricardo Ribalda Delgado
2019-09-25  9:25   ` Jacopo Mondi
2019-09-25 21:15     ` Ricardo Ribalda Delgado
2019-09-27  7:14   ` Hans Verkuil
2019-09-27  7:33     ` Ricardo Ribalda Delgado [this message]
2019-09-27  7:52       ` Hans Verkuil

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='CAPybu_3ga6rJ8pzw3wAP=nMOHDqeQEWWa-reto7Xk_FzRFVLyw@mail.gmail.com' \
    --to=ricardo.ribalda@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo@jmondi.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    /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).