Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3713920rdb; Wed, 13 Sep 2023 23:34:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEm5Z0ymMWRsWss43C1qPK/O1qG2q6yt/4/XKB7BKq6iFevL1XRLOq5ANnji7GAv8KAsyJi X-Received: by 2002:a05:6a00:cd3:b0:68f:f650:3035 with SMTP id b19-20020a056a000cd300b0068ff6503035mr5457339pfv.12.1694673292107; Wed, 13 Sep 2023 23:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694673292; cv=none; d=google.com; s=arc-20160816; b=oEJHsu76zJt1UPuOFq1Py7Cm1A0prCcmtgVj0wsrOh3il/KbtSCqC/Vo9u+F8cpKyn 4Xs1E6fSC/xZqveNDpsgLpa1NIFJl4qcO4/pdZtMOZivT057k+kMBnmQqoXcFOx067Vf HoN8EP5Go2YiFF+4KB3JL3LEqa3guN5V+RxaGO/7roZQuOUpT5qO6Yf9fcL/oJOfNWqo /zA383/cMUDyFr5Xl5uUcrv6sHXA7obg9hC7j6WnGqIRbUU6RaE2P4u1rv2EzYZizc8t 4IAvcB/OhkrKzWGTb34kSHsgHtYOMIhMHFMEyobLhSJPtAD/DbFd1zgYwVe1XLZChBSX qb3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from; bh=y7OjcqYd/G+uk00ogloyLSl48hg3ZStxMZpIij7Dem8=; fh=ufiESpW7Hvn5oNmN0l6/qCUiQrKfLLrOwb5uR1Dftds=; b=hmVefaNLCcGtV9PaDHBVC/Id04rNnjRAev7spC1n1RExk7Ok8MrkNtSE/+ztU6l+Zn yhI3FWHna8lp4fzmi14+Q3gVunAVGMXtzvZ6BrP23UTG8D07YX6uN3pnn65cK4IwbicU VlZtZfxXioCwbiDI2mMK6YbI5rkacJVhRkvL/KCr1a9d+kvG1XkguaLMuNtJyaF7qwDB K9LhRU68zYqrXE9jP2+nSyfxyJS9qYiCW1otq6z0iNDB4IJ3Y3qBtXZY+w/zuUnp4wgf uNLTKnHf12MyMYpYFobuxBwPJud+ju9p1SwIqtb/UvNZaH/0l2Vthg3Uv/qy9ih4FaBv ksoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id x7-20020a056a000bc700b0068e45c9c986si902997pfu.136.2023.09.13.23.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 23:34:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 0E46B8219C05; Wed, 13 Sep 2023 23:31:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235760AbjINGbG (ORCPT + 99 others); Thu, 14 Sep 2023 02:31:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235689AbjINGbA (ORCPT ); Thu, 14 Sep 2023 02:31:00 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90EB4E6A for ; Wed, 13 Sep 2023 23:30:50 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Sep 2023 23:31:36 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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. -- 2.34.1