Commit e0d80c8a authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Mauro Carvalho Chehab

[media] s5p-mfc: improve v4l2_capability driver and card fields

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: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 4759bb46
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "s5p_mfc_cmd.h" #include "s5p_mfc_cmd.h"
#include "s5p_mfc_pm.h" #include "s5p_mfc_pm.h"
#define S5P_MFC_NAME "s5p-mfc"
#define S5P_MFC_DEC_NAME "s5p-mfc-dec" #define S5P_MFC_DEC_NAME "s5p-mfc-dec"
#define S5P_MFC_ENC_NAME "s5p-mfc-enc" #define S5P_MFC_ENC_NAME "s5p-mfc-enc"
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "regs-mfc.h" #include "regs-mfc.h"
#include "regs-mfc-v8.h" #include "regs-mfc-v8.h"
#define S5P_MFC_NAME "s5p-mfc"
/* Definitions related to MFC memory */ /* Definitions related to MFC memory */
/* Offset base used to differentiate between CAPTURE and OUTPUT /* Offset base used to differentiate between CAPTURE and OUTPUT
......
...@@ -265,8 +265,8 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -265,8 +265,8 @@ static int vidioc_querycap(struct file *file, void *priv,
{ {
struct s5p_mfc_dev *dev = video_drvdata(file); struct s5p_mfc_dev *dev = video_drvdata(file);
strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1); strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1);
strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1); strncpy(cap->card, dev->vfd_dec->name, sizeof(cap->card) - 1);
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
dev_name(&dev->plat_dev->dev)); dev_name(&dev->plat_dev->dev));
/* /*
......
...@@ -943,8 +943,8 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -943,8 +943,8 @@ static int vidioc_querycap(struct file *file, void *priv,
{ {
struct s5p_mfc_dev *dev = video_drvdata(file); struct s5p_mfc_dev *dev = video_drvdata(file);
strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1); strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1);
strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1); strncpy(cap->card, dev->vfd_enc->name, sizeof(cap->card) - 1);
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
dev_name(&dev->plat_dev->dev)); dev_name(&dev->plat_dev->dev));
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment