diff mbox

[v2] media: davinci: vpif: set device capabilities

Message ID 1348582915-22878-1-git-send-email-prabhakar.lad@ti.com (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Lad, Prabhakar Sept. 25, 2012, 2:21 p.m. UTC
From: Lad, Prabhakar <prabhakar.lad@ti.com>

set device_caps and also change the driver and
bus_info to proper values as per standard.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
---
 Changes for v2:
 1: Change the bus_info and driver to proper values,
    pointed by Hans.

 drivers/media/platform/davinci/vpif_capture.c |    9 ++++++---
 drivers/media/platform/davinci/vpif_display.c |    9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

Comments

Hans Verkuil Oct. 4, 2012, 8:54 a.m. UTC | #1
On Tue 25 September 2012 16:21:55 Prabhakar wrote:
> From: Lad, Prabhakar <prabhakar.lad@ti.com>
> 
> set device_caps and also change the driver and
> bus_info to proper values as per standard.
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> ---
>  Changes for v2:
>  1: Change the bus_info and driver to proper values,
>     pointed by Hans.
> 
>  drivers/media/platform/davinci/vpif_capture.c |    9 ++++++---
>  drivers/media/platform/davinci/vpif_display.c |    9 ++++++---
>  2 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
> index 4828888..cb70e98 100644
> --- a/drivers/media/platform/davinci/vpif_capture.c
> +++ b/drivers/media/platform/davinci/vpif_capture.c
> @@ -1630,9 +1630,12 @@ static int vpif_querycap(struct file *file, void  *priv,
>  {
>  	struct vpif_capture_config *config = vpif_dev->platform_data;
>  
> -	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> -	strlcpy(cap->driver, "vpif capture", sizeof(cap->driver));
> -	strlcpy(cap->bus_info, "VPIF Platform", sizeof(cap->bus_info));
> +	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> +			V4L2_CAP_READWRITE;

Why add READWRITE? There is no read/write support in these drivers.

> +	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
> +	snprintf(cap->driver, sizeof(cap->driver), "%s", dev_name(vpif_dev));
> +	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> +		 dev_name(vpif_dev));
>  	strlcpy(cap->card, config->card_name, sizeof(cap->card));
>  
>  	return 0;
> diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
> index d94b8a2..411b547 100644
> --- a/drivers/media/platform/davinci/vpif_display.c
> +++ b/drivers/media/platform/davinci/vpif_display.c
> @@ -827,9 +827,12 @@ static int vpif_querycap(struct file *file, void  *priv,
>  {
>  	struct vpif_display_config *config = vpif_dev->platform_data;
>  
> -	cap->capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
> -	strlcpy(cap->driver, "vpif display", sizeof(cap->driver));
> -	strlcpy(cap->bus_info, "Platform", sizeof(cap->bus_info));
> +	cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING |
> +			    V4L2_CAP_READWRITE;

Ditto.

> +	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
> +	snprintf(cap->driver, sizeof(cap->driver), "%s", dev_name(vpif_dev));
> +	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> +		 dev_name(vpif_dev));
>  	strlcpy(cap->card, config->card_name, sizeof(cap->card));
>  
>  	return 0;
> 

Regards,

	Hans
diff mbox

Patch

diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index 4828888..cb70e98 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1630,9 +1630,12 @@  static int vpif_querycap(struct file *file, void  *priv,
 {
 	struct vpif_capture_config *config = vpif_dev->platform_data;
 
-	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
-	strlcpy(cap->driver, "vpif capture", sizeof(cap->driver));
-	strlcpy(cap->bus_info, "VPIF Platform", sizeof(cap->bus_info));
+	cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
+			V4L2_CAP_READWRITE;
+	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
+	snprintf(cap->driver, sizeof(cap->driver), "%s", dev_name(vpif_dev));
+	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+		 dev_name(vpif_dev));
 	strlcpy(cap->card, config->card_name, sizeof(cap->card));
 
 	return 0;
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index d94b8a2..411b547 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -827,9 +827,12 @@  static int vpif_querycap(struct file *file, void  *priv,
 {
 	struct vpif_display_config *config = vpif_dev->platform_data;
 
-	cap->capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
-	strlcpy(cap->driver, "vpif display", sizeof(cap->driver));
-	strlcpy(cap->bus_info, "Platform", sizeof(cap->bus_info));
+	cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING |
+			    V4L2_CAP_READWRITE;
+	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
+	snprintf(cap->driver, sizeof(cap->driver), "%s", dev_name(vpif_dev));
+	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+		 dev_name(vpif_dev));
 	strlcpy(cap->card, config->card_name, sizeof(cap->card));
 
 	return 0;