From nobody Thu Apr 9 18:49:27 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 A2FFA392C54 for ; Fri, 6 Mar 2026 12:22:16 +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=1772799745; cv=none; b=i1DUkTrzoXBBTeIXnwlw1panskOSJR6HkUUipHJ5vhAZva/t77hNB3upzDpdVeWGGErZqeDGvJqvZRgc9Tv6OZ1NwTJFYAD4JSaA60OkTEQmqnscmNaC4D3bDvLXpcYdjMzUp1fF7/SoUfz5NmtZpMzCz1GpOeEbzvbN9YEYpjs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772799745; c=relaxed/simple; bh=B8mb+C29aHmXpiZ0KkyuEWv+QuyMzs+RA8VA08jucnY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qJ/96GAiLRWUwurP1RJ0EOdg4uK0q4C4mcnx8bkfkI5Re79kDkofbTsLe6JemjK5YMW5BkHjVYh2QLO/gVwnSNloGqNu0NymhrudO3aNO5Fb/LNd8St+1Fy4havvKa54AjsmWXfGDrX7VHxe0AxY8RlVdTq7ta2pN9uqbYuKj60= 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=h9zx2upK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XFL27lFw; 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="h9zx2upK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XFL27lFw" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 626BauUJ864931 for ; Fri, 6 Mar 2026 12:22:15 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=aC+um2a762g fpLWPhHdIhYlAN3YczWO4vgnfj1X+hyE=; b=h9zx2upKPzxJjheBIJqXNAqxAne AIJvmnyGUIHvD9i16GUHja2k1z4Nww2tTonNnWYr6hh74K0/S4RRkRm338A98Zlq uoge84oru11xNzKyBOVtjN+ls8PcEw1LETfgLQOwzELgSgZR7sPOMUDnSMgmW+Wq bPg6si9E37Z639DD+MdjyFgHpefk2gh1G1JdKfPyWRlkCZUmQst+35tLRodpEZar r23oXYCioSFf2LXzg7Cm3Dj8fGWXBHqn42Kcs9W9FcRo+ULrFRcu7LXk6uqoQGcW a/qP1Wm/8vlH/DzITpJI5Te7UgI90zKyXlbyfjarH8mhOE26ySxCW0llUaA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cqrf5sc7u-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 06 Mar 2026 12:22:15 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cb52a9c0eeso6768311085a.2 for ; Fri, 06 Mar 2026 04:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772799734; x=1773404534; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aC+um2a762gfpLWPhHdIhYlAN3YczWO4vgnfj1X+hyE=; b=XFL27lFwzV/tY5/OFor8j/JNkUHrEAGITzKfOW+SPeizBURqumZY+7y/0nfuwFTPHt MB9TAHOB038mye/0esAXBEdb0FzxJT2Ucq9aL1s+Dk7ilCgVlaYn2Rvn8VGUlIH8Ql0s o+dUDTBtJAwQbGTEwBvMv0yTh/CHtXmeCE7OmTUvas88OXSsBtsN6Xd8tnzEp9SMHD2n iWq+YCn557ytcLxsR3YXoHiJMkFV/4qtu4uvqou59+6yGlVsJ6D7Ijh29PI1JJc9GCYs M3zX2+8D56V/wGlzA3DdIj6mE3J3ghr5uShQXUGyupRMS3GN3o0SJqTxQXkPvzYjHbIr UGew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772799734; x=1773404534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aC+um2a762gfpLWPhHdIhYlAN3YczWO4vgnfj1X+hyE=; b=CTAa5VmrHvlDqi5tq2cIP/RVlci9wJlddfTmLOTEKc/xunl7LYBZYIe/N0nujGV9ks op9fjB+ORrMQ6ES1/chBNSnBhLyF2iyWiyU70Usu9hfgUn4E+6jRT2cYTpm8ck86RBHI Cl7mSVdULAph6b60zIT3NUsaaW0TmkzsMI0zIyICHc49baO7QEw+QJ8SUWJks5lWSy0Z R83ED1YUV8su1GykxYx5vsVV3RHEF+G/5gm0pefkuUJJgJaTfSeWC/InpXmEdxlF28rU 3TJd3PBBaDatGtKFxWI7vEEmiMJcPU1qhDyv76nPNQn5aLO+z4MGAVifNOr9JN/069wy b1KQ== X-Forwarded-Encrypted: i=1; AJvYcCVraHozu88TLaFcmw4BUhShNYzrZ7eWrHJLvsJnejNyhb+0IULlPPWCTkesQ4/v5zat7jjct2q47q1RfW4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1+i/zApDmXLyoYBwTNqP6Bq4RF9VUcw97o9ria6t/V1G+fJgp NOIEepEabARWrToqE5H32ic5pCsTRDLsZ2T/eerWcFpvd4dPG9NafTXd3mz3YR4ZkI2/ZdgpEPy AsH1SMtwJfASMKgM6/I8LbvOf+G0cgno/8fW4MX50kfSV9TgK1IZEpqrqcXnT4yNyQuo= X-Gm-Gg: ATEYQzxauMdgUBxzaxGqgFsKRhEmezxJ4i4vWdLWjsW3HrnWPH0hxF2Iv2nu0Qz4tmc eqhlmI/SMGZ2vm0xx4i6rJfdJIXogKHhF3YivOZD1vVSCuw2r5UtA9L9Lw0jWNGw4qio3EwSVhw lSTw1bIr/wCONlUGYb4sEB24Qc/x0WB0VBUxxrMVtG0+qkXBVW94LNPlwhxERDfaZ4gflHGxxtW Ar3GFV1RrZwxM1oU+jIx6e0IaKzK3lRBUY9Wvw+J52Jy3Xcn9TPWQVg4kojesCP1if+4iv+6eBu W9ngyXXGWcjwacO5hXPDCFIKfSCVkdCuwOixxOwsTlM+NmFDBDYhO2iXU/GO08qe0TDGetBdoxn 9TwDS6aiXm4rcuXXb060uGbaA7Vzbst1LW8Y3+3o8FoH88dLmBjF3VqI= X-Received: by 2002:a05:620a:7017:b0:8c6:af59:5e28 with SMTP id af79cd13be357-8cd6d411a4fmr237571585a.22.1772799734469; Fri, 06 Mar 2026 04:22:14 -0800 (PST) X-Received: by 2002:a05:620a:7017:b0:8c6:af59:5e28 with SMTP id af79cd13be357-8cd6d411a4fmr237568585a.22.1772799734049; Fri, 06 Mar 2026 04:22:14 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4851fa87e56sm111972395e9.0.2026.03.06.04.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2026 04:22:13 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: mohammad.rafi.shaik@oss.qualcomm.com, linux-sound@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mailingradian@gmail.com, Srinivas Kandagatla Subject: [PATCH v4 11/13] ASoC: qcom: q6apm-lpass-dai: move graph start to trigger Date: Fri, 6 Mar 2026 12:21:13 +0000 Message-ID: <20260306122115.509705-12-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260306122115.509705-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260306122115.509705-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-ORIG-GUID: qZb-hHnWcKkRzlIbECE2HWJjJJKYfp-O X-Proofpoint-GUID: qZb-hHnWcKkRzlIbECE2HWJjJJKYfp-O X-Authority-Analysis: v=2.4 cv=L+oQguT8 c=1 sm=1 tr=0 ts=69aac6f7 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=8udmP7N65bQo3KbB_RsA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA2MDExNyBTYWx0ZWRfX2f9id2Y0Z2Tn nVn8OohdXzBBYIUrRcwMLFlfQJcJ+TyCXUHXTW9ECMWEndOWtQduv7g4sVgXhgLN3A3HrifY9G0 9UdQeeWJxwyinAnUbk/rtcRg+74M45jSaDSvZQqTO6Nt1mkU+TqKgwWwOcTGxlV+zQSSCF4Fa4N O1czcKzV6IA9Jb3ralEhFD0IgNrrrilYjs9xFKUYnTxDSbOzPWJ6GWQ/eRG+p7mnBn7iX6NoBS4 bNTC4pzuTdlGGDSSgKk/NbBE756gJtfNBWLieTbkYyBzUQ3XHTz5naLD6Ba7U7uNoEyuJqgFs1C JZimrSADWlObF9PoKKk8FypbkfBScfmQF45hoLeIf1RriCAK8rMjvy4cTIrEMalq/7VDWlSazmt 2FvwXOREL6uhBPJnQx22Bk6ASMV/1VWuy0LRnMrjYrMVhPTgZp3jMtXtgKqq92X9aEXF2GdmTiR 0yjRG7GihSpiiEtMXJg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-06_04,2026-03-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 priorityscore=1501 phishscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603060117 Content-Type: text/plain; charset="utf-8" Start the graph at trigger callback. Staring the graph at prepare does not make sense as there is no data transfer at this point. Moving this to trigger will also help cope situation where pipewire is not happy if display port is not connected during start. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 40 +++++++++++++++++-------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6= /q6apm-lpass-dais.c index 472b2114c81e..70e283671f43 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -159,6 +159,31 @@ static void q6apm_lpass_dai_shutdown(struct snd_pcm_su= bstream *substream, struct } } =20 +static int q6apm_lpass_dai_trigger(struct snd_pcm_substream *substream, in= t cmd, + struct snd_soc_dai *dai) +{ + struct q6apm_lpass_dai_data *dai_data =3D dev_get_drvdata(dai->dev); + int ret =3D 0; + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + if (!dai_data->is_port_started[dai->id]) { + ret =3D q6apm_graph_start(dai_data->graph[dai->id]); + if (ret < 0) + dev_err(dai->dev, "Failed to start APM port %d\n", dai->id); + else + dai_data->is_port_started[dai->id] =3D true; + } + break; + default: + break; + } + + return ret; +} + static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, st= ruct snd_soc_dai *dai) { struct q6apm_lpass_dai_data *dai_data =3D dev_get_drvdata(dai->dev); @@ -171,10 +196,6 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_subs= tream *substream, struct s q6apm_graph_stop(dai_data->graph[dai->id]); dai_data->is_port_started[dai->id] =3D false; =20 - if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK) { - q6apm_graph_close(dai_data->graph[dai->id]); - dai_data->graph[dai->id] =3D NULL; - } } =20 /** @@ -203,14 +224,6 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_subs= tream *substream, struct s dev_err(dai->dev, "Failed to prepare Graph %d\n", rc); goto err; } - - rc =3D q6apm_graph_start(dai_data->graph[dai->id]); - if (rc < 0) { - dev_err(dai->dev, "Failed to start APM port %d\n", dai->id); - goto err; - } - dai_data->is_port_started[dai->id] =3D true; - return 0; err: if (substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK) { @@ -254,6 +267,7 @@ static const struct snd_soc_dai_ops q6dma_ops =3D { .shutdown =3D q6apm_lpass_dai_shutdown, .set_channel_map =3D q6dma_set_channel_map, .hw_params =3D q6dma_hw_params, + .trigger =3D q6apm_lpass_dai_trigger, }; =20 static const struct snd_soc_dai_ops q6i2s_ops =3D { @@ -263,6 +277,7 @@ static const struct snd_soc_dai_ops q6i2s_ops =3D { .set_channel_map =3D q6dma_set_channel_map, .hw_params =3D q6dma_hw_params, .set_fmt =3D q6i2s_set_fmt, + .trigger =3D q6apm_lpass_dai_trigger, }; =20 static const struct snd_soc_dai_ops q6hdmi_ops =3D { @@ -271,6 +286,7 @@ static const struct snd_soc_dai_ops q6hdmi_ops =3D { .shutdown =3D q6apm_lpass_dai_shutdown, .hw_params =3D q6hdmi_hw_params, .set_fmt =3D q6i2s_set_fmt, + .trigger =3D q6apm_lpass_dai_trigger, }; =20 static const struct snd_soc_component_driver q6apm_lpass_dai_component =3D= { --=20 2.47.3