From mboxrd@z Thu Jan 1 00:00:00 1970 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 3FEB23DEAC0 for ; Mon, 15 Jun 2026 10:11: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=1781518284; cv=none; b=pO87LbCdMWiCjqXQwKsodpWQWCih27HURKyfD18n7lW3sqs/qfUJMyuKmQkD+abf3e+CWM21LB8Bg4fiVMwq2JEaXPRte4Jzym4WqNz3Yv84ErkosfTAlrd3GRmZl8AtlkINZgrdMEvU5FGCXRXeFbK7hr+/r+Ccyf56pitJAqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781518284; c=relaxed/simple; bh=/zOHwIGCQ+Bi1+cBLDzzvGTtXR+/DvBkXBf6mgW02Ks=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=La34GQjUtBmb24S5J5rDhfT0RXPillIBVcuL8dFymm7oCds4SFXCp+8QDER+kPjmhCUQFoDxOSITw1y9n3xQ+ALcl3pXvLtEbunMdfSxDhrHJlIHPpYrn7uUQBotpYDOyzzxFKi3GiLRTkYPBkImoo7a02xuGFD1+tbN99k4m0I= 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=OlsDlzzA; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Ttu1GejZ; 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="OlsDlzzA"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Ttu1GejZ" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65F9OTAm101629 for ; Mon, 15 Jun 2026 10:11:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= KsEKd6rZSPjuURj1p8f4rx+xTzM/nFADArhjJGwK24Y=; b=OlsDlzzAGoNZvBr+ YHTvwyjBvuNxgCQY4IuwkNUCR8LfcEM+TV1NBHa1qnECdh4W1jGBRzZlqJMDt8t3 rP4yEaL5PakP8I76H0+1C5FZbhfVROS8lUIfQpoC4gqBVItReHroyC7W8bpgXXx7 +TnMeBj7y4M/ExOTQXqUPtQXYtQFMIHZEozTdotapREvwxlUaOhPnqOTYeOciPZr UAB6sQ6sfHhA/ShU8cEaEURbeQYcnhLOZOcEoMgTew9W60hVsGLRbcCbijKoSrWj RV8w0V5DTwOK5ldmtKk3NlCW+7Ucur5HJbdl7I/ojqGvc7icQIYr8IV2v4rjLE1A GBJnhw== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eter205y0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 15 Jun 2026 10:11:15 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-36b982ec27aso2337303a91.1 for ; Mon, 15 Jun 2026 03:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781518275; x=1782123075; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KsEKd6rZSPjuURj1p8f4rx+xTzM/nFADArhjJGwK24Y=; b=Ttu1GejZGy5/at4+ebjLZ/m4/H/unZp+lwKwJjE9vw4ijN6JoknM/lqNi5vObcPx98 b/jWFWqQ1+RQSFsWn72EeEsU94zn7vLbuQwGWbwiqyYrrmzNC2MoE5ualKCsy3GIRIii PRMxgpLwG1AlZk9EYG3Z6N16nA3p28OwaWORJxRJH06DDS4tvDFfXIavZ0HjsF0nU7Iy NoOQWXfRlEfhUzF+mShSinR9aCaTqnfERZBpCu1xBZq4NhxrVRUBiNA6UQfM6L5SpHQs LxjFwSkPy17mSW7oCx0XFb9xDikaP14qA2hv+mq0D/6Ufjc1wngAcV+BQ0pl4zWVWFUK nTUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781518275; x=1782123075; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KsEKd6rZSPjuURj1p8f4rx+xTzM/nFADArhjJGwK24Y=; b=leTqvt+EI/NqR6wRmbkuING9F3V8+Kyojc+Bya3M85JocNbVPsbCylY0JG93JRHPms iX+7QPSN6AsYkqT2HNyYYYuRfOe5ipokW/fZvnmQNYNrYJhg55TOb3NzmNVXMBlQYQCJ +n49+EYM4J2kFH+U96UtvtxLc4GHQ9CJLeEbIE+L/s7io+y4ABV5uBxiHCtLLLcpFQVd w1utVIUh3sluI2CRI4p9tY+Eoh9XpWSoewF6fcZ9tDGmP7x7PYsYirW/p1xU3SzIGYZA eIF8b18AOyIaU7wGTbqUAYp/F916PoDIOINxTSkKH2M9Z7DgiB4TCGu7DnYtInaq8kDi +cZA== X-Forwarded-Encrypted: i=1; AFNElJ+K+3lWMLKDpsOxQ+DsFbY6n58FB33awH73Lhcomz8BmUrjjxfb1xdjLI+f+NOt7ivz98Pbrx0Q0EKXczU=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0uZXuK+FkPJvmeTNudDHM4/XsTdUyoOz2oO9PwpDuOQDm+pvt jfw6E54PzElu9sUc6+0oU8oIh+BGA9EIFNt6S/sCYFU13/RvoiY/ENqT7Vv1NGFinPXWZmNqjkb /re5cdRhrcZEbDC0wVRj73LmIAQi81dAmc2FWRtUBSBDpn8B6Hu036nlzxQKv2fV61MQ= X-Gm-Gg: Acq92OETLneCa4bm6s8jJlCwGFGu5pJ1ekG28nxMZE/ytldHjMjN6b0CB8zg4EWQw+3 t0YwHB03gJElGCtqco6GkaSH+0tGAyD6Pn322yVQjJ9HNmmdrXQ8IyFYOt2wLWhCEBTNnqJaNiL Mv6xvpIlR2IrQpUgFzxecS6RkfpMq8J1dsEG83jZ7pWYyJA4/tcuQsG0fzqUvt4uf0VRrHkOjxE ISeIYFGkhGGMNHDFLLLvBd2pcf4UqQwvdgPBIwBJ7sch/z0hmPyn8h2VkWyIVAzDYyaLP1s4vKU KCsIUYdWcWzeGxwZmjY2DlKk71f8G+uU7FDCx6gyZsfgriZc5pCsjtoDPhYfRTK0Ey0G13GUSoe Yqab1uECuk3lQjgGWy+k7TX6fhvIyIGYpBursoe5JY/gj7uiiszZK9UFdrya2 X-Received: by 2002:a17:903:198c:b0:2c1:d49c:8397 with SMTP id d9443c01a7336-2c66416326fmr100240065ad.12.1781518274946; Mon, 15 Jun 2026 03:11:14 -0700 (PDT) X-Received: by 2002:a17:903:198c:b0:2c1:d49c:8397 with SMTP id d9443c01a7336-2c66416326fmr100239765ad.12.1781518274489; Mon, 15 Jun 2026 03:11:14 -0700 (PDT) Received: from [10.218.21.154] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c42c43543asm97760195ad.0.2026.06.15.03.11.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Jun 2026 03:11:14 -0700 (PDT) Message-ID: <53d0c41d-2455-4df7-b535-1a540c512913@oss.qualcomm.com> Date: Mon, 15 Jun 2026 15:41:09 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] ASoC: qcom: sc8280xp: ASoC: qcom: sc8280xp: enhance machine driver for board-specific config To: Mark Brown Cc: Srinivas Kandagatla , Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260608023011.942228-1-mohammad.rafi.shaik@oss.qualcomm.com> <20260608023011.942228-4-mohammad.rafi.shaik@oss.qualcomm.com> Content-Language: en-US From: Mohammad Rafi Shaik In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE1MDEwNiBTYWx0ZWRfX0IfxHspoFEX6 dBgAiZh2U94dL9auUPGMx9zdEsRstoGsBjbSa4jIjFg0uyt2p0UJ1YMemyAEgoQZJz8SGWl0pWh DIR8nLwXgGrJ/Q464qXvaqgqrQ+bwGU= X-Proofpoint-GUID: sHSUgcM6wUP9CnzhMp8nsN47u0yRKtAq X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE1MDEwNiBTYWx0ZWRfX6ZeAcxCg0e59 gKRtZA6UB1+vwNpbk/DYS4RT23s05aK7FBHIKDcCKeFcJQySM+JBdwxNv8oz6HqbS5qD/J8l2Nc s7Uv0CiSG0jkbbsPYvuZqwknrsWNzJZE3DJ75YUqJRC26/0uvglOwg9EA3Ggu6b1nAgttKUCjxD nnCovtKH6dr7ih70kQu0cRcaUgRrCeLHjYH0xy9f4l3bnJ9/r+wg73WOQyUGegzvokWLbq9lFby MZbX+5X34HupofMDmznAtKuG6xoQHB+eSY/3ASUW/QG1IkGBjm9ZllmT7OmZ2Wxg3+Pbt9CP0g7 OLxiAtBT0ZWdxEF5/wzjEl8z8qiiZh+F+H/TNlo9aewUtswJ1Tb6/Ue9bVGZ2vUTd399oL+XE8+ J+BQj7ZAlz8a8NfJP4hgxH+IMeeSNn/VfxwEslyMaSlRR8fwKnxTyzxlh+dRJuItHcME34eGmRg yri4gRwEiLudLwvnC2A== X-Authority-Analysis: v=2.4 cv=F4tnsKhN c=1 sm=1 tr=0 ts=6a2fcfc3 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=YMgT65kl-x7urRY1OA0A:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-ORIG-GUID: sHSUgcM6wUP9CnzhMp8nsN47u0yRKtAq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-15_02,2026-06-12_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 clxscore=1015 impostorscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606040000 definitions=main-2606150106 On 6/8/2026 5:38 PM, Mark Brown wrote: > On Mon, Jun 08, 2026 at 08:00:11AM +0530, Mohammad Rafi Shaik wrote: >> The sc8280xp machine driver is currently written with a largely >> SoC-centric view and assumes a uniform audio topology across all boards. > >> +static inline int sc8280xp_get_mclk_freq(struct snd_pcm_hw_params *params) >> +{ >> + int rate = params_rate(params); >> + >> + switch (rate) { >> + case SNDRV_PCM_RATE_11025: >> + case SNDRV_PCM_RATE_44100: >> + case SNDRV_PCM_RATE_88200: > > rate is in Hz but these are bitmasks. > Yes right, thanks for pointing out. Comparing the sampling rate value from params_rate(params) against bitmasks like SNDRV_PCM_RATE_44100 is an error. I will update the switch-case to use literal frequency values (e.g., 44100, 88200) or appropriate rate constants to ensure the sampling rate is correctly identified. >> + return I2S_MCLK_RATE(44100); >> + default: >> + break; >> + } > > The function only works since it ignores invalid values. > Ack, will fix in next version. >> +static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream, >> + struct snd_pcm_hw_params *params) >> +{ > >> + >> + if (data->snd_soc_common_priv->codec_dai_fmt) >> + snd_soc_dai_set_fmt(codec_dai, >> + data->snd_soc_common_priv->codec_dai_fmt); > > Should we error check the functions we call here? > Agreed. I will add proper return value checks for snd_soc_dai_set_fmt and snd_soc_dai_set_sysclk to ensure any configuration failures are caught and reported during hw_params. >> + if (data->snd_soc_common_priv->mi2s_mclk_enable) >> + snd_soc_dai_set_sysclk(cpu_dai, >> + LPAIF_MI2S_MCLK, mclk_freq, >> + SND_SOC_CLOCK_IN); >> + >> + if (data->snd_soc_common_priv->mi2s_bclk_enable) >> + snd_soc_dai_set_sysclk(cpu_dai, >> + LPAIF_MI2S_BCLK, bclk_freq, >> + SND_SOC_CLOCK_IN); > > Is SND_SOC_CLK_IN right here? The flag sounds like it's enabling the > clock on the DAI but this is configuring the DAI to consume a clock. Good catch. Since the CPU DAI is providing the MCLK/BCLK to the codec in this configuration (Master mode), it should be configured as SND_SOC_CLOCK_OUT. I will change these to SND_SOC_CLOCK_OUT to correctly reflect that the DAI is the clock source. > >> + if (data->snd_soc_common_priv->codec_sysclk_set) >> + snd_soc_dai_set_sysclk(cpu_dai, >> + 0, mclk_freq, >> + SND_SOC_CLOCK_IN); > > This is configuring the CPU not CODEC. will fix typo error. The call should indeed target the codec_dai when the codec_sysclk_set flag is enabled. I will fix the function call to use the correct DAI pointer. Thanks & Regards, Rafi.