Re: [PATCH 1/3] uvcvideo: initialise the entity function field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Guennadi,

Thank you for the patch.

On Friday 24 Jun 2016 13:28:55 Guennadi Liakhovetski wrote:
> Since a recent commit:
> 
> [media] media-device: move media entity register/unregister functions
> 
> drivers have to set entity function before registering an entity. Fix
> the uvcvideo driver to comply with this.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
> ---
>  drivers/media/usb/uvc/uvc_entity.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/media/usb/uvc/uvc_entity.c
> b/drivers/media/usb/uvc/uvc_entity.c index ac386bb..d93f413 100644
> --- a/drivers/media/usb/uvc/uvc_entity.c
> +++ b/drivers/media/usb/uvc/uvc_entity.c
> @@ -88,6 +88,11 @@ static int uvc_mc_init_entity(struct uvc_video_chain
> *chain, if (ret < 0)
>  			return ret;
> 
> +		if (UVC_ENTITY_TYPE(entity) == UVC_ITT_CAMERA)
> +			entity->subdev.entity.function = 
MEDIA_ENT_F_CAM_SENSOR;
> +		else
> +			entity->subdev.entity.function = MEDIA_ENT_F_IO_V4L;
> +

I've discussed this some time ago with Hans (over IRC if I recall correctly). 
We need to define new functions, as not all UVC entities map to the existing 
ones. MEDIA_ENT_F_CAM_SENSOR should be fine for UVC_ITT_CAMERA, but 
MEDIA_ENT_F_IO_V4L isn't right as a default.

>  		ret = v4l2_device_register_subdev(&chain->dev->vdev,
>  						  &entity->subdev);
>  	} else if (entity->vdev != NULL) {

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux