Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15478394rwb; Mon, 28 Nov 2022 12:05:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf7S5lAU/6ZukACHf25o+3uNe9aMPCHLAKwi53WKGE2kbQv0UhiRHKND8+7Xg/wg92FSjJa/ X-Received: by 2002:a17:902:f78a:b0:186:5bbc:2ad9 with SMTP id q10-20020a170902f78a00b001865bbc2ad9mr45888303pln.157.1669665904385; Mon, 28 Nov 2022 12:05:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669665904; cv=none; d=google.com; s=arc-20160816; b=FcHIOOXvgXvqrW0wVrVEa2q/Aid5yQyvoCawyt4yGHgoJxiNjmQOCNWaGC1/nhm/0u KpdNj/fZr831HxpM2z53BXj0HJKyFWlkmz64gDxxA8rUYRrlOLOAWxS/IMVhoWWOgywC 42W89wCGwvQtSJkkRwlhAOgLVVlDdqXbUOU7SMgSn9Jt65hXyNMRug6SAXesLEeQ27HF LCj5K4c6GI/Ep6nr3aPDw16EpveGcSH3ZfR2B8ViANk6hKV/+YJiffhuqcZUB037ptei tTy1H0i/yC4hTxNZ46GELbtVu+0ThMmtfH/xq11mhX/Q2urcLQDnPummscDMoKWWo8gN uvlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=1X++ZaligKAG6LkPIexjBiKopBxcNHqsvb5zqb0R6nA=; b=GJ8zEQq0xP7RHS9XIkmx3fHZDdbAo1p5E+cSAkUCMBCpEuNas5IgZNYm87xU9TbQhn DR2inrs/PLjQ+KgqVZkuOVDSJ9wKZ+wwcJzf3x3eWG0C0ztCG2j1yweIFtbmHdyVcXV+ /91QAOWuta3SnJgmiXSW0KMaqZvQChviCAVrf8mDjdojLosDuYaCBZHIw9ViSY3ro/cl rX6dLfJ5RNRNQ9mO3gKA7CcJ6KqLosi3tDkR6WPy2j2TjPAOhoKfzpbZKFzSWlJCQfSf 3nSMBKEl7y2prm/ejtA3lqRX+Ha/hf9TDCdbr+KBQRd7mdtR5/crPAkBXOySsLrHfD99 JrdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iNMVlHUs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk3-20020a17090b4a0300b0021870b9d3c7si14290870pjb.45.2022.11.28.12.04.50; Mon, 28 Nov 2022 12:05:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iNMVlHUs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233230AbiK1TkR (ORCPT + 85 others); Mon, 28 Nov 2022 14:40:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233167AbiK1TkN (ORCPT ); Mon, 28 Nov 2022 14:40:13 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD2D92C125 for ; Mon, 28 Nov 2022 11:40:12 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id r12so19108371lfp.1 for ; Mon, 28 Nov 2022 11:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=to:subject:message-id:date:user-agent:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1X++ZaligKAG6LkPIexjBiKopBxcNHqsvb5zqb0R6nA=; b=iNMVlHUsjwLrJrks1vvhHe/Geot63a1ksPxeCQISSqZ5aiG1tgo4oa/KdGa57JHE/I eijJCwMYSV0g3fUD/A5aYsouMPOtpihSAoBEes0tXXhJESjomdESVMMuNeSegOkWGIJS vlh/kTi5uVAuV119WsBjOQuIPe0NIRmODt3Ek= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:user-agent:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1X++ZaligKAG6LkPIexjBiKopBxcNHqsvb5zqb0R6nA=; b=BOZPk7Ma/ABbXKYzKw7A3wYI1mGsXLzGd7z5ccsj5ISY4AjjYc/YkVd+T9n2Wq15q6 kOTI+gL72A53Yg4aiAfR8Ais1vJHtKPG4VuUi9k1CCQbsX1pySvO9WEBTmNT7SJMbJmv sr3pHKSGNpHGfDhRiWbb6bqBaXSWzKmYhyBusdWOH0SVCtSmUpIAPHNZquNxZrk8YyMH XLMIkzVke9nble2OsnHT8Yr8E2gQd1F3NWw55P/jiw9UA1w9GGdQY5B8ePL65XbWa6XL 09zHGL0skPU8klxqoPN2gYR1V3dMjcAc/su+NHUEvsbN2Tcmw1WxU3Gs3bk0H1yG7mr4 Vmbw== X-Gm-Message-State: ANoB5pmcHjPYaBFcbj5z8kGinW0UDGXbaBvZ/OFukTKCHKPAMkMXWodi 7Y2sTATkewGCDHEUoRMBTMqY06neU/uper8LCfCziw== X-Received: by 2002:a05:6512:33d1:b0:4b5:1c86:9267 with SMTP id d17-20020a05651233d100b004b51c869267mr1501925lfg.297.1669664410971; Mon, 28 Nov 2022 11:40:10 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 28 Nov 2022 14:40:10 -0500 MIME-Version: 1.0 In-Reply-To: <1669621742-28524-1-git-send-email-quic_srivasam@quicinc.com> References: <1669621742-28524-1-git-send-email-quic_srivasam@quicinc.com> From: Stephen Boyd User-Agent: alot/0.10 Date: Mon, 28 Nov 2022 14:40:10 -0500 Message-ID: Subject: Re: [PATCH] ASoC: qcom: lpass-sc7180: Add system suspend/resume PM ops To: Srinivasa Rao Mandadapu , agross@kernel.org, alsa-devel@alsa-project.org, andersson@kernel.org, bgoswami@quicinc.com, broonie@kernel.org, devicetree@vger.kernel.org, judyhsiao@chromium.org, lgirdwood@gmail.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, perex@perex.cz, quic_plai@quicinc.com, quic_rohkumar@quicinc.com, robh+dt@kernel.org, srinivas.kandagatla@linaro.org, tiwai@suse.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Srinivasa Rao Mandadapu (2022-11-27 23:49:02) > Update lpass sc7180 platform driver with PM ops, such as > system supend and resume callbacks. > This update is required to disable clocks during supend and > avoid XO shutdown issue. > > Signed-off-by: Srinivasa Rao Mandadapu > Tested-by: Rahul Ajmeriya > --- > sound/soc/qcom/lpass-sc7180.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/sound/soc/qcom/lpass-sc7180.c b/sound/soc/qcom/lpass-sc7180.c > index 77a556b..6ad1c5b 100644 > --- a/sound/soc/qcom/lpass-sc7180.c > +++ b/sound/soc/qcom/lpass-sc7180.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include Why is this include needed? Did you mean to include linux/pm.h? > #include > #include > #include > @@ -156,10 +157,34 @@ static int sc7180_lpass_exit(struct platform_device *pdev) > struct lpass_data *drvdata = platform_get_drvdata(pdev); > > clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); > + return 0; > +} > + > +static int sc7180_lpass_dev_resume(struct device *dev) > +{ > + int ret = 0; Please don't assign ret and then assign it again. It hides use before true assignment bugs. > + struct lpass_data *drvdata = dev_get_drvdata(dev); > > + ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks); > + if (ret) { > + dev_err(dev, "sc7180 clk prepare and enable failed\n"); > + return ret; > + } > + return ret; This could be simplified to ret = clk_bulk_prepare_enable(...); if (ret) dev_err(dev, ...); return ret;