From patchwork Thu Sep 14 05:54:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 722618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3ACBEEDE983 for ; Thu, 14 Sep 2023 06:37:10 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 32935A4D; Thu, 14 Sep 2023 08:36:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 32935A4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1694673428; bh=ej4c6dNQ/O5BWyGia2K6Ba0aelsNDe9yV3HOEh8spCE=; h=From:To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=ElAcT0/+nj44oM/XCnr1O7skjc93779qbjLEsE/E8hdrz2h6R/ce3O0uLrkchBPjS 9tIUoKWen7L0XdJPadfiKFu/psIXfa8ZrWqEjefjSlvWs3ULj/E7oxXkJfzoZwYrIw pH553Z+qrwQ7vU7XpyPM37VuH+0UETUK8Dt9XOD0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 344C3F805E8; Thu, 14 Sep 2023 08:33:50 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8DB51F805C4; Thu, 14 Sep 2023 08:33:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9132CF80246; Thu, 14 Sep 2023 08:32:46 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8927DF8047D for ; Thu, 14 Sep 2023 08:30:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8927DF8047D Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1E6151A0641; Thu, 14 Sep 2023 08:30:49 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id DAF361A0649; Thu, 14 Sep 2023 08:30:48 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 5456F1820F59; Thu, 14 Sep 2023 14:30:47 +0800 (+08) From: Shengjiu Wang To: hverkuil@xs4all.nl, sakari.ailus@iki.fi, tfiga@chromium.org, m.szyprowski@samsung.com, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH v3 7/9] media: uapi: Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control Date: Thu, 14 Sep 2023 13:54:03 +0800 Message-Id: <1694670845-17070-8-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1694670845-17070-1-git-send-email-shengjiu.wang@nxp.com> References: <1694670845-17070-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Message-ID-Hash: 4ZIFRB627X7ZQVDTWLLFCRO67CEHSSGE X-Message-ID-Hash: 4ZIFRB627X7ZQVDTWLLFCRO67CEHSSGE X-MailFrom: shengjiu.wang@nxp.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The input clock and output clock may not be the accurate rate as the sample rate, there is some drift, so the convert ratio of i.MX ASRC module need to be changed according to actual clock rate. Add V4L2_CID_USER_IMX_ASRC_RATIO_MOD control for user to adjust the ratio. Signed-off-by: Shengjiu Wang --- Documentation/userspace-api/media/v4l/control.rst | 5 +++++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + include/uapi/linux/v4l2-controls.h | 1 + 3 files changed, 7 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/control.rst b/Documentation/userspace-api/media/v4l/control.rst index 4463fce694b0..2bc175900a34 100644 --- a/Documentation/userspace-api/media/v4l/control.rst +++ b/Documentation/userspace-api/media/v4l/control.rst @@ -318,6 +318,11 @@ Control IDs depending on particular custom controls should check the driver name and version, see :ref:`querycap`. +.. _v4l2-audio-imx: + +``V4L2_CID_USER_IMX_ASRC_RATIO_MOD`` + sets the rasampler ratio modifier of i.MX asrc module. + Applications can enumerate the available controls with the :ref:`VIDIOC_QUERYCTRL` and :ref:`VIDIOC_QUERYMENU ` ioctls, get and set a diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c index 8696eb1cdd61..16f66f66198c 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c @@ -1242,6 +1242,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_COLORIMETRY_CLASS: return "Colorimetry Controls"; case V4L2_CID_COLORIMETRY_HDR10_CLL_INFO: return "HDR10 Content Light Info"; case V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY: return "HDR10 Mastering Display"; + case V4L2_CID_USER_IMX_ASRC_RATIO_MOD: return "ASRC RATIO MOD"; default: return NULL; } diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index c3604a0a3e30..b1c319906d12 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -162,6 +162,7 @@ enum v4l2_colorfx { /* The base for the imx driver controls. * We reserve 16 controls for this driver. */ #define V4L2_CID_USER_IMX_BASE (V4L2_CID_USER_BASE + 0x10b0) +#define V4L2_CID_USER_IMX_ASRC_RATIO_MOD (V4L2_CID_USER_IMX_BASE + 0) /* * The base for the atmel isc driver controls.