]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] s5p-mfc: improve v4l2_capability driver and card fields
authorJavier Martinez Canillas <javier@osg.samsung.com>
Thu, 16 Jun 2016 21:40:31 +0000 (18:40 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 8 Jul 2016 17:26:28 +0000 (14:26 -0300)
According to the V4L2 documentation the driver and card fields should be
used to identify the driver and the device but the s5p-mfc driver fills
those field using the platform device name, which in turn is the name of
the device DT node.

So not only the filled information isn't correct but also the same values
are used in all the fields for both the encoder and decoder video devices.

Before this patch:

Driver Info (not using libv4l2):
        Driver name   : 11000000.codec
        Card type     : 11000000.codec
        Bus info      : platform:11000000.codec
        Driver version: 4.7.0

Driver Info (not using libv4l2):
        Driver name   : 11000000.codec
        Card type     : 11000000.codec
        Bus info      : platform:11000000.codec
        Driver version: 4.7.0

After this patch:

Driver Info (not using libv4l2):
        Driver name   : s5p-mfc
        Card type     : s5p-mfc-dec
        Bus info      : platform:11000000.codec
        Driver version: 4.7.0

Driver Info (not using libv4l2):
        Driver name   : s5p-mfc
        Card type     : s5p-mfc-enc
        Bus info      : platform:11000000.codec
        Driver version: 4.7.0

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/s5p-mfc/s5p_mfc.c
drivers/media/platform/s5p-mfc/s5p_mfc_common.h
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c

index 47e7e20122052038c577084fab63889459d13098..c6f92c464378da0ea70d1dc495816b5192815507 100644 (file)
@@ -35,7 +35,6 @@
 #include "s5p_mfc_cmd.h"
 #include "s5p_mfc_pm.h"
 
-#define S5P_MFC_NAME           "s5p-mfc"
 #define S5P_MFC_DEC_NAME       "s5p-mfc-dec"
 #define S5P_MFC_ENC_NAME       "s5p-mfc-enc"
 
index 9eb2481ec292c2ee7ee99638d249005099b0c552..a10dcd244ff0ef10b3bae2ceaf415cc5b252300b 100644 (file)
@@ -25,6 +25,8 @@
 #include "regs-mfc.h"
 #include "regs-mfc-v8.h"
 
+#define S5P_MFC_NAME           "s5p-mfc"
+
 /* Definitions related to MFC memory */
 
 /* Offset base used to differentiate between CAPTURE and OUTPUT
index b892e79e2b59ce22f07e1c882d16a711a8c33940..889d1c8c91e37aedc5d8c222a15b36ec8017f92a 100644 (file)
@@ -265,8 +265,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct s5p_mfc_dev *dev = video_drvdata(file);
 
-       strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
-       strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
+       strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1);
+       strncpy(cap->card, dev->vfd_dec->name, sizeof(cap->card) - 1);
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(&dev->plat_dev->dev));
        /*
index 0bcc3aea2370f4389657c76afb310e18606268b4..fd961515a908408121e85debebe29ef29b6ffb67 100644 (file)
@@ -943,8 +943,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
        struct s5p_mfc_dev *dev = video_drvdata(file);
 
-       strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
-       strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
+       strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1);
+       strncpy(cap->card, dev->vfd_enc->name, sizeof(cap->card) - 1);
        snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
                 dev_name(&dev->plat_dev->dev));
        /*