From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C30FC433EF for ; Wed, 1 Jun 2022 12:57:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352966AbiFAM5d (ORCPT ); Wed, 1 Jun 2022 08:57:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232460AbiFAM5a (ORCPT ); Wed, 1 Jun 2022 08:57:30 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A63FEE0B8; Wed, 1 Jun 2022 05:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654088249; x=1685624249; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=S9uisrdptfIPDkvI5rpbWpdm1zkgyzUYHlOlidzA01w=; b=vCLEhHpEWTCg/uNCZRW2n+Im5a0bFQhSsli6qKaj5+E0nXMFE2C68iZM wVUjNiioJz1tFFX3vEnvNdTOGe3KAQUT4ei7/dhsa+HZkG3YjhnVfN9Iy UphVGfuM/ZL9z3VlRh7ydi18EtV0nVMCNMQHZXpZkh7NZM+OYiLpVGNbe Q=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 01 Jun 2022 05:57:28 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 05:57:28 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 1 Jun 2022 05:57:28 -0700 Received: from [10.216.6.145] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 1 Jun 2022 05:57:22 -0700 Message-ID: <7c74868d-624b-c18e-b377-026e70813fcc@quicinc.com> Date: Wed, 1 Jun 2022 18:27:18 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v2] ASoC: qcom: soundwire: Add support for controlling audio CGCR from HLOS Content-Language: en-US To: Matthias Kaehlcke CC: Stephen Boyd , , , , , , , , , , , , , , , , , References: <1652877755-25120-1-git-send-email-quic_srivasam@quicinc.com> <51b8aca1-e038-4907-e973-ebdbebaf9b28@quicinc.com> From: Srinivasa Rao Mandadapu Organization: Qualcomm In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/1/2022 4:02 AM, Matthias Kaehlcke wrote: Thanks for Your Time Matthias!!! > On Tue, May 24, 2022 at 04:19:47PM +0530, Srinivasa Rao Mandadapu wrote: >> On 5/21/2022 8:43 AM, Stephen Boyd wrote: >> Thanks for your time Stephen!!! >>> Quoting Srinivasa Rao Mandadapu (2022-05-18 05:42:35) >>>> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c >>>> index da1ad7e..445e481 100644 >>>> --- a/drivers/soundwire/qcom.c >>>> +++ b/drivers/soundwire/qcom.c >>>> @@ -1333,6 +1337,10 @@ static int qcom_swrm_probe(struct platform_device *pdev) >>>> ctrl->bus.compute_params = &qcom_swrm_compute_params; >>>> ctrl->bus.clk_stop_timeout = 300; >>>> >>>> + ctrl->audio_cgcr = devm_reset_control_get_exclusive(dev, "swr_audio_cgcr"); >>>> + if (IS_ERR(ctrl->audio_cgcr)) >>>> + dev_err(dev, "Failed to get audio_cgcr reset required for soundwire-v1.6.0\n"); >>> Why is there no return on error here? Is the reset optional? >> Yes it's optional. For older platforms this is not required. > If it's optional then either there should be no error message, or the > error message should only be logged when the version is >= 1.6.0. There > are few things worse than a kernel log riddled with misleading error > messages. In that case, it can be done like below. Kindly let me know your opinion on this. if (ctrl->version >= 0x01060000) {     ctrl->audio_cgcr = devm_reset_control_get_exclusive(dev, "swr_audio_cgcr");         if (IS_ERR(ctrl->audio_cgcr)) {             dev_err(dev, "Failed to get audio_cgcr reset required for soundwire-v1.6.0\n");             ret = PTR_ERR(ctrl->audio_cgcr);             goto err_clk;         }     }