[RFC,2/3] media: uvcvideo: remove entity privacy control in the uvc video node

Message ID 20230111-uvc_privacy_subdev-v1-2-f859ac9a01e3@chromium.org
State New
Headers
Series meida: uvcvideo: reimplement privacy gpio as a separate subdevice |

Commit Message

Yunke Cao Jan. 11, 2023, 8:52 a.m. UTC
  For privacy_gpio, do not expose V4L2_CID_PRIVACY to userspace as a control
of the video node.

Signed-off-by: Yunke Cao <yunkec@chromium.org>
---
 drivers/media/usb/uvc/uvc_ctrl.c | 17 -----------------
 1 file changed, 17 deletions(-)
  

Comments

Andrzej Pietrasiewicz Jan. 11, 2023, 10:33 a.m. UTC | #1
Hello,

W dniu 11.01.2023 o 09:52, Yunke Cao pisze:
> For privacy_gpio, do not expose V4L2_CID_PRIVACY to userspace as a control
> of the video node.
> 

I know it is an RFC, so maybe you distribute the changes into 3 patches
on purpose. But, after applying this patch V4L2_CID_PRIVACY is lost
until it is re-implemented later, isn't it? Because of that It seems to me
patches 2/3 and 3/3 should be combined into one.

Regards,

Andrzej

> Signed-off-by: Yunke Cao <yunkec@chromium.org>
> ---
>   drivers/media/usb/uvc/uvc_ctrl.c | 17 -----------------
>   1 file changed, 17 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
> index c95a2229f4fa..77c5ff19add8 100644
> --- a/drivers/media/usb/uvc/uvc_ctrl.c
> +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> @@ -348,14 +348,6 @@ static const struct uvc_control_info uvc_ctrls[] = {
>   				| UVC_CTRL_FLAG_RESTORE
>   				| UVC_CTRL_FLAG_AUTO_UPDATE,
>   	},
> -	{
> -		.entity		= UVC_GUID_EXT_GPIO_CONTROLLER,
> -		.selector	= UVC_CT_PRIVACY_CONTROL,
> -		.index		= 0,
> -		.size		= 1,
> -		.flags		= UVC_CTRL_FLAG_GET_CUR
> -				| UVC_CTRL_FLAG_AUTO_UPDATE,
> -	},
>   };
>   
>   static const u32 uvc_control_classes[] = {
> @@ -710,15 +702,6 @@ static const struct uvc_control_mapping uvc_ctrl_mappings[] = {
>   		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
>   		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
>   	},
> -	{
> -		.id		= V4L2_CID_PRIVACY,
> -		.entity		= UVC_GUID_EXT_GPIO_CONTROLLER,
> -		.selector	= UVC_CT_PRIVACY_CONTROL,
> -		.size		= 1,
> -		.offset		= 0,
> -		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
> -		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
> -	},
>   };
>   
>   static const struct uvc_control_mapping uvc_ctrl_mappings_uvc11[] = {
>
  
Yunke Cao Jan. 12, 2023, 1:40 a.m. UTC | #2
Hi Andrej,

On Wed, Jan 11, 2023 at 7:33 PM Andrzej Pietrasiewicz
<andrzej.p@collabora.com> wrote:
>
> Hello,
>
> W dniu 11.01.2023 o 09:52, Yunke Cao pisze:
> > For privacy_gpio, do not expose V4L2_CID_PRIVACY to userspace as a control
> > of the video node.
> >
>
> I know it is an RFC, so maybe you distribute the changes into 3 patches
> on purpose. But, after applying this patch V4L2_CID_PRIVACY is lost
> until it is re-implemented later, isn't it? Because of that It seems to me
> patches 2/3 and 3/3 should be combined into one.
>

Yes, that's correct. Now that I look at it, it makes little sense to split them.

Thanks!
Yunke

> Regards,
>
> Andrzej
>
> > Signed-off-by: Yunke Cao <yunkec@chromium.org>
> > ---
> >   drivers/media/usb/uvc/uvc_ctrl.c | 17 -----------------
> >   1 file changed, 17 deletions(-)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
> > index c95a2229f4fa..77c5ff19add8 100644
> > --- a/drivers/media/usb/uvc/uvc_ctrl.c
> > +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> > @@ -348,14 +348,6 @@ static const struct uvc_control_info uvc_ctrls[] = {
> >                               | UVC_CTRL_FLAG_RESTORE
> >                               | UVC_CTRL_FLAG_AUTO_UPDATE,
> >       },
> > -     {
> > -             .entity         = UVC_GUID_EXT_GPIO_CONTROLLER,
> > -             .selector       = UVC_CT_PRIVACY_CONTROL,
> > -             .index          = 0,
> > -             .size           = 1,
> > -             .flags          = UVC_CTRL_FLAG_GET_CUR
> > -                             | UVC_CTRL_FLAG_AUTO_UPDATE,
> > -     },
> >   };
> >
> >   static const u32 uvc_control_classes[] = {
> > @@ -710,15 +702,6 @@ static const struct uvc_control_mapping uvc_ctrl_mappings[] = {
> >               .v4l2_type      = V4L2_CTRL_TYPE_BOOLEAN,
> >               .data_type      = UVC_CTRL_DATA_TYPE_BOOLEAN,
> >       },
> > -     {
> > -             .id             = V4L2_CID_PRIVACY,
> > -             .entity         = UVC_GUID_EXT_GPIO_CONTROLLER,
> > -             .selector       = UVC_CT_PRIVACY_CONTROL,
> > -             .size           = 1,
> > -             .offset         = 0,
> > -             .v4l2_type      = V4L2_CTRL_TYPE_BOOLEAN,
> > -             .data_type      = UVC_CTRL_DATA_TYPE_BOOLEAN,
> > -     },
> >   };
> >
> >   static const struct uvc_control_mapping uvc_ctrl_mappings_uvc11[] = {
> >
>
  

Patch

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index c95a2229f4fa..77c5ff19add8 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -348,14 +348,6 @@  static const struct uvc_control_info uvc_ctrls[] = {
 				| UVC_CTRL_FLAG_RESTORE
 				| UVC_CTRL_FLAG_AUTO_UPDATE,
 	},
-	{
-		.entity		= UVC_GUID_EXT_GPIO_CONTROLLER,
-		.selector	= UVC_CT_PRIVACY_CONTROL,
-		.index		= 0,
-		.size		= 1,
-		.flags		= UVC_CTRL_FLAG_GET_CUR
-				| UVC_CTRL_FLAG_AUTO_UPDATE,
-	},
 };
 
 static const u32 uvc_control_classes[] = {
@@ -710,15 +702,6 @@  static const struct uvc_control_mapping uvc_ctrl_mappings[] = {
 		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
 		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
 	},
-	{
-		.id		= V4L2_CID_PRIVACY,
-		.entity		= UVC_GUID_EXT_GPIO_CONTROLLER,
-		.selector	= UVC_CT_PRIVACY_CONTROL,
-		.size		= 1,
-		.offset		= 0,
-		.v4l2_type	= V4L2_CTRL_TYPE_BOOLEAN,
-		.data_type	= UVC_CTRL_DATA_TYPE_BOOLEAN,
-	},
 };
 
 static const struct uvc_control_mapping uvc_ctrl_mappings_uvc11[] = {