From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Benjamin Mugnier <benjamin.mugnier@foss.st.com>,
Nicolas Dufresne <nicolas@ndufresne.ca>,
linux-media@vger.kernel.org, alain.volmat@foss.st.com,
hugues.fruchet@foss.st.com, sylvain.petinot@foss.st.com,
dave.stevenson@raspberrypi.com, sakari.ailus@linux.intel.com,
kieran.bingham@ideasonboard.com, linux-hwmon@vger.kernel.org,
Ricardo Ribalda <ribalda@chromium.org>
Subject: Re: [PATCH v2 2/5] media: v4l: ctrls: Add a control for temperature
Date: Wed, 20 Apr 2022 17:23:51 +0300 [thread overview]
Message-ID: <YmAXd5F2Rm/VDIb5@pendragon.ideasonboard.com> (raw)
In-Reply-To: <76789333-bb0b-fcc2-6ba9-ab01c9aab62a@roeck-us.net>
On Wed, Apr 20, 2022 at 06:58:32AM -0700, Guenter Roeck wrote:
> On 4/20/22 06:21, Laurent Pinchart wrote:
> > On Wed, Apr 20, 2022 at 03:01:18PM +0200, Benjamin Mugnier wrote:
> >> On 20/04/2022 00:04, Guenter Roeck wrote:
> >>> On 4/19/22 14:01, Laurent Pinchart wrote:
> >>>> On Tue, Apr 19, 2022 at 12:28:06PM -0700, Guenter Roeck wrote:
> >>>>> On 4/19/22 11:24, Nicolas Dufresne wrote:
> >>>>>> Hi,
> >>>>>>
> >>>>>> adding linux-hwmon in CC for a wider feedback.
> >>>>>>
> >>>>>> Le vendredi 15 avril 2022 à 13:18 +0200, Benjamin Mugnier a écrit :
> >>>>>>> Add V4L2_CID_TEMPERATURE control to get temperature from sensor in
> >>>>>>> celsius as a volatile and read-only control, and its documentation.
> >>>>>>> Useful to monitor thermals from v4l controls for sensors that support
> >>>>>>> this.
> >>>>>>
> >>>>>> Any justification to expose a temperature sensor outside of the dedicated kernel
> >>>>>> API hwmon ? I know if may makes it harder to use, as the sensor isn't bound to
> >>>>>> the camera driver, and also the sensor may not work if the camera is not
> >>>>>> streaming. But in the end, the API in hwmon does not look that complex, and is
> >>>>>> perhaps more precise ?
> >>
> >> This sensor is able to read the temperature even if not streaming.
> >>
> >>>>>>
> >>>>>> All in all, I think we need a strong justification to implement a custom
> >>>>>> thermometer interface, something described here and documented with care to
> >>>>>> prevent abuse. I would also see opinion from folks outside of the linux-media,
> >>>>>> hence why I have CCed hwmon mailing list.
> >>>>>
> >>>>> All I can say is that this seems to be odd and a bit outside the scope of
> >>>>> v4l2. I would have expected the vgxy61 driver to register a hwmon device
> >>>>> instead.
> >>>>
> >>>> I don't have a definitive opinion yet, but as Nicolas raised the issue
> >>>> by pushing towards hwmon, I'll offer counter-arguments for the sake of
> >>>> it :-)
> >>>>
> >>>> The temperature sensor in the imaging sensor is used to measure the die
> >>>> temperature, in order to tune the noise and spectral response model of
> >>>> the imaging sensor. It's thus not a generic-purpose temperature sensor.
> >>>> If the feature were to be exposed through hwmon, userspace would need to
> >>>> associate an hwmon device to the imaging sensor V4L2 subdev (we have a
> >>>> way to do so through the MC API, it doesn't support hwmon at this point,
> >>>> but I suppose it could be added). There are also various constraints
> >>>> that tie the temperature reading to the imaging side, it could be that
> >>>> the temperature would only be readable while capturing frames. That's
> >>>> probably possible to handle too but returning an error from the
> >>>> temperature read.
> >>>>
> >>>> Code-wise, both the driver and userspace would be more complex, for very
> >>>> little practical gain (I don't dispute a theorical gain).
> >>>>
> >>>
> >>> All I can say is - not my subsystem, not my call to make. If you say this
> >>> is special and is better handled in V4L2, I'll take you by your word.
> >>>
> >>> Guenter
> >>>
> >>
> >> I'll happily implement whatever conclusion we make here.
> >>
> >> I could also drop this control for the first iteration of the driver,
> >> and come back later once a consensus is reached.
> >
> > That would work too. By the way, what are your use cases for the
> > temperature sensor ? Have you added the control for the sake of
> > completeness, or do you have use cases ?
>
> You provided a use case above. Are you saying you made it up ?
> Still fine with me, your call, just wondering.
It's the two most common use cases for imaging sensor temperature
measurements that I know of. My question to Benjamin is if he has the
same and/or other use cases.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2022-04-20 14:23 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-15 11:18 [PATCH v2 0/5] media: Add ST VGXY61 camera sensor driver Benjamin Mugnier
2022-04-15 11:18 ` [PATCH v2 1/5] media: v4l: Add 1X16 16-bit greyscale media bus code definition Benjamin Mugnier
2022-04-15 14:47 ` Laurent Pinchart
2022-04-15 11:18 ` [PATCH v2 2/5] media: v4l: ctrls: Add a control for temperature Benjamin Mugnier
2022-04-15 14:37 ` Laurent Pinchart
2022-04-20 13:01 ` Benjamin Mugnier
2022-04-19 7:03 ` Hans Verkuil
2022-04-20 13:01 ` Benjamin Mugnier
2022-04-19 18:24 ` Nicolas Dufresne
2022-04-19 19:28 ` Guenter Roeck
2022-04-19 21:01 ` Laurent Pinchart
2022-04-19 22:04 ` Guenter Roeck
2022-04-20 13:01 ` Benjamin Mugnier
2022-04-20 13:21 ` Laurent Pinchart
2022-04-20 13:58 ` Guenter Roeck
2022-04-20 14:23 ` Laurent Pinchart [this message]
2022-04-20 15:19 ` Benjamin Mugnier
2022-04-20 16:19 ` Guenter Roeck
2022-04-20 16:51 ` Laurent Pinchart
2022-04-15 11:18 ` [PATCH v2 3/5] media: v4l: ctrls: Add user control base for st-vgxy61 controls Benjamin Mugnier
2022-04-15 14:51 ` Laurent Pinchart
2022-04-15 11:18 ` [PATCH v2 4/5] media: dt-bindings: media: i2c: Add ST VGXY61 camera sensor binding Benjamin Mugnier
2022-04-15 14:59 ` Laurent Pinchart
2022-04-20 13:01 ` Benjamin Mugnier
2022-04-15 11:18 ` [PATCH v2 5/5] media: i2c: Add driver for ST VGXY61 camera sensor Benjamin Mugnier
2022-04-15 15:39 ` Laurent Pinchart
2022-04-20 13:01 ` Benjamin Mugnier
2022-04-20 16:48 ` Laurent Pinchart
2022-04-22 8:44 ` Benjamin Mugnier
2022-04-22 13:29 ` Laurent Pinchart
2022-04-22 14:40 ` Benjamin Mugnier
2022-04-24 16:34 ` Laurent Pinchart
2022-04-27 14:27 ` Benjamin Mugnier
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=YmAXd5F2Rm/VDIb5@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=alain.volmat@foss.st.com \
--cc=benjamin.mugnier@foss.st.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=hugues.fruchet@foss.st.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=nicolas@ndufresne.ca \
--cc=ribalda@chromium.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sylvain.petinot@foss.st.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