From nobody Tue Feb 10 05:44:09 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 1F05D3164AF for ; Mon, 20 Oct 2025 13:12:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760965941; cv=none; b=lvQmohOJWGcC0PrNcegNEhc8ZxcomsvguYDFWNIgbwTwrdMOP1I0qmXo1Bc5Uwfk+/fY+a28K485lGoLprMU4hXshfxoN+SUaU3uoSef55eFPHRfSDcvz7GEzhzTJkJHzelwClZ4Nm0nONdkwjF9NhxaB4tPlFVou2j3mzaur+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760965941; c=relaxed/simple; bh=/HFo0chNl4GSV9KBtCBODfpuGIDSCIV2oMLhJt9NfPk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JAhsbl8/DHfoJiJWk8/W2XKKggxiw0foHVQFlSCs1pfzc/ONdP7CS5qGJZiEN6JhPqp7aGFjB/hYHPAXOvYSr6tnA7NXnf2urQxOwbHa8/8oee7oABiZm0OSSJdeJTVOWD3mDH8GyhUyeTlsJgiZiEGUZ7c2hzJHSML46RMz0dA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=oajbwBi6; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="oajbwBi6" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59KB1H93010027 for ; Mon, 20 Oct 2025 13:12:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=XDzjsbNRreQ M8IINxKudUQBopPbwW7nJ5HkVJNfp380=; b=oajbwBi6Wp2HJbEL7zZ1MPCm4JR b0FadfaqV127SkiwL+6STXy9aSEqCeqosZ9JNMPMhMSHdkbyagvtioUdXQ1EY4SG 1c4IXPuuaC4bevRAgpvpnB3Plh8VKRvhvZd4Ze+bsS9AVZo32JorgfoTwhafPWiQ B2oIrUpwe2FYuV93xzpifdES8HZ0ijqHk9G8GAuaVaSKm+gdW0e6yVnotdA9v4DE vIFZ3+zCLiXNI6PsOVc3tnTu8bgAzrUijus6Aks/kkKpWc0q3Dsc3nrF27uLDapx M3ePZv280JRTHdNdScmpbA4x6uv4Os3A7Po3G2AyQZMIjEzaTE77aIv6h2g== Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49v0kfd35n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 20 Oct 2025 13:12:18 +0000 (GMT) Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-87c1f18cbc6so260792846d6.1 for ; Mon, 20 Oct 2025 06:12:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760965937; x=1761570737; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XDzjsbNRreQM8IINxKudUQBopPbwW7nJ5HkVJNfp380=; b=M6k32KpPb6k9/lwd4DCAG31GeG25iG+3W27MNSfNkE5TyUT4fSlD2Pefb1qnX4odQT Rk9mdocYSGDmzC8qxABf0CI9clRLpdHYxI6u0U18HXiF7wYajl1JLrDot/zil9o7UbZ/ hHe3+gqGoRO9HEPtTFv/5UWkspjWzymyjej32EV7apEebRr+mNOgM4gQ1t+DqJxC+b1i cWPuuVAhVtkSino2UOFv+vva2fC2q8/gcxbevk0Vwkw5JBdvQYEqPp7n5BvaG+yYc8D3 LsJvI1Y5sZLBoJl4CY8w6Gs7E6MmgQ5/GWVzBd5kCew9I5uh1FLgL8e+HAJCeAUap/Ex gJCQ== X-Forwarded-Encrypted: i=1; AJvYcCVDO0ITGfmrmtQHxxIHR7QxxlZtjUTawauNsTzUs1x4gWF+rDsfrbTjzEY1+VYXi5z3Zfv41V2EJPwsv+A=@vger.kernel.org X-Gm-Message-State: AOJu0YzZvi0Po2OUveic1aIPLe4l2poU3406MYzu8KGjreuTUQEYnXsJ s6rCsl/bR70Ddwa8eXptBCu3RTJ/5pnf00O4z/scStH6vgBzqhw95upCZuK9GbdZNcRvm0A2VWZ Ss1pJa1RYebyzz1j1ckcLBm7vqudEa7tuKy073WoEUcz1kusQCApw/bxdntam5r+w2IM= X-Gm-Gg: ASbGncsq55CsDEwhuj90S19oAD2F1Y5+ihiSFaIAr5M/BrJ/LHnHTxgNlExR6+5vFTv LxwoR4QZjA8hdv0gRvv1BNBhWuj/izJolZLa0XSZQDF+pfLebnzweO8mhhYcBZjSePcqbjSr7g5 utjPo1g+gFKDR+IfZ4yxcusugRAuhXTY2yfyudWlzgD432appCzuJQmc1ZU9CeIrceOfWTn3cUr uTJ0Nytq63SYqt7TPVncJmuGtURQ29fhYQMzt8+2sI47xk0FMsxDhl7HtrNt25aGhBTNcI2/KIQ rUaYNArCGnJT18o5XfMKWV1ce/M0T3cO6mrffhNwFMdpb61SbpbiTn9myMDo/dSg9gNnGNrvbha DCI6H7+8SC2vr X-Received: by 2002:a05:622a:1182:b0:4e8:9a7d:90fb with SMTP id d75a77b69052e-4e89d335b1amr166530161cf.50.1760965936472; Mon, 20 Oct 2025 06:12:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVPdUATgyqwUuw9C3MrPllzh7sJzA95U4vgS0PSVpRWvNjeqg+RHAgWUSvgscGhdStT/pqgA== X-Received: by 2002:a05:622a:1182:b0:4e8:9a7d:90fb with SMTP id d75a77b69052e-4e89d335b1amr166529721cf.50.1760965935977; Mon, 20 Oct 2025 06:12:15 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4710e8037aasm118165505e9.2.2025.10.20.06.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Oct 2025 06:12:15 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org, alexey.klimov@linaro.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 2/2] ASoC: qcom: sdw: remove redundant code Date: Mon, 20 Oct 2025 14:12:08 +0100 Message-ID: <20251020131208.22734-3-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251020131208.22734-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251020131208.22734-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=E6LAZKdl c=1 sm=1 tr=0 ts=68f63532 cx=c_pps a=7E5Bxpl4vBhpaufnMqZlrw==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=eS8ScSGqROhw0OgIVi4A:9 a=pJ04lnu7RYOZP9TFuWaZ:22 X-Proofpoint-ORIG-GUID: ArmpE5d_sz-YN_oXwHQkMKZnol9p_WSv X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE4MDAwMiBTYWx0ZWRfX6f+0S5VDq63/ UTHA3Mp3I3wjE6NaOV6Wovapfkuvcgg4lisKfMtkNGS06qb/jsryDvBYUBenobsY6961wsQwrsc QUEDJRPF3zpdQJeeI3fZ9p97gZzyF3GFRvlgBfyDxrOylBBf4nKFDA7Y7R6iBWF0Trs+XiQoxBu E5Y9XnDeExVwOIzom8iDSOGBYLxJcYdFjXHpeTrRqBXg/UMrzUaZeTDPzj8Bqb2ucqTzBpjJlpF uvs6PsjObaG1fvoK7o2/nfiy2XZ2XQqS0IChw6taXB1AMthZkZcW45z2fTKW9CQVGIZsAs1Gwij iEFp7a8Sg4/wYOdQVXEFA8gagq4c5mQpxbEqYlv8ElyAvU6r78RjpjAyz3IhTyy/YkhpF1TesK3 tqy5OlIm51knS2DnOSvlTi6XlLgrUA== X-Proofpoint-GUID: ArmpE5d_sz-YN_oXwHQkMKZnol9p_WSv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-20_04,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510180002 Content-Type: text/plain; charset="utf-8" remove redundant code and pointers to handle sdw_stream_runtime by making use of qcom_snd_sdw_get_stream(). This removes need of machine specific shutdown and hw_params sdw callbacks and also need to store sdw_stream_runtime pointers in machine drivers. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/sc8280xp.c | 33 +++------------------------------ sound/soc/qcom/sdw.c | 24 ++++++++++++------------ sound/soc/qcom/sdw.h | 6 +----- sound/soc/qcom/sm8250.c | 33 +++------------------------------ sound/soc/qcom/x1e80100.c | 33 +++------------------------------ 5 files changed, 22 insertions(+), 107 deletions(-) diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c index 9ba536dff667..5bd8e8aa1853 100644 --- a/sound/soc/qcom/sc8280xp.c +++ b/sound/soc/qcom/sc8280xp.c @@ -18,7 +18,6 @@ struct sc8280xp_snd_data { bool stream_prepared[AFE_PORT_MAX]; struct snd_soc_card *card; - struct sdw_stream_runtime *sruntime[AFE_PORT_MAX]; struct snd_soc_jack jack; struct snd_soc_jack dp_jack[8]; bool jack_setup; @@ -68,17 +67,6 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime = *rtd) return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); } =20 -static void sc8280xp_snd_shutdown(struct snd_pcm_substream *substream) -{ - struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); - struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct sc8280xp_snd_data *pdata =3D snd_soc_card_get_drvdata(rtd->card); - struct sdw_stream_runtime *sruntime =3D qcom_snd_sdw_get_stream(substream= ); - - pdata->sruntime[cpu_dai->id] =3D NULL; - sdw_release_stream(sruntime); -} - static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { @@ -108,25 +96,13 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_= pcm_runtime *rtd, return 0; } =20 -static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); - struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct sc8280xp_snd_data *pdata =3D snd_soc_card_get_drvdata(rtd->card); - - return qcom_snd_sdw_hw_params(substream, params, &pdata->sruntime[cpu_dai= ->id]); -} - static int sc8280xp_snd_prepare(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); struct sc8280xp_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); - struct sdw_stream_runtime *sruntime =3D data->sruntime[cpu_dai->id]; =20 - return qcom_snd_sdw_prepare(substream, sruntime, - &data->stream_prepared[cpu_dai->id]); + return qcom_snd_sdw_prepare(substream, &data->stream_prepared[cpu_dai->id= ]); } =20 static int sc8280xp_snd_hw_free(struct snd_pcm_substream *substream) @@ -134,16 +110,13 @@ static int sc8280xp_snd_hw_free(struct snd_pcm_substr= eam *substream) struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct sc8280xp_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct sdw_stream_runtime *sruntime =3D data->sruntime[cpu_dai->id]; =20 - return qcom_snd_sdw_hw_free(substream, sruntime, - &data->stream_prepared[cpu_dai->id]); + return qcom_snd_sdw_hw_free(substream, &data->stream_prepared[cpu_dai->id= ]); } =20 static const struct snd_soc_ops sc8280xp_be_ops =3D { .startup =3D qcom_snd_sdw_startup, - .shutdown =3D sc8280xp_snd_shutdown, - .hw_params =3D sc8280xp_snd_hw_params, + .shutdown =3D qcom_snd_sdw_shutdown, .hw_free =3D sc8280xp_snd_hw_free, .prepare =3D sc8280xp_snd_prepare, }; diff --git a/sound/soc/qcom/sdw.c b/sound/soc/qcom/sdw.c index d866fad04131..df5cc1dcb96f 100644 --- a/sound/soc/qcom/sdw.c +++ b/sound/soc/qcom/sdw.c @@ -112,19 +112,21 @@ int qcom_snd_sdw_startup(struct snd_pcm_substream *su= bstream) EXPORT_SYMBOL_GPL(qcom_snd_sdw_startup); =20 int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, - struct sdw_stream_runtime *sruntime, bool *stream_prepared) { struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); + struct sdw_stream_runtime *sruntime; int ret; =20 - if (!sruntime) - return 0; =20 if (!qcom_snd_is_sdw_dai(cpu_dai->id)) return 0; =20 + sruntime =3D qcom_snd_sdw_get_stream(substream); + if (!sruntime) + return 0; + if (*stream_prepared) return 0; =20 @@ -171,26 +173,24 @@ struct sdw_stream_runtime *qcom_snd_sdw_get_stream(st= ruct snd_pcm_substream *sub } EXPORT_SYMBOL_GPL(qcom_snd_sdw_get_stream); =20 -int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, - struct sdw_stream_runtime **psruntime) +void qcom_snd_sdw_shutdown(struct snd_pcm_substream *substream) { - *psruntime =3D qcom_snd_sdw_get_stream(substream); - - return 0; + struct sdw_stream_runtime *sruntime =3D qcom_snd_sdw_get_stream(substream= ); =20 + sdw_release_stream(sruntime); } -EXPORT_SYMBOL_GPL(qcom_snd_sdw_hw_params); +EXPORT_SYMBOL_GPL(qcom_snd_sdw_shutdown); =20 -int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, - struct sdw_stream_runtime *sruntime, bool *stream_prepared) +int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, bool *stream= _prepared) { struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); + struct sdw_stream_runtime *sruntime; =20 if (!qcom_snd_is_sdw_dai(cpu_dai->id)) return 0; =20 + sruntime =3D qcom_snd_sdw_get_stream(substream); if (sruntime && *stream_prepared) { sdw_disable_stream(sruntime); sdw_deprepare_stream(sruntime); diff --git a/sound/soc/qcom/sdw.h b/sound/soc/qcom/sdw.h index b8bc5beb0522..061a63f1ac52 100644 --- a/sound/soc/qcom/sdw.h +++ b/sound/soc/qcom/sdw.h @@ -7,14 +7,10 @@ #include =20 int qcom_snd_sdw_startup(struct snd_pcm_substream *substream); +void qcom_snd_sdw_shutdown(struct snd_pcm_substream *substream); int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, - struct sdw_stream_runtime *runtime, bool *stream_prepared); struct sdw_stream_runtime *qcom_snd_sdw_get_stream(struct snd_pcm_substrea= m *stream); -int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, - struct sdw_stream_runtime **psruntime); int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream, - struct sdw_stream_runtime *sruntime, bool *stream_prepared); #endif diff --git a/sound/soc/qcom/sm8250.c b/sound/soc/qcom/sm8250.c index ce5b0059207f..203a8705a42f 100644 --- a/sound/soc/qcom/sm8250.c +++ b/sound/soc/qcom/sm8250.c @@ -21,7 +21,6 @@ struct sm8250_snd_data { bool stream_prepared[AFE_PORT_MAX]; struct snd_soc_card *card; - struct sdw_stream_runtime *sruntime[AFE_PORT_MAX]; struct snd_soc_jack jack; struct snd_soc_jack usb_offload_jack; bool usb_offload_jack_setup; @@ -112,36 +111,13 @@ static int sm8250_snd_startup(struct snd_pcm_substrea= m *substream) return qcom_snd_sdw_startup(substream); } =20 -static void sm8250_snd_shutdown(struct snd_pcm_substream *substream) -{ - struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); - struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct sm8250_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); - struct sdw_stream_runtime *sruntime =3D qcom_snd_sdw_get_stream(substream= ); - - data->sruntime[cpu_dai->id] =3D NULL; - sdw_release_stream(sruntime); -} - -static int sm8250_snd_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); - struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct sm8250_snd_data *pdata =3D snd_soc_card_get_drvdata(rtd->card); - - return qcom_snd_sdw_hw_params(substream, params, &pdata->sruntime[cpu_dai= ->id]); -} - static int sm8250_snd_prepare(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); struct sm8250_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); - struct sdw_stream_runtime *sruntime =3D data->sruntime[cpu_dai->id]; =20 - return qcom_snd_sdw_prepare(substream, sruntime, - &data->stream_prepared[cpu_dai->id]); + return qcom_snd_sdw_prepare(substream, &data->stream_prepared[cpu_dai->id= ]); } =20 static int sm8250_snd_hw_free(struct snd_pcm_substream *substream) @@ -149,16 +125,13 @@ static int sm8250_snd_hw_free(struct snd_pcm_substrea= m *substream) struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct sm8250_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct sdw_stream_runtime *sruntime =3D data->sruntime[cpu_dai->id]; =20 - return qcom_snd_sdw_hw_free(substream, sruntime, - &data->stream_prepared[cpu_dai->id]); + return qcom_snd_sdw_hw_free(substream, &data->stream_prepared[cpu_dai->id= ]); } =20 static const struct snd_soc_ops sm8250_be_ops =3D { .startup =3D sm8250_snd_startup, - .shutdown =3D sm8250_snd_shutdown, - .hw_params =3D sm8250_snd_hw_params, + .shutdown =3D qcom_snd_sdw_shutdown, .hw_free =3D sm8250_snd_hw_free, .prepare =3D sm8250_snd_prepare, }; diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c index 2e3599516aa2..a3f4785c4bbe 100644 --- a/sound/soc/qcom/x1e80100.c +++ b/sound/soc/qcom/x1e80100.c @@ -18,7 +18,6 @@ struct x1e80100_snd_data { bool stream_prepared[AFE_PORT_MAX]; struct snd_soc_card *card; - struct sdw_stream_runtime *sruntime[AFE_PORT_MAX]; struct snd_soc_jack jack; struct snd_soc_jack dp_jack[8]; bool jack_setup; @@ -50,17 +49,6 @@ static int x1e80100_snd_init(struct snd_soc_pcm_runtime = *rtd) return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); } =20 -static void x1e80100_snd_shutdown(struct snd_pcm_substream *substream) -{ - struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); - struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct x1e80100_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); - struct sdw_stream_runtime *sruntime =3D qcom_snd_sdw_get_stream(substream= ); - - data->sruntime[cpu_dai->id] =3D NULL; - sdw_release_stream(sruntime); -} - static int x1e80100_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { @@ -85,16 +73,6 @@ static int x1e80100_be_hw_params_fixup(struct snd_soc_pc= m_runtime *rtd, return 0; } =20 -static int x1e80100_snd_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); - struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct x1e80100_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); - - return qcom_snd_sdw_hw_params(substream, params, &data->sruntime[cpu_dai-= >id]); -} - static int x1e80100_snd_hw_map_channels(unsigned int *ch_map, int num) { switch (num) { @@ -128,7 +106,6 @@ static int x1e80100_snd_prepare(struct snd_pcm_substrea= m *substream) struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); struct x1e80100_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); - struct sdw_stream_runtime *sruntime =3D data->sruntime[cpu_dai->id]; unsigned int channels =3D substream->runtime->channels; unsigned int rx_slot[4]; int ret; @@ -149,8 +126,7 @@ static int x1e80100_snd_prepare(struct snd_pcm_substrea= m *substream) break; } =20 - return qcom_snd_sdw_prepare(substream, sruntime, - &data->stream_prepared[cpu_dai->id]); + return qcom_snd_sdw_prepare(substream, &data->stream_prepared[cpu_dai->id= ]); } =20 static int x1e80100_snd_hw_free(struct snd_pcm_substream *substream) @@ -158,16 +134,13 @@ static int x1e80100_snd_hw_free(struct snd_pcm_substr= eam *substream) struct snd_soc_pcm_runtime *rtd =3D snd_soc_substream_to_rtd(substream); struct x1e80100_snd_data *data =3D snd_soc_card_get_drvdata(rtd->card); struct snd_soc_dai *cpu_dai =3D snd_soc_rtd_to_cpu(rtd, 0); - struct sdw_stream_runtime *sruntime =3D data->sruntime[cpu_dai->id]; =20 - return qcom_snd_sdw_hw_free(substream, sruntime, - &data->stream_prepared[cpu_dai->id]); + return qcom_snd_sdw_hw_free(substream, &data->stream_prepared[cpu_dai->id= ]); } =20 static const struct snd_soc_ops x1e80100_be_ops =3D { .startup =3D qcom_snd_sdw_startup, - .shutdown =3D x1e80100_snd_shutdown, - .hw_params =3D x1e80100_snd_hw_params, + .shutdown =3D qcom_snd_sdw_shutdown, .hw_free =3D x1e80100_snd_hw_free, .prepare =3D x1e80100_snd_prepare, }; --=20 2.51.0