* [PATCH] media: stm32: dcmi: Register V4L2 subdev nodes
@ 2022-06-18 22:23 Marek Vasut
2022-06-18 23:20 ` Laurent Pinchart
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2022-06-18 22:23 UTC (permalink / raw)
To: linux-media
Cc: Marek Vasut, Alain Volmat, Alexandre Torgue, Amelie DELAUNAY,
Hugues FRUCHET, Laurent Pinchart, Philippe CORNU, linux-stm32,
linux-arm-kernel
Unless the V4L2 device calls v4l2_device_register_subdev_nodes(),
the /dev/v4l-subdev* sub-device nodes are not registered and thus
not created. Add the missing call.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alain Volmat <alain.volmat@foss.st.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Amelie DELAUNAY <amelie.delaunay@foss.st.com>
Cc: Hugues FRUCHET <hugues.fruchet@foss.st.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Philippe CORNU <philippe.cornu@foss.st.com>
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
---
drivers/media/platform/st/stm32/stm32-dcmi.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
index 5f08ba47ea96b..56f4e04bc7c49 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
@@ -1805,6 +1805,12 @@ static int dcmi_graph_notify_complete(struct v4l2_async_notifier *notifier)
dcmi->vdev->ctrl_handler = dcmi->source->ctrl_handler;
+ ret = v4l2_device_register_subdev_nodes(&dcmi->v4l2_dev);
+ if (ret) {
+ dev_err(dcmi->dev, "Count not register subdev nodes\n");
+ return ret;
+ }
+
ret = dcmi_formats_init(dcmi);
if (ret) {
dev_err(dcmi->dev, "No supported mediabus format found\n");
--
2.35.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] media: stm32: dcmi: Register V4L2 subdev nodes
2022-06-18 22:23 [PATCH] media: stm32: dcmi: Register V4L2 subdev nodes Marek Vasut
@ 2022-06-18 23:20 ` Laurent Pinchart
2022-06-19 0:28 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Laurent Pinchart @ 2022-06-18 23:20 UTC (permalink / raw)
To: Marek Vasut
Cc: linux-media, Alain Volmat, Alexandre Torgue, Amelie DELAUNAY,
Hugues FRUCHET, Philippe CORNU, linux-stm32, linux-arm-kernel
Hi Marek,
Thank you for the patch.
On Sun, Jun 19, 2022 at 12:23:35AM +0200, Marek Vasut wrote:
> Unless the V4L2 device calls v4l2_device_register_subdev_nodes(),
> the /dev/v4l-subdev* sub-device nodes are not registered and thus
> not created. Add the missing call.
This driver configures the subdevs internally. Exposing the subdev nodes
to userspace would conflict with driver operation.
If you need the subdev nodes only to query subdev information, you can
use v4l2_device_register_ro_subdev_nodes(). Ideally I'd prefer this
driver to expose subdev nodes to userspace and stop propagating formats
internally, but that may break applications :-(
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Alain Volmat <alain.volmat@foss.st.com>
> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> Cc: Amelie DELAUNAY <amelie.delaunay@foss.st.com>
> Cc: Hugues FRUCHET <hugues.fruchet@foss.st.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Philippe CORNU <philippe.cornu@foss.st.com>
> Cc: linux-stm32@st-md-mailman.stormreply.com
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> drivers/media/platform/st/stm32/stm32-dcmi.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
> index 5f08ba47ea96b..56f4e04bc7c49 100644
> --- a/drivers/media/platform/st/stm32/stm32-dcmi.c
> +++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
> @@ -1805,6 +1805,12 @@ static int dcmi_graph_notify_complete(struct v4l2_async_notifier *notifier)
>
> dcmi->vdev->ctrl_handler = dcmi->source->ctrl_handler;
>
> + ret = v4l2_device_register_subdev_nodes(&dcmi->v4l2_dev);
> + if (ret) {
> + dev_err(dcmi->dev, "Count not register subdev nodes\n");
> + return ret;
> + }
> +
> ret = dcmi_formats_init(dcmi);
> if (ret) {
> dev_err(dcmi->dev, "No supported mediabus format found\n");
--
Regards,
Laurent Pinchart
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] media: stm32: dcmi: Register V4L2 subdev nodes
2022-06-18 23:20 ` Laurent Pinchart
@ 2022-06-19 0:28 ` Marek Vasut
2022-06-19 0:33 ` Laurent Pinchart
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2022-06-19 0:28 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-media, Alain Volmat, Alexandre Torgue, Amelie DELAUNAY,
Hugues FRUCHET, Philippe CORNU, linux-stm32, linux-arm-kernel
On 6/19/22 01:20, Laurent Pinchart wrote:
> Hi Marek,
>
> Thank you for the patch.
>
> On Sun, Jun 19, 2022 at 12:23:35AM +0200, Marek Vasut wrote:
>> Unless the V4L2 device calls v4l2_device_register_subdev_nodes(),
>> the /dev/v4l-subdev* sub-device nodes are not registered and thus
>> not created. Add the missing call.
>
> This driver configures the subdevs internally. Exposing the subdev nodes
> to userspace would conflict with driver operation.
>
> If you need the subdev nodes only to query subdev information, you can
> use v4l2_device_register_ro_subdev_nodes(). Ideally I'd prefer this
> driver to expose subdev nodes to userspace and stop propagating formats
> internally, but that may break applications :-(
I need those subdevs to configure e.g. test pattern on the sensor side.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] media: stm32: dcmi: Register V4L2 subdev nodes
2022-06-19 0:28 ` Marek Vasut
@ 2022-06-19 0:33 ` Laurent Pinchart
2022-06-19 0:43 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Laurent Pinchart @ 2022-06-19 0:33 UTC (permalink / raw)
To: Marek Vasut
Cc: linux-media, Alain Volmat, Alexandre Torgue, Amelie DELAUNAY,
Hugues FRUCHET, Philippe CORNU, linux-stm32, linux-arm-kernel
On Sun, Jun 19, 2022 at 02:28:55AM +0200, Marek Vasut wrote:
> On 6/19/22 01:20, Laurent Pinchart wrote:
> > Hi Marek,
> >
> > Thank you for the patch.
> >
> > On Sun, Jun 19, 2022 at 12:23:35AM +0200, Marek Vasut wrote:
> >> Unless the V4L2 device calls v4l2_device_register_subdev_nodes(),
> >> the /dev/v4l-subdev* sub-device nodes are not registered and thus
> >> not created. Add the missing call.
> >
> > This driver configures the subdevs internally. Exposing the subdev nodes
> > to userspace would conflict with driver operation.
> >
> > If you need the subdev nodes only to query subdev information, you can
> > use v4l2_device_register_ro_subdev_nodes(). Ideally I'd prefer this
> > driver to expose subdev nodes to userspace and stop propagating formats
> > internally, but that may break applications :-(
>
> I need those subdevs to configure e.g. test pattern on the sensor side.
Doesn't the dcmi driver expose the sensor controls on the video node ?
--
Regards,
Laurent Pinchart
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] media: stm32: dcmi: Register V4L2 subdev nodes
2022-06-19 0:33 ` Laurent Pinchart
@ 2022-06-19 0:43 ` Marek Vasut
2022-06-27 8:52 ` Hugues FRUCHET
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2022-06-19 0:43 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-media, Alain Volmat, Alexandre Torgue, Amelie DELAUNAY,
Hugues FRUCHET, Philippe CORNU, linux-stm32, linux-arm-kernel
On 6/19/22 02:33, Laurent Pinchart wrote:
> On Sun, Jun 19, 2022 at 02:28:55AM +0200, Marek Vasut wrote:
>> On 6/19/22 01:20, Laurent Pinchart wrote:
>>> Hi Marek,
>>>
>>> Thank you for the patch.
>>>
>>> On Sun, Jun 19, 2022 at 12:23:35AM +0200, Marek Vasut wrote:
>>>> Unless the V4L2 device calls v4l2_device_register_subdev_nodes(),
>>>> the /dev/v4l-subdev* sub-device nodes are not registered and thus
>>>> not created. Add the missing call.
>>>
>>> This driver configures the subdevs internally. Exposing the subdev nodes
>>> to userspace would conflict with driver operation.
>>>
>>> If you need the subdev nodes only to query subdev information, you can
>>> use v4l2_device_register_ro_subdev_nodes(). Ideally I'd prefer this
>>> driver to expose subdev nodes to userspace and stop propagating formats
>>> internally, but that may break applications :-(
>>
>> I need those subdevs to configure e.g. test pattern on the sensor side.
>
> Doesn't the dcmi driver expose the sensor controls on the video node ?
Apparently it does, so, discard this patch.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] media: stm32: dcmi: Register V4L2 subdev nodes
2022-06-19 0:43 ` Marek Vasut
@ 2022-06-27 8:52 ` Hugues FRUCHET
0 siblings, 0 replies; 6+ messages in thread
From: Hugues FRUCHET @ 2022-06-27 8:52 UTC (permalink / raw)
To: Marek Vasut, Laurent Pinchart
Cc: linux-media, Alain Volmat, Alexandre Torgue, Amelie DELAUNAY,
Philippe CORNU, linux-stm32, linux-arm-kernel
Hi Marek,
As said by Laurent -thanks for answer Laurent- driver configures the
subdevs internally and not expose subdev interface. This is done to keep
legacy applications based on V4L2 interface up & running.
As said also, all the sensor controls are exposed on dcmi video node so
you don't need subdev interface to get access on sensor controls.
Best regards,
Hugues.
On 6/19/22 02:43, Marek Vasut wrote:
> On 6/19/22 02:33, Laurent Pinchart wrote:
>> On Sun, Jun 19, 2022 at 02:28:55AM +0200, Marek Vasut wrote:
>>> On 6/19/22 01:20, Laurent Pinchart wrote:
>>>> Hi Marek,
>>>>
>>>> Thank you for the patch.
>>>>
>>>> On Sun, Jun 19, 2022 at 12:23:35AM +0200, Marek Vasut wrote:
>>>>> Unless the V4L2 device calls v4l2_device_register_subdev_nodes(),
>>>>> the /dev/v4l-subdev* sub-device nodes are not registered and thus
>>>>> not created. Add the missing call.
>>>>
>>>> This driver configures the subdevs internally. Exposing the subdev
>>>> nodes
>>>> to userspace would conflict with driver operation.
>>>>
>>>> If you need the subdev nodes only to query subdev information, you can
>>>> use v4l2_device_register_ro_subdev_nodes(). Ideally I'd prefer this
>>>> driver to expose subdev nodes to userspace and stop propagating formats
>>>> internally, but that may break applications :-(
>>>
>>> I need those subdevs to configure e.g. test pattern on the sensor side.
>>
>> Doesn't the dcmi driver expose the sensor controls on the video node ?
>
> Apparently it does, so, discard this patch.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-06-27 8:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-18 22:23 [PATCH] media: stm32: dcmi: Register V4L2 subdev nodes Marek Vasut
2022-06-18 23:20 ` Laurent Pinchart
2022-06-19 0:28 ` Marek Vasut
2022-06-19 0:33 ` Laurent Pinchart
2022-06-19 0:43 ` Marek Vasut
2022-06-27 8:52 ` Hugues FRUCHET
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox