Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp303420lql; Mon, 11 Mar 2024 03:18:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWy4hsBYbTZa6IyUZFqz+aRaztzJRIP0IbJvoX8V5Q3344iSfI6fHyR5h9tGvuc4drEjgIEdkFmOg2RNuPNAWp/GB8z1eqypbYozds//w== X-Google-Smtp-Source: AGHT+IGxpqNRv+PecXmevgbCqSkQmlaKPcKPpfE6t/CcJgMVKEKrmrh9th1878quXgo8u5tlOQw6 X-Received: by 2002:a0d:e816:0:b0:608:2b27:9e6d with SMTP id r22-20020a0de816000000b006082b279e6dmr4070522ywe.28.1710152337718; Mon, 11 Mar 2024 03:18:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710152337; cv=pass; d=google.com; s=arc-20160816; b=F2jO0Crfs04G0TwZypFqdBb/60WPmPN9sD+vdi4DmpQEsM3wQ05SI5mPywFQMqLdcU 2n8cjyjux9BAm2LyiHd3t2k/WY7/H70imx/pNzkUDkh+qVaO6jXHdm/flQmo5hiVIrSQ Mu1x2Ba0NUUhYVQepyldoIJhQmCWNTPbwk9sbNojCqUcM/ohLaJVu//OcEZagHw3e3LJ /JwJV11XFzgCKp40CAFUYazevNsajLmrLr4xQ6zAjZft0V+lCUSm3HgtAYDJJjBzWbEX rEo0jc7txK6MQStPy/7hI4NMd5iOjYv+ruv5jI5bkHxTJmrZJRxtmDlCQtdvPIZzWOAp qBqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:to:from; bh=s4CQje9hCRHLz0BkXC9FFCS1KEy6ZmkQNR6EvGUJoYs=; fh=ufiESpW7Hvn5oNmN0l6/qCUiQrKfLLrOwb5uR1Dftds=; b=PmFZW8k1dPMInOQULIOtPJqpdjrSswuyJopVUoknkCI0VpRADrSQWn8qsBdieTxp9J Ufr8K1OOspho5zfZt7p9Xku4hvwxk9LRVV2JnweTRly3PI7ISNBSDYWetIlQ0t3w2wOD TH7Kob1Tv/FU+nO9jtWviBmvbQDtZrL81eKocGQtm8oAmcT+uvVl8Gzpztfowb0DFVUm eRzmObBsKiA/zYx6nTGSn1V13hkp09ml1PxfHdNIOo7aq2ecxxS6X+5cCxQjlIViFEfF rawx6xwpFBCNOOoi/1WNOFX7SpMWWUGT9/Bdmz6WT4lrOuemQmLH6lM2DYzMSzgp05fJ x5dw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-98689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u6-20020a05622a198600b0042ef7077bc1si5007235qtc.550.2024.03.11.03.18.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 03:18:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-98689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6696D1C20342 for ; Mon, 11 Mar 2024 10:18:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EAA236B1B; Mon, 11 Mar 2024 10:18:45 +0000 (UTC) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3BD12BB1A; Mon, 11 Mar 2024 10:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710152324; cv=none; b=Jqy+7z0geCz2kDGa0lWWpgiWRafU0G9to2rUFLcleScppnm4N8uSAl+Scv2p8RnpJjSK3fIp9iujRulBQGO2qdD5kO2ilZGasxxTc6gvpYwlxVkt1aYsmUsJFW62GIL1CfB7kHy4P/odGHpTcKBS/elYjzOjmCr108iKbkPZJP0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710152324; c=relaxed/simple; bh=fgYQVMxpAmTgYDCZIFPEaCK+FRLJh6UXAq9wyXsuRvM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=T8JxqZAMSXC6/GrpVK7bLIXQdtt72VtBdZsfGLQ0y2BdFN3w6rzCcsfNtXs6uMKcQ/kRz9haUN/uOihNYeBis1054stPoM4mguUEYF0iBoLGBMlbdt+wK0C2W9cSBa7YuHAns55UNSyT6UJaOtCyIDijvbCXZ7ODdqe3Hrt09n8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BB23E200F39; Mon, 11 Mar 2024 11:10:28 +0100 (CET) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 24C8D2007BB; Mon, 11 Mar 2024 11:10:28 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id A2179180222A; Mon, 11 Mar 2024 18:10:25 +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: [PATCH v14 12/16] media: uapi: Declare interface types for Audio Date: Mon, 11 Mar 2024 17:53:57 +0800 Message-Id: <1710150841-26991-13-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1710150841-26991-1-git-send-email-shengjiu.wang@nxp.com> References: <1710150841-26991-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Declare the interface types that will be used by Audio. The type is MEDIA_INTF_T_V4L_AUDIO. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/mediactl/media-types.rst | 5 +++++ drivers/media/v4l2-core/v4l2-dev.c | 4 ++++ drivers/media/v4l2-core/v4l2-mem2mem.c | 13 +++++++++---- include/uapi/linux/media.h | 1 + 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Documentation/userspace-api/media/mediactl/media-types.rst b/Documentation/userspace-api/media/mediactl/media-types.rst index 6332e8395263..adfb37430f8e 100644 --- a/Documentation/userspace-api/media/mediactl/media-types.rst +++ b/Documentation/userspace-api/media/mediactl/media-types.rst @@ -265,6 +265,7 @@ Types and flags used to represent the media graph elements .. _MEDIA-INTF-T-V4L-SUBDEV: .. _MEDIA-INTF-T-V4L-SWRADIO: .. _MEDIA-INTF-T-V4L-TOUCH: +.. _MEDIA-INTF-T-V4L-AUDIO: .. _MEDIA-INTF-T-ALSA-PCM-CAPTURE: .. _MEDIA-INTF-T-ALSA-PCM-PLAYBACK: .. _MEDIA-INTF-T-ALSA-CONTROL: @@ -322,6 +323,10 @@ Types and flags used to represent the media graph elements - Device node interface for Touch device (V4L) - typically, /dev/v4l-touch? + * - ``MEDIA_INTF_T_V4L_AUDIO`` + - Device node interface for Audio device (V4L) + - typically, /dev/v4l-audio? + * - ``MEDIA_INTF_T_ALSA_PCM_CAPTURE`` - Device node interface for ALSA PCM Capture - typically, /dev/snd/pcmC?D?c diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index bac008fcedc6..ca8462a61e1f 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -844,6 +844,10 @@ static int video_register_media_controller(struct video_device *vdev) intf_type = MEDIA_INTF_T_V4L_SUBDEV; /* Entity will be created via v4l2_device_register_subdev() */ break; + case VFL_TYPE_AUDIO: + intf_type = MEDIA_INTF_T_V4L_AUDIO; + /* Entity will be created via v4l2_device_register_subdev() */ + break; default: return 0; } diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c index 75517134a5e9..cda5e255305f 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c @@ -1143,10 +1143,15 @@ int v4l2_m2m_register_media_controller(struct v4l2_m2m_dev *m2m_dev, if (ret) goto err_rm_links0; - /* Create video interface */ - m2m_dev->intf_devnode = media_devnode_create(mdev, - MEDIA_INTF_T_V4L_VIDEO, 0, - VIDEO_MAJOR, vdev->minor); + if (vdev->vfl_type == VFL_TYPE_AUDIO) + m2m_dev->intf_devnode = media_devnode_create(mdev, + MEDIA_INTF_T_V4L_AUDIO, 0, + VIDEO_MAJOR, vdev->minor); + else + /* Create video interface */ + m2m_dev->intf_devnode = media_devnode_create(mdev, + MEDIA_INTF_T_V4L_VIDEO, 0, + VIDEO_MAJOR, vdev->minor); if (!m2m_dev->intf_devnode) { ret = -ENOMEM; goto err_rm_links1; diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index 1c80b1d6bbaf..9ff6dec7393a 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h @@ -260,6 +260,7 @@ struct media_links_enum { #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3) #define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4) #define MEDIA_INTF_T_V4L_TOUCH (MEDIA_INTF_T_V4L_BASE + 5) +#define MEDIA_INTF_T_V4L_AUDIO (MEDIA_INTF_T_V4L_BASE + 6) #define MEDIA_INTF_T_ALSA_BASE 0x00000300 #define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE) -- 2.34.1