From: Shengjiu Wang <shengjiu.wang@nxp.com>
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 [thread overview]
Message-ID: <1694670845-17070-8-git-send-email-shengjiu.wang@nxp.com> (raw)
In-Reply-To: <1694670845-17070-1-git-send-email-shengjiu.wang@nxp.com>
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 <shengjiu.wang@nxp.com>
---
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 <VIDIOC_QUERYCTRL>` 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.
--
2.34.1
next prev parent reply other threads:[~2023-09-14 6:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-14 5:53 [RFC PATCH v3 0/9] Add audio support in v4l2 framework Shengjiu Wang
2023-09-14 5:53 ` [RFC PATCH v3 1/9] ASoC: fsl_asrc: define functions for memory to memory usage Shengjiu Wang
2023-09-14 5:53 ` [RFC PATCH v3 2/9] ASoC: fsl_easrc: " Shengjiu Wang
2023-09-14 5:53 ` [RFC PATCH v3 3/9] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound Shengjiu Wang
2023-09-14 5:54 ` [RFC PATCH v3 4/9] ASoC: fsl_asrc: register m2m platform device Shengjiu Wang
2023-09-14 5:54 ` [RFC PATCH v3 5/9] ASoC: fsl_easrc: " Shengjiu Wang
2023-09-14 5:54 ` [RFC PATCH v3 6/9] media: v4l2: Add audio capture and output support Shengjiu Wang
2023-09-14 10:17 ` Sakari Ailus
2023-09-19 10:31 ` Shengjiu Wang
2023-09-19 11:53 ` Sakari Ailus
2023-09-20 10:12 ` Hans Verkuil
2023-09-22 8:36 ` Shengjiu Wang
2023-09-14 5:54 ` Shengjiu Wang [this message]
2023-09-14 5:54 ` [RFC PATCH v3 8/9] media: audm2m: add virtual driver for audio memory to memory Shengjiu Wang
2023-09-14 5:54 ` [RFC PATCH v3 9/9] media: imx-asrc: Add memory to memory driver Shengjiu Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1694670845-17070-8-git-send-email-shengjiu.wang@nxp.com \
--to=shengjiu.wang@nxp.com \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=hverkuil@xs4all.nl \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@kernel.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=sakari.ailus@iki.fi \
--cc=shengjiu.wang@gmail.com \
--cc=tfiga@chromium.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).