Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp342592rdb; Thu, 18 Jan 2024 05:25:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgSmV6WhNw/5DjUU8XRQpIYjZCcngYGyK/biWzvnpBOQxqMGYPYaiDFPvN/+PXu1fZwvbN X-Received: by 2002:a17:903:258b:b0:1d5:aeee:e756 with SMTP id jb11-20020a170903258b00b001d5aeeee756mr693348plb.26.1705584345961; Thu, 18 Jan 2024 05:25:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705584345; cv=pass; d=google.com; s=arc-20160816; b=tE/cJItx4iFzWrU/d+9KBX/54MAP2JiZ4D2cspl/UPAgIe7k1tYH9LtZsr8wf0JyBw 6fsaDVRhZXhGetjuOP5TK3gaXuCMZg5bPeq3pw5zbWGSMRUSAmw4BzsUsvBpsfRq41rN XLxEdGoeVQwQ2oRqGiXL9IBL2TXY7FYzUwm/8YDTbbvzWiXM38L9t2MJHwQubK6g0vaO zq7yHe4uF6at/bDbi+ToKbvLrsDdEyTAlDi5+b6InZk1HoZYv3xNywyogtOnyPLcVogF QpkXNNUeYOk/I7a0aBsjTK03cS5A9GTlQ4X2yAPdJyh/GfQGQqcGcrN68NPeMkl9lpK+ Ls4w== 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=MRqG0zk+7RvfCIDchmMVq+g/nngp0bZPTid3c/WzzTg=; fh=ufiESpW7Hvn5oNmN0l6/qCUiQrKfLLrOwb5uR1Dftds=; b=oDOCi4ciF0PNz0cd3fIbKvQFa3ep8HZJraCdQn63PzCDCYPA4JzPYRWa7YbAtIetcR l3gEg/3bg0ze6aMdReA5B/5qR7QPlYq4pGJnq1L346mQre0wNLPA1Csauh5GAfGj2acd AMhDcUDtmXgKP5vR0Ll2+4nqglVbbKZoN4R25xfGSAsVcRs2fJa2aesoNmWiv8ohGqbw e9WdFNXPWoTIKdTIGuB7jNYNEPBnMITfnqiS6s7/upBgyNyNRHWN0oRx50c5ZwrPoo+m S5XOsFEJigJdNvKWTZzu4OzoI6TbJteLZRVoxkJKsm7xrOLmpzPEUXIp2uOG9hDlhNNE qgRw== 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-30151-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t7-20020a170902bc4700b001d4c4bd4bc8si1457093plz.354.2024.01.18.05.25.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 05:25:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30151-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::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-30151-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30151-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 996C0287E81 for ; Thu, 18 Jan 2024 13:25:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A564D28DCA; Thu, 18 Jan 2024 13:24:54 +0000 (UTC) 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id C48CB25546; Thu, 18 Jan 2024 13:24:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705584294; cv=none; b=uT4F6d5Fjr0dbyalk/TbmKli7C9esyXi8JTcUV6W3VNSgXKkCfqqZn7AMdukyKg89b4eiHzf+asLjCAlaE8q7TiITvF6mxqLuCNXmciw/sj2Yj8qnB8XRJfht//NcqQoU0uf3FOIJZ0/GkKXyE8I5qkRir8Nt0PoibpR/VWe/pk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705584294; c=relaxed/simple; bh=CNk2VPYgaHZVUWLkXbMZyzxsjX0YYQCq1bBFNAfMI2M=; h=Received:Received:Received:From:To:Subject:Date:Message-Id: X-Mailer:In-Reply-To:References:X-Virus-Scanned; b=VSLQ4yeb/asPTzv5k77cW3cwVnlVLSMZJmZ9dkql2MqOSmsO/mpO4v6iJszP+LsMA/m7hEXeRmTyJI1pJiFqtHGWOJV9m8x/EmMm6YgCPUDWhpXcmBmWwYIxQdQpDt1bzzehhVPolQQnh5JT6z9Vc5FZGmtAmEgm8GneqWx6P+w= 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.13 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 inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 49CF01A17C4; Thu, 18 Jan 2024 14:14:57 +0100 (CET) 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 129271A0762; Thu, 18 Jan 2024 14:14:57 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 0DDCE18002A2; Thu, 18 Jan 2024 21:14:54 +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 v12 05/15] ASoC: fsl_easrc: register m2m platform device Date: Thu, 18 Jan 2024 20:31:58 +0800 Message-Id: <1705581128-4604-6-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1705581128-4604-1-git-send-email-shengjiu.wang@nxp.com> References: <1705581128-4604-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: Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- sound/soc/fsl/fsl_easrc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index cf7ad30a323b..ccbf45c7abf4 100644 --- a/sound/soc/fsl/fsl_easrc.c +++ b/sound/soc/fsl/fsl_easrc.c @@ -2075,6 +2075,7 @@ MODULE_DEVICE_TABLE(of, fsl_easrc_dt_ids); static int fsl_easrc_probe(struct platform_device *pdev) { struct fsl_easrc_priv *easrc_priv; + struct fsl_asrc_m2m_pdata m2m_pdata; struct device *dev = &pdev->dev; struct fsl_asrc *easrc; struct resource *res; @@ -2190,6 +2191,19 @@ static int fsl_easrc_probe(struct platform_device *pdev) goto err_pm_disable; } + m2m_pdata.asrc = easrc; + m2m_pdata.fmt_in = FSL_EASRC_FORMATS; + m2m_pdata.fmt_out = FSL_EASRC_FORMATS | SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE; + m2m_pdata.rate_min = 8000; + m2m_pdata.rate_max = 768000; + m2m_pdata.chan_min = 1; + m2m_pdata.chan_max = 32; + easrc->m2m_pdev = platform_device_register_data(&pdev->dev, + M2M_DRV_NAME, + PLATFORM_DEVID_AUTO, + &m2m_pdata, + sizeof(m2m_pdata)); + return 0; err_pm_disable: @@ -2199,6 +2213,11 @@ static int fsl_easrc_probe(struct platform_device *pdev) static void fsl_easrc_remove(struct platform_device *pdev) { + struct fsl_asrc *easrc = dev_get_drvdata(&pdev->dev); + + if (easrc->m2m_pdev && !IS_ERR(easrc->m2m_pdev)) + platform_device_unregister(easrc->m2m_pdev); + pm_runtime_disable(&pdev->dev); } -- 2.34.1