From patchwork Mon Feb 26 08:28:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 206482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1956878dyb; Mon, 26 Feb 2024 01:22:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVkjnqawD2k4SIeyPId0y7B430AdiQEXZb8VUkPxdBnwrR6lMcs0n1QuxCHv4mNep5FOzlHoCR/3bK+C190KZeGTegwZg== X-Google-Smtp-Source: AGHT+IETN54aGlBDyaXXvbSzQeaNKT6uXHmNbI6iS3s7NV01KK+8mrihVz+GuguDe2q7mb13p1wA X-Received: by 2002:a17:90b:354b:b0:299:54bb:5cac with SMTP id lt11-20020a17090b354b00b0029954bb5cacmr5433368pjb.11.1708939336431; Mon, 26 Feb 2024 01:22:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708939336; cv=pass; d=google.com; s=arc-20160816; b=qZiSy1VTccH50ny8qzRkrrsfsRF1jpv8BHx7FjJ+CHs9uUzihW9wzxWCyPqRyVRgaE CI3AQiAw0UqI7GGhCOqylfpPW/D/CA9cpA5ynp3Ba5wNvzILhyHRdlCpPDiV3R79Vpqw 7nq4vxYWRNpfVRdmxn6NNGGD0e+J8gqIUmGuCpuv/SVVoEJVHI3EbKiL3rgoIuXmycDL 8A9x/siJ9CqYKj3zpS2vdH+CH9f6kvTZqApxQk3V66pCzY1f2ZNvv/tUxuckSgU4iKyA bSNytkP+SaUIF4ux3tm0l/bskCl+XwcJssMHcLR8jBrmFe9dKdLyssseWypkF5m5RQy5 Sb7w== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80930-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 31-20020a17090a09a200b0029a78b2f560si5247424pjo.186.2024.02.26.01.22.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 01:22:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80930-ouuuleilei=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-80930-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80930-ouuuleilei=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 7FB57283FFD for ; Mon, 26 Feb 2024 09:21:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD38555E57; Mon, 26 Feb 2024 08:44:23 +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: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791952773892538385 X-GMAIL-MSGID: 1791952773892538385 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); }