From: Hans Verkuil <hverkuil@xs4all.nl>
To: Shengjiu Wang <shengjiu.wang@nxp.com>,
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: Re: [PATCH v10 13/14] media: imx-asrc: Add memory to memory driver
Date: Tue, 21 Nov 2023 10:20:10 +0100 [thread overview]
Message-ID: <0026a04d-8a04-4eeb-9f03-c68be6da5ec5@xs4all.nl> (raw)
In-Reply-To: <1700552255-5364-14-git-send-email-shengjiu.wang@nxp.com>
On 21/11/2023 08:37, Shengjiu Wang wrote:
> Implement the ASRC memory to memory function using
> the v4l2 framework, user can use this function with
> v4l2 ioctl interface.
>
> User send the output and capture buffer to driver and
> driver store the converted data to the capture buffer.
>
> This feature can be shared by ASRC and EASRC drivers
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
> drivers/media/platform/nxp/Kconfig | 13 +
> drivers/media/platform/nxp/Makefile | 1 +
> drivers/media/platform/nxp/imx-asrc.c | 1264 +++++++++++++++++++++++++
> 3 files changed, 1278 insertions(+)
> create mode 100644 drivers/media/platform/nxp/imx-asrc.c
>
<snip>
> +static const struct v4l2_ctrl_config asrc_src_rate_off_control = {
> + .ops = &asrc_m2m_ctrl_ops,
> + .id = V4L2_CID_M2M_AUDIO_SOURCE_RATE_OFFSET,
> + .name = "Audio Source Sample Rate Offset",
> + .type = V4L2_CTRL_TYPE_INTEGER64,
Do you need this to be INTEGER64? If the actual number of bits
of the fixed point value that the hardware uses fits in 32 bits,
then you can just use the INTEGER type.
> + .min = 0xFFFFFF0000000000,
> + .max = 0x7fffffffff,
> + .def = 0,
> + .step = 1,
> + .flags = V4L2_CTRL_FLAG_UPDATE,
> + .fraction_bits = 32,
Can't you use the actual number of fraction bits that the hardware
uses? I can't imagine that it is actually 32 bits, it is almost
certainly less.
I do think that we need a helper function to fill in the min/max values.
Regards,
Hans
> +};
> +
> +static const struct v4l2_ctrl_config asrc_dst_rate_off_control = {
> + .ops = &asrc_m2m_ctrl_ops,
> + .id = V4L2_CID_M2M_AUDIO_DEST_RATE_OFFSET,
> + .name = "Audio Dest Sample Rate Offset",
> + .type = V4L2_CTRL_TYPE_INTEGER64,
> + .min = 0xFFFFFF0000000000,
> + .max = 0x7fffffffff,
> + .def = 0,
> + .step = 1,
> + .flags = V4L2_CTRL_FLAG_UPDATE,
> + .fraction_bits = 32,
> +};
next prev parent reply other threads:[~2023-11-21 9:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 7:37 [PATCH v10 00/14] Add audio support in v4l2 framework Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 01/14] ASoC: fsl_asrc: define functions for memory to memory usage Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 02/14] ASoC: fsl_easrc: " Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 03/14] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 04/14] ASoC: fsl_asrc: register m2m platform device Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 05/14] ASoC: fsl_easrc: " Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 06/14] media: uapi: Add V4L2_CAP_AUDIO_M2M capability flag Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 07/14] media: v4l2: Add audio capture and output support Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 08/14] media: uapi: Define audio sample format fourcc type Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 09/14] media: uapi: Add V4L2_CTRL_CLASS_M2M_AUDIO Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 10/14] media: uapi: Add audio rate controls support Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 11/14] media: uapi: Declare interface types for Audio Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 12/14] media: uapi: Add an entity type for audio resampler Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 13/14] media: imx-asrc: Add memory to memory driver Shengjiu Wang
2023-11-21 9:20 ` Hans Verkuil [this message]
2023-11-21 10:11 ` Shengjiu Wang
2023-11-21 7:37 ` [PATCH v10 14/14] media: vim2m-audio: add virtual driver for audio memory to memory Shengjiu Wang
2023-11-21 9:22 ` [PATCH v10 00/14] Add audio support in v4l2 framework Hans Verkuil
2023-11-21 10:03 ` Shengjiu Wang
2023-11-21 10:21 ` Hans Verkuil
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=0026a04d-8a04-4eeb-9f03-c68be6da5ec5@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--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=shengjiu.wang@nxp.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).