[PATCH] media: stm32: dcmi: Register V4L2 subdev nodes

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Jun 18 16:20:21 PDT 2022


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 at denx.de>
> Cc: Alain Volmat <alain.volmat at foss.st.com>
> Cc: Alexandre Torgue <alexandre.torgue at foss.st.com>
> Cc: Amelie DELAUNAY <amelie.delaunay at foss.st.com>
> Cc: Hugues FRUCHET <hugues.fruchet at foss.st.com>
> Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Cc: Philippe CORNU <philippe.cornu at foss.st.com>
> Cc: linux-stm32 at st-md-mailman.stormreply.com
> Cc: linux-arm-kernel at 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



More information about the linux-arm-kernel mailing list