From: "Lucas Magalhães" <lucmaga@gmail.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Helen Koike <helen.koike@collabora.com>,
edusbarretto@gmail.com
Subject: Re: [PATCH] media: vimc: fla: Add virtual flash subdevice
Date: Mon, 9 Sep 2019 20:00:26 -0300 [thread overview]
Message-ID: <CAK0xOaGZx5dyDMAFp+JxnrfOYH3yYdvtcJzWdAmHyeRwUe38Lg@mail.gmail.com> (raw)
In-Reply-To: <1fea2f25-98d1-f9f6-a483-17c74f89452e@xs4all.nl>
Hi Hans,
Thanks for the review. I fixed most of the issues you found. Just have
the question below.
On Mon, Sep 2, 2019 at 9:04 AM Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> > +
> > +int vimc_fla_add(struct vimc_device *vimc, struct vimc_ent_config *vcfg)
> > +{
> > + struct v4l2_device *v4l2_dev = &vimc->v4l2_dev;
> > + struct vimc_fla_device *vfla;
> > + int ret;
> > +
> > + /* Allocate the vfla struct */
> > + vfla = kzalloc(sizeof(*vfla), GFP_KERNEL);
> > + if (!vfla)
> > + return -ENOMEM;
> > +
> > + v4l2_ctrl_handler_init(&vfla->hdl, 4);
> > +
> > + v4l2_ctrl_new_std_menu(&vfla->hdl, &vimc_fla_ctrl_ops,
> > + V4L2_CID_FLASH_LED_MODE,
> > + V4L2_FLASH_LED_MODE_TORCH, ~0x7,
> > + V4L2_FLASH_LED_MODE_NONE);
> > + v4l2_ctrl_new_std_menu(&vfla->hdl, &vimc_fla_ctrl_ops,
> > + V4L2_CID_FLASH_STROBE_SOURCE, 0x1, ~0x3,
> > + V4L2_FLASH_STROBE_SOURCE_SOFTWARE);
> > + v4l2_ctrl_new_std(&vfla->hdl, &vimc_fla_ctrl_ops,
> > + V4L2_CID_FLASH_STROBE, 0, 0, 0, 0);
> > + v4l2_ctrl_new_std(&vfla->hdl, &vimc_fla_ctrl_ops,
> > + V4L2_CID_FLASH_STROBE_STOP, 0, 0, 0, 0);
> > + v4l2_ctrl_new_std(&vfla->hdl, &vimc_fla_ctrl_ops,
> > + V4L2_CID_FLASH_TIMEOUT, 1, 10, 1, 10);
> > + v4l2_ctrl_new_std(&vfla->hdl, &vimc_fla_ctrl_ops,
> > + V4L2_CID_FLASH_TORCH_INTENSITY, 0, 255, 1, 255);
> > + v4l2_ctrl_new_std(&vfla->hdl, &vimc_fla_ctrl_ops,
> > + V4L2_CID_FLASH_INTENSITY, 0, 255, 1, 255);
> > + v4l2_ctrl_new_std(&vfla->hdl, &vimc_fla_ctrl_ops,
> > + V4L2_CID_FLASH_INDICATOR_INTENSITY, 0, 255, 1, 255);
> > + v4l2_ctrl_new_std(&vfla->hdl, &vimc_fla_ctrl_ops,
> > + V4L2_CID_FLASH_STROBE_STATUS, 0, 0, 0, 0);
>
> It would be nice if this would actually reflect the actual strobe status.
>
Regarding the strobe status I was reading the code and find out that
V4L2_CID_FLASH_STROBE_STATUS is a V4L2_CTRL_FLAG_READ_ONLY
but it's not a V4L2_CTRL_FLAG_VOLATILE. I found this intriguing. How an
I suppose to get it if its not volatile? As I understood it changes over time
if the strobe starts and the timeout expire, isn't it? Shouldn't it be volatile
if so?
I've already made a simple implementation were V4L2_CID_FLASH_STROBE_STATUS
returns after calling V4L2_CID_FLASH_STROBE and becomes false after the timeout
time passes.
Thanks!
next prev parent reply other threads:[~2019-09-09 23:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-01 21:11 [PATCH] media: vimc: fla: Add virtual flash subdevice Lucas A. M. Magalhães
2019-09-02 12:04 ` Hans Verkuil
2019-09-09 23:00 ` Lucas Magalhães [this message]
2019-09-10 6:57 ` 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=CAK0xOaGZx5dyDMAFp+JxnrfOYH3yYdvtcJzWdAmHyeRwUe38Lg@mail.gmail.com \
--to=lucmaga@gmail.com \
--cc=edusbarretto@gmail.com \
--cc=helen.koike@collabora.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/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).