diff mbox series

[5/7,RESEND] touchscreen/sur40: set device_caps in struct video_device

Message ID 1e12bc3d-3cb3-1f3d-b3bc-b25e3bf95523@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Hans Verkuil June 4, 2019, 12:36 p.m. UTC
Instead of filling in the struct v4l2_capability device_caps
field, fill in the struct video_device device_caps field.

That way the V4L2 core knows what the capabilities of the
video device are.

But this only really works if all drivers use this, so convert
this touchscreen driver accordingly.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Florian Echtler <floe@butterbrot.org>
---
Resend, adding Dmitry and linux-input to the CC list.

Dmitry, if you want to take this through your tree, then that's OK by me.

Alternatively, it can go through the media tree, but then I need your Ack.

Regards,

	Hans
---
 drivers/input/touchscreen/sur40.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

 	.fops = &sur40_video_fops,
 	.ioctl_ops = &sur40_video_ioctl_ops,
 	.release = video_device_release_empty,
+	.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TOUCH |
+		       V4L2_CAP_READWRITE | V4L2_CAP_STREAMING,
 };
  /* USB-specific object needed to register this driver with the USB subsystem. */

Comments

Dmitry Torokhov June 4, 2019, 4:06 p.m. UTC | #1
Hi Hans,

On Tue, Jun 04, 2019 at 02:36:27PM +0200, Hans Verkuil wrote:
> Instead of filling in the struct v4l2_capability device_caps
> field, fill in the struct video_device device_caps field.
> 
> That way the V4L2 core knows what the capabilities of the
> video device are.
> 
> But this only really works if all drivers use this, so convert
> this touchscreen driver accordingly.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Cc: Florian Echtler <floe@butterbrot.org>
> ---
> Resend, adding Dmitry and linux-input to the CC list.
> 
> Dmitry, if you want to take this through your tree, then that's OK by me.
> 
> Alternatively, it can go through the media tree, but then I need your Ack.

I am fine with it going through media tree.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Thanks.
Hans Verkuil June 12, 2019, 7:19 a.m. UTC | #2
Florian: ping!

Regards,

	Hans

On 6/4/19 2:36 PM, Hans Verkuil wrote:
> Instead of filling in the struct v4l2_capability device_caps
> field, fill in the struct video_device device_caps field.
> 
> That way the V4L2 core knows what the capabilities of the
> video device are.
> 
> But this only really works if all drivers use this, so convert
> this touchscreen driver accordingly.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Cc: Florian Echtler <floe@butterbrot.org>
> ---
> Resend, adding Dmitry and linux-input to the CC list.
> 
> Dmitry, if you want to take this through your tree, then that's OK by me.
> 
> Alternatively, it can go through the media tree, but then I need your Ack.
> 
> Regards,
> 
> 	Hans
> ---
>  drivers/input/touchscreen/sur40.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
> index 894843a7ec7b..8b18d0acf5e0 100644
> --- a/drivers/input/touchscreen/sur40.c
> +++ b/drivers/input/touchscreen/sur40.c
> @@ -933,10 +933,6 @@ static int sur40_vidioc_querycap(struct file *file, void *priv,
>  	strlcpy(cap->driver, DRIVER_SHORT, sizeof(cap->driver));
>  	strlcpy(cap->card, DRIVER_LONG, sizeof(cap->card));
>  	usb_make_path(sur40->usbdev, cap->bus_info, sizeof(cap->bus_info));
> -	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TOUCH |
> -		V4L2_CAP_READWRITE |
> -		V4L2_CAP_STREAMING;
> -	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
>  	return 0;
>  }
>  @@ -1166,6 +1162,8 @@ static const struct video_device sur40_video_device = {
>  	.fops = &sur40_video_fops,
>  	.ioctl_ops = &sur40_video_ioctl_ops,
>  	.release = video_device_release_empty,
> +	.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TOUCH |
> +		       V4L2_CAP_READWRITE | V4L2_CAP_STREAMING,
>  };
>   /* USB-specific object needed to register this driver with the USB subsystem. */
>
Florian Echtler June 12, 2019, 8:46 a.m. UTC | #3
Sorry, didn't realize you'd also need my feedback. No complaints.

Acked-by: Florian Echtler <floe@butterbrot.org>

Best, Florian

On 04.06.19 18:06, Dmitry Torokhov wrote:
> Hi Hans,
> 
> On Tue, Jun 04, 2019 at 02:36:27PM +0200, Hans Verkuil wrote:
>> Instead of filling in the struct v4l2_capability device_caps
>> field, fill in the struct video_device device_caps field.
>>
>> That way the V4L2 core knows what the capabilities of the
>> video device are.
>>
>> But this only really works if all drivers use this, so convert
>> this touchscreen driver accordingly.
>>
>> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>> Cc: Florian Echtler <floe@butterbrot.org>
>> ---
>> Resend, adding Dmitry and linux-input to the CC list.
>>
>> Dmitry, if you want to take this through your tree, then that's OK by me.
>>
>> Alternatively, it can go through the media tree, but then I need your Ack.
> 
> I am fine with it going through media tree.
> 
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Thanks.
>
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index 894843a7ec7b..8b18d0acf5e0 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -933,10 +933,6 @@  static int sur40_vidioc_querycap(struct file *file, void *priv,
 	strlcpy(cap->driver, DRIVER_SHORT, sizeof(cap->driver));
 	strlcpy(cap->card, DRIVER_LONG, sizeof(cap->card));
 	usb_make_path(sur40->usbdev, cap->bus_info, sizeof(cap->bus_info));
-	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TOUCH |
-		V4L2_CAP_READWRITE |
-		V4L2_CAP_STREAMING;
-	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
 	return 0;
 }
 @@ -1166,6 +1162,8 @@ static const struct video_device sur40_video_device = {