From nobody Tue Feb 10 01:31:22 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 58BA234C9A4 for ; Wed, 22 Oct 2025 14:34:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761143648; cv=none; b=TXZ/d6PUjf4vBSURKvzBKP9YX8y2dBY2PztOYDAVcQxTxc6/uZEVGZxWJGs3ugX1G8jC5iSyBw3FpDSH7l8v7MDAuafDaob+ZjytjLeDYbtJ+fiVHKLKlv9JInog9MQnLvY/LJwS6AO/GgHkl5BXq5hSF4LSDmUtFcof270Y3zk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761143648; c=relaxed/simple; bh=aOzzSQvUu2O5D1NhZxoqCv1Pu8jkho1TPDsFdKGqrVY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dQhUIqhHgZP1ulMAJXrIadQ4tyBPyyMS65aHXmKTArj+HQMWcB27eyvmVPOJdVJ6HXYEQyMfi41rkCU0DyzxFs5U1BN76lKJgGQ1Y+ghOnsooLRVs8a+N0a53ETOxHVsN7I8oQH+21z7tZkx+gWy3F9kHSq5HaG7qcoROwIRGg4= 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=ULxR1EnE; arc=none smtp.client-ip=205.220.180.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="ULxR1EnE" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 59MBe5MZ029822 for ; Wed, 22 Oct 2025 14:34:04 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=tt1tRxJzz9y kCOmzfidVBNfag/M4e8YRcu9Y0ig1KZ8=; b=ULxR1EnEz3XALQpDgOHrTa21vf8 1Us42ElgjTZXgmj8KBMQOwmbl7ke2ZiPYH+aAFssTw6Fd07LjfvDG78BFPQBs5U0 k2BADxc6Q8KmdBIwqhd/SqKd2Nttw7Bx+4YwZajB05hLNEvL337ercPkBq8h6PrG i1ba/c9MEmEnulBzg+ivuGpmt04niBjtd66sNkqMtVdoqTnyapm6PMcEkcitICmv tKS+EE5qExGiw1Dyx/QUHPGENWvM4aFeYVVpI4N2zyrRANmfmmDBB7tKNQmQVuuk nYvyzPBgxITWUXj4bBzt1Mt+l1fhM4w4eai8LEGllQID81/k4hiIVHZJmiw== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 49v2ge4x1c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 22 Oct 2025 14:34:04 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4e8a3d0fb09so17712091cf.1 for ; Wed, 22 Oct 2025 07:34:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761143643; x=1761748443; 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=tt1tRxJzz9ykCOmzfidVBNfag/M4e8YRcu9Y0ig1KZ8=; b=GXjSDXMvcY4QxTrGWKbUKEMnKPoJjkVW2q5omlzanNXU5thUdMrXUgI08XfjG/JdBw hm1bLHCpjqv4st+frzKEZWuXrtWpBjIwTCdGwBp1mwKeJpUI4oMYkQWCgdb5nlDRj+XM ZY/BNKu2eZJ3Ak/cXEWOMek0kP3TlKIjP9xN/y0f4ZMuSxT0mANYuydMe1N4gXQ2Qgxv hGGP0jmD05n7mnVS4LTHvbIV4wZXY4BGDLNIOVftE9LCPJnqeqgQDgUcma16upHyfKsy hJw3byvVpmolBTxrIomb/DbCzwwIKhnoT7sKvSnFN2btSUPad5PEjqTCsq+Y1GDBNgCn v0zw== X-Forwarded-Encrypted: i=1; AJvYcCXwvy4chadf3eWtEuOzqi6b1gBpuLeTA9FvmkSBK7Xv3aTBIR0j0ziz+UTd2ol4z8P4hBRGFmUmopzek/o=@vger.kernel.org X-Gm-Message-State: AOJu0YxjQuTvmBJNGoxi9t6+tn6/fRpYbKScjqzDhAYvbRLkkRnW2vLw Hn64N+fBEIVcOF8JlhByRdEh9DO7uTiShzChVG9NxJgRdo2QT/ZZwLPROQ3Nb55F0vQZpn4/0rh 3erZL6WQqs7icZsJrNzNwukO4Az5VL9M/anyL6cXMfYP7PdefW3AQX3p/r5RgI5W4jvw= X-Gm-Gg: ASbGncvOIHKvA9TtRjdTTeOEu744pBHDrfJX8bKnOUEQRctpPz604zC0EE/MnsixBk8 DxbdIHMS4qiq3Rk+eD1Xe6KpJOy6PsDKWHspgoqlxnckLLimFe+cs5KvpL8jIsRCoZGj9cY6Zhl 9WbYc1WnL3ExmZbe96bLPKL+XK7Vc6Qx4Q0gc6EAepFxpuIGYQmYUQLjF6g/+jX8c+h2KEqAloR Sf8SG+Wp6fEbXe4yTDmb72w3+wY2gXQA3fo7xUFb+NQR0K0K4Ed6qKTMR0Z/xHObzhN8sZNz6+e j8O4ATup9WcePvsjr6LPG/Z2vEQTkfc3C6nuoQ+Lr/NItAU3bfDkv36+4pvCNqLRIz0XpUYhaTX b+DZK46bTXrWH X-Received: by 2002:a05:622a:134a:b0:4e6:ef26:3152 with SMTP id d75a77b69052e-4e89d415399mr269121091cf.80.1761143643156; Wed, 22 Oct 2025 07:34:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8Ohog4sO13eIB5GYi1WdYITJtgbxhmIZljiPYyETzVJdhdvKK1Z1JdxJ27Gt2pJLJCUyMlQ== X-Received: by 2002:a05:622a:134a:b0:4e6:ef26:3152 with SMTP id d75a77b69052e-4e89d415399mr269120481cf.80.1761143642465; Wed, 22 Oct 2025 07:34:02 -0700 (PDT) Received: from debian ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-427f009a993sm25544910f8f.24.2025.10.22.07.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Oct 2025 07:34:01 -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 , Steev Klimaszewski Subject: [PATCH v3 2/4] ASoC: qcom: sdw: remove redundant code Date: Wed, 22 Oct 2025 15:33:47 +0100 Message-ID: <20251022143349.1081513-3-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251022143349.1081513-1-srinivas.kandagatla@oss.qualcomm.com> References: <20251022143349.1081513-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-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE4MDAyMCBTYWx0ZWRfXyAIfhkV2aRU0 BvSYQLo39DZxCsLwrsFpuKehhjoSbgJZuW0YNHQIkzIyJYxlGGpXypKwtHAWvKcC3CmMSyYreHx vaGqj4DMJyaxizmjGP0/A9faTY80tSHnYAyRkUk9iXsTwAAMiPhkvxSBFOo7CibBwvnM77a9u1X jXRpNeofhGM4YIxtGU05dmrM2NTPKtVaNwXEnFHbNgnGmXqIVNkK8vbP4PHVKiIlQbOrGbzHRyJ QT0dG1D2LjaK+6r8Hh3961jWnELDOqWWbg4YDhHQVph2iua8UR6i8IeTXG1gzkbqKr/QQmEEzOL +i+QKxdGo7Sr6gXioLcL5PyTodbAxxv/eny1eeWHoEW+XVBZMxKIhNO4dKiFMcPBOTqSYSgC8Cl 5I5DO4Cs/Q2j5YOPioTHB2JmIuYTCA== X-Authority-Analysis: v=2.4 cv=KqFAGGWN c=1 sm=1 tr=0 ts=68f8eb5c cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=pGLkceISAAAA:8 a=eS8ScSGqROhw0OgIVi4A:9 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-GUID: DhiOW6IbYfuVNRudtuaQ4It-TGqGtK_- X-Proofpoint-ORIG-GUID: DhiOW6IbYfuVNRudtuaQ4It-TGqGtK_- 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-22_06,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 phishscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510020000 definitions=main-2510180020 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 Tested-by: Steev Klimaszewski # Thinkpad X13s --- 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 7b2cae92c812..c44659deea01 100644 --- a/sound/soc/qcom/sdw.c +++ b/sound/soc/qcom/sdw.c @@ -113,19 +113,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 @@ -172,26 +174,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