Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1190969rbb; Mon, 26 Feb 2024 01:21:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXduGlPZzJxm9pCjuw2fnp7+5hGCtXKuda8mbURCaIJynfu6x4ldCIBozglhunsZvvm7FtJaIXPkzzHsmSPhZ9iIu1g/ZT1WyV5IqUvgg== X-Google-Smtp-Source: AGHT+IES4Ikv8wOmbVuK293WU0TjSxCbyftuhxw68yrslnOC/5SvCl9ScRySg2rznsgHdhYgCMQ+ X-Received: by 2002:a17:906:68d2:b0:a3e:5b7f:6d31 with SMTP id y18-20020a17090668d200b00a3e5b7f6d31mr3495290ejr.5.1708939277841; Mon, 26 Feb 2024 01:21:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708939277; cv=pass; d=google.com; s=arc-20160816; b=u570JRkh7ZrcFbUQNpFm7XQF86g5UV6oN2o/wWcz0NT0ImvYS+hbhHpyzqWJ+Xc1vS uDH4EBWQ8juo/X64kAyQR6/0xTW8yuFQD1aGxlTB/fUHzE/dpF6SvkGOHRhloq2Xo2MT R10lXXsf62EFkeSRT/vl6eEeAIPW6d42wz3kWlix8LXIFoNEvhCLR9JFwGkgGXf3leZh sziGXpTfMcavT5m+vR3rSTd2pKII8deJ2Gow8pWBmwxcUamw2Ba0EcQYohIDFK7jUSpK 0BI69HYVCjZZMwf0XknAqDejMggyM+a+0MztZpOqhl/da/U3r7IuZKbKmd69OUVu5+FT 5ZfA== 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=xq3eeYzS5OiVIvRXXHEETNJDR4jDLWFmJyEOtmMdcnCy1B9eZlNjLBOlQ/Csqpo8Gz Q4gvo95ZzyQQu1jcM21QSDyvnVaax0TifYtc6+Zns9hWRM806GozBXYjlm66n+dKnU9c +4OqRzyWcWxEaGgB359wKW6JWEn6ftg3hZxS549eYKDGLpbq6kpc5EeUOVgTeNhU9UAD IPfYwbN5smsxQ66jybivaGZ9vhNeD3z3a5OmvrunsmHZpL8Cnj1oy4AqgQs9xDtbNtEO s4ABEXGt7dsZya4jnox5eW56nmMiduDhulgjj/HvZdknQcsiFod0BalXHS1Pon5TAWGO iBsw==; 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-80930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80930-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id qf34-20020a1709077f2200b00a42fbaf0639si1621639ejc.465.2024.02.26.01.21.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 01:21:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-80930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80930-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9767A1F29203 for ; Mon, 26 Feb 2024 09:21:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 551A155765; Mon, 26 Feb 2024 08:44:22 +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 16F6054BC8; Mon, 26 Feb 2024 08:44:19 +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=1708937061; cv=none; b=UvrjiYMoes+oL/MXYb6EVMUjsdww+wdyFnXwo79Yv0LOOFndjmZUSqeTApNLCt/PudZwFu2j8YOJamWhwbedh5DrlDvW2tfouGnX5164h2wTomlYK7Wi17otAb6JD2glMyo81xCGWNlFwkiWUh/KZwi8R8N8Z4oNvaMqRwy8Fjo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708937061; c=relaxed/simple; bh=CNk2VPYgaHZVUWLkXbMZyzxsjX0YYQCq1bBFNAfMI2M=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=bZMl23Z5zyX/7vb6Hfj6eDyP5wecSatMjRsBLU6Ja4wA74ovPbqM0cEEuHzA02wMI6Qohofu4SiCvdO2IuacoOoFh8jPRRmHfh3AzntT4M4ZxaxvyQKhdlvQ6aef9SnjLiefMgriVomxpAm46MywNhVz1qpWTJtpiWW/ryYCcBk= 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 756EF200467; Mon, 26 Feb 2024 09:44:18 +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 3C1D120008E; Mon, 26 Feb 2024 09:44:18 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 309A6180031D; Mon, 26 Feb 2024 16:44:16 +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 v13 06/16] ASoC: fsl_easrc: register m2m platform device Date: Mon, 26 Feb 2024 16:28:19 +0800 Message-Id: <1708936109-11587-7-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1708936109-11587-1-git-send-email-shengjiu.wang@nxp.com> References: <1708936109-11587-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