Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6997891rwb; Tue, 15 Nov 2022 06:28:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf5CwAetTbyxy6gODAG4OPPzuHNN8HCv+GN8oj0V7zjoYQXYuzt+sqevKRDDmEj+EpbOFykU X-Received: by 2002:a17:90b:1f90:b0:20a:d81d:a8 with SMTP id so16-20020a17090b1f9000b0020ad81d00a8mr751608pjb.177.1668522496014; Tue, 15 Nov 2022 06:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668522496; cv=none; d=google.com; s=arc-20160816; b=sejEOZadG4fz+6iEeHP3h5+8km3C4iXtQe7b9bR05tbCBP65FKg7Ye7U8kAOSMq0cx 3GkPyMKvBIMEBJXIkEGsdbbsUR+oSQS05v3Sy5JXBRrPgxzB+cCkZHDhhJ+ABaaz69tO P6+vvpk0k/8cOEXZKvpAj7ZniP4Ho1cCNc1OsqeYKKfQRpu3Kezo2m0wnStym0rRwtuh bwSYjbbfig3n4ViJrDAYsw2ZY3iX7pp9OQ6CFF1sP2ZGu3y+zb1LmAgNeZ2qMQoglY9j 2RLuKW6VLXPj6ALaIbfn5EQBQyPuIjY+2OAA2cj/J92IdPMDHB8Y1AJdKMJSq9WeLXQg T19Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZpL11cNJx2l9z+r6z/7+POcZMvt9C9FRB9mdY/4v0yc=; b=DtBTkv/s49vPhCs6MbM8324xUMeBQg+sAi9IGLDyID6sCxktmbpt2UcecYZ8+usrbZ NERAtkQuojXouGQvuSd2h2uvlIRzl2+nUMWXlVqEmJZ6ww0XKMQYk34vePTaFf8XBv43 XH/qqJ27jxeCxmjm6AOQ/rlF55eF7vxLebgyfmR0wQCF8dUj4ceihLv1z1+FOZikDcT7 85eBZVOhtLulG2Fsvcfs4OG2Oz15putH5TuGJ53uji5Y4w5MeWGGe/xj6IH8KvRA/+BU /oZyX5YTZNPhLkWOImotNDU2ViJv24AORRQWhJWHJVeAd+hoiOJu1vL2wkB7GACQVGvK 7pEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bZ236k1s; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h6-20020a17090acf0600b00202c7f4631esi17925400pju.19.2022.11.15.06.28.03; Tue, 15 Nov 2022 06:28:15 -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=@linaro.org header.s=google header.b=bZ236k1s; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230499AbiKOOYH (ORCPT + 90 others); Tue, 15 Nov 2022 09:24:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229992AbiKOOYA (ORCPT ); Tue, 15 Nov 2022 09:24:00 -0500 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCADB252A0 for ; Tue, 15 Nov 2022 06:23:52 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id l8so17676381ljh.13 for ; Tue, 15 Nov 2022 06:23:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ZpL11cNJx2l9z+r6z/7+POcZMvt9C9FRB9mdY/4v0yc=; b=bZ236k1sR9rLsZmH2QLK/jWvz5w55IXdkp1pkw0jB+lj12y+GkMBVdGMjPGLfWYzsr YQW6QNgFrUiSbt/oUHQCSZmwJKKsqjPJcU64+Wa+4cdvHGHHrs8bn9fE/rc/IiiWE09C CqzZJs9Qupqm1iwIFBn5QIEY3lk/bvNvSa7pe1/KKB5k1Rrel4F1heY792b7gvbdtBs9 voXHqYupPmcnCRRIsCh1ZTraRuj0JJoYO8iWcZrGkggQ+73mmrEWUR0p7jVs020G2zS4 h8U3kw1yPFda0FtmhaeLa9wg+0pZg7PZ4AbxOPpCGlALEU0GGq/Bo6EE2h3b/ADt4s8g jyZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZpL11cNJx2l9z+r6z/7+POcZMvt9C9FRB9mdY/4v0yc=; b=BHJsVaDIS4lJGt81gfdN2tu2JAWwY/WuYaNtI7pIiGfcirqeQLZsvyoNAGZIKa+m9N qcieLzimrsmH2NSw98f+xpu3b3auhTx+tTxUMqwJ0yGO0ngNLwKXgTuT9OGYpoBc4zPT JcKZ0qoBsDaLVuxhyn4VWWdv8aaAqQVIfrqT7DVrrT/63+l8opLwHR3cnCeapTsyKlUq KYpb17AN2c+iXmc/ovggwb98Fz0GVF5K29w9dzFIzQYWK2/tFbznwgUialRC+xhjcBzl xmTM4N2XFljEjOVIJLfADUksSpZXYWTaZC0up2R2aon6nLHFWF5fgXNyibN/hO2Q2whI e+Dg== X-Gm-Message-State: ANoB5plT/K8e/Lx/BIFbTp1QEQhi5o897qSEK5mPR8iREK6oV7IK1if7 cw75YchBOEFxHAiivkTxLXPwVw== X-Received: by 2002:a2e:8184:0:b0:277:139d:78d2 with SMTP id e4-20020a2e8184000000b00277139d78d2mr5619258ljg.22.1668522231137; Tue, 15 Nov 2022 06:23:51 -0800 (PST) Received: from [192.168.0.20] (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id a17-20020ac25e71000000b0049aa20af00fsm2221593lfr.21.2022.11.15.06.23.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Nov 2022 06:23:50 -0800 (PST) Message-ID: <090831eb-2c7a-56c2-601e-e910431a9403@linaro.org> Date: Tue, 15 Nov 2022 15:23:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 2/2] ASoC: codecs: va-macro: add npl clk Content-Language: en-US To: Srinivas Kandagatla , broonie@kernel.org Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, linux-kernel@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org References: <20221115105541.16322-1-srinivas.kandagatla@linaro.org> <20221115105541.16322-3-srinivas.kandagatla@linaro.org> From: Krzysztof Kozlowski In-Reply-To: <20221115105541.16322-3-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 On 15/11/2022 11:55, Srinivas Kandagatla wrote: > New versions of VA Macro has soundwire integrated, so handle the soundwire npl > clock correctly in the codec driver. > > Signed-off-by: Srinivas Kandagatla > --- > sound/soc/codecs/lpass-va-macro.c | 41 +++++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > > diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c > index b0b6cf29cba3..d59af6d69c34 100644 > --- a/sound/soc/codecs/lpass-va-macro.c > +++ b/sound/soc/codecs/lpass-va-macro.c > @@ -205,6 +205,7 @@ struct va_macro { > int dec_mode[VA_MACRO_NUM_DECIMATORS]; > struct regmap *regmap; > struct clk *mclk; > + struct clk *npl; > struct clk *macro; > struct clk *dcodec; > struct clk *fsgen; > @@ -1332,6 +1333,9 @@ static int fsgen_gate_enable(struct clk_hw *hw) > struct regmap *regmap = va->regmap; > int ret; > > + if (va->has_swr_master) > + clk_prepare_enable(va->mclk); No error path? > + > ret = va_macro_mclk_enable(va, true); > if (!va->has_swr_master) > return ret; > @@ -1358,6 +1362,8 @@ static void fsgen_gate_disable(struct clk_hw *hw) > CDC_VA_SWR_CLK_EN_MASK, 0x0); > > va_macro_mclk_enable(va, false); > + if (va->has_swr_master) > + clk_disable_unprepare(va->mclk); > } > > static int fsgen_gate_is_enabled(struct clk_hw *hw) > @@ -1386,6 +1392,9 @@ static int va_macro_register_fsgen_output(struct va_macro *va) > struct clk_init_data init; > int ret; > > + if (va->has_swr_master) > + parent = va->npl; > + > parent_clk_name = __clk_get_name(parent); > > of_property_read_string(np, "clock-output-names", &clk_name); > @@ -1512,6 +1521,14 @@ static int va_macro_probe(struct platform_device *pdev) > /* mclk rate */ > clk_set_rate(va->mclk, 2 * VA_MACRO_MCLK_FREQ); > > + if (va->has_swr_master) { > + va->npl = devm_clk_get(dev, "npl"); I think you miss: ret = PTR_ERR(va->npl); > + if (IS_ERR(va->npl)) > + goto err; > + > + clk_set_rate(va->npl, 2 * VA_MACRO_MCLK_FREQ); > + } > + > ret = clk_prepare_enable(va->macro); > if (ret) > goto err; Best regards, Krzysztof