From patchwork Thu Jun 16 21:40:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 9181793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 478AF60760 for ; Thu, 16 Jun 2016 21:44:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 390E828379 for ; Thu, 16 Jun 2016 21:44:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DCF52838A; Thu, 16 Jun 2016 21:44:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C90DC28379 for ; Thu, 16 Jun 2016 21:44:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDf3k-0005Cr-Oj; Thu, 16 Jun 2016 21:42:44 +0000 Received: from lists.s-osg.org ([54.187.51.154]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDf2a-0004Kl-1c for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2016 21:41:33 +0000 Received: from minerva.sisa.samsung.com (host-6.58.217.201.copaco.com.py [201.217.58.6]) by lists.s-osg.org (Postfix) with ESMTPSA id 07F2FE27F5; Thu, 16 Jun 2016 14:42:08 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH 2/6] [media] s5p-mfc: improve v4l2_capability driver and card fields Date: Thu, 16 Jun 2016 17:40:31 -0400 Message-Id: <1466113235-25909-3-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466113235-25909-1-git-send-email-javier@osg.samsung.com> References: <1466113235-25909-1-git-send-email-javier@osg.samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160616_144132_324833_D7D6FC4C X-CRM114-Status: GOOD ( 11.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kamil Debski , Jeongtae Park , Mauro Carvalho Chehab , Javier Martinez Canillas , Kyungmin Park , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Hans Verkuil Reviewed-by: Shuah Khan --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 1 - drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 2 ++ drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 4 ++-- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 6ee620ee8cd5..a936f89fa54a 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -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" diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index 9eb2481ec292..a10dcd244ff0 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -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 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index 4a40df22fd63..5793b0d8ee0c 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -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)); /* diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index dd466ea6429e..1220559d4874 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -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)); /*