From patchwork Fri Nov 18 07:18:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 22153 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp42753wrr; Thu, 17 Nov 2022 23:22:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf72Hw04g2R+kEy2L7X/KOsWGRGhM/U5pDPyauwpdEvWpXc++8LVfb5CiS9XPw5d4qSpap7R X-Received: by 2002:aa7:c9c3:0:b0:461:8f21:5f12 with SMTP id i3-20020aa7c9c3000000b004618f215f12mr5150105edt.54.1668756122584; Thu, 17 Nov 2022 23:22:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668756122; cv=none; d=google.com; s=arc-20160816; b=mdFBQJb7SN1Suvs3OF5NVPECfkZpsX10DTwuylAuWvB/Lo4Ex1TIKFt0kGdpXc4dLw FP+oHYrYAsCNrHJtzk9R/ozADPcOS9pHFtkrdgYSR9NBBZr0Nm7Cf/kPs8aI56doZ0qX 7y47TjQ2vsBThSsqkdTE5GS3INurjdKyLoh10KSXs/EpIfyX5kGxNsmVwB3IybAMM7OY z1gjzRMT7agsT1N6bmKcetEBcTskdZVD/It9I89dXZKHpfXFzREji3b4UQHcPL1BPQhp aX49+H7zuAoyEQ7wsADTSwXUmvctBZEVXZ/yr2E4lsOVu9A5QvY5jonwtvabf7OgMvo1 UUPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MFo0v4KNc4REjP1ZSh0NPt20T7LaZ0hO2WW0XyMGjCg=; b=PCJniVaiGjnMLQYg0JzSsGHkvgVGDvbaZ8EcW+d1pvyVxYsFaGLxTujtxqQ7O6/9Lq n8npmVTKZjucuiuPr/c3MaAFYRggg0W9nR8i01B53RIvq8cTb1HyhneursuHh8xvaBDW MnlJfC63ctfwPWd9aWb0F6q7zTjPSY5PApc7vXnCNQkqvH/Iagoij5Ju8Lx9FJRHS420 mwPTg2D7vxYAAlYpE0ZX4rdJVRNNCMa+FAtl5d25cL/ncxmQkYVG7JI0drL2Qu6E4nFO xxzy1SQkS0h5mPfD0HMJffmUDxL1IXrZHyrZFL32UztGVA2Jle7vb89lWxY4tDiFxfrF cUgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KmXkPxIl; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy4-20020a170906fe0400b0078cc8a2cf4bsi2361676ejb.614.2022.11.17.23.21.37; Thu, 17 Nov 2022 23:22:02 -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=KmXkPxIl; 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 S241091AbiKRHTA (ORCPT + 99 others); Fri, 18 Nov 2022 02:19:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241002AbiKRHS6 (ORCPT ); Fri, 18 Nov 2022 02:18:58 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C3D872098 for ; Thu, 17 Nov 2022 23:18:57 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id d9so7855398wrm.13 for ; Thu, 17 Nov 2022 23:18:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=MFo0v4KNc4REjP1ZSh0NPt20T7LaZ0hO2WW0XyMGjCg=; b=KmXkPxIl/R8/F5oT/7mZUORqHKj+sPJXa6wgeXYfzNCuIV3LmB7HVmcOkGGU/c0cRD 3fIcb1nlL7aSReeophpnLQ7Jf9GQuIi+pqe30bdcJd3958HEL7rc00d1aplmHfOZY+ap Mrf2+Ctb23p2TPN4djwVuN2895OKzbemmvUNtZCrV7og7Gdiu67etBGb/GP6hsTgXn9I YC1tbNpZwwXvopbmtmC9+Kq9uuSGXtwngoPN62HXj5pQyHzy2UIw8K0X6nb9otZa6/xS obOyxsMXkQuCwjyyCBakPosvCrQsJz5Ko+4gHrMMrMWxykn0s7YKclL7nkLdS1WfbFvx Qr+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MFo0v4KNc4REjP1ZSh0NPt20T7LaZ0hO2WW0XyMGjCg=; b=kWKPDl/JKB/0QerXsPTVWgtt66eKLYzH5+yE5eMOZABSnZduOlSp8sBz1bf0ZiZUR8 QXrhKdwow+90HeJiu0V5oVhIFhyMj5sVGW3v5ceZbiV1gv0Lt1JlkzBPBu2RCCcuCBXf TcLnRiZYGxMI0WtDkzBvTa8NcJwq/8eA1rZerz+gACzEoLta3G44dVmeWYcFW5uOpH+q uOUpXbRGeZH3nDarmTowRFfFXJU2wnbqOo74dBvI1AGBI5ZRGSZ2stdbc1C4BDLCwtq1 mQpBKOdixkCsrAIeTw39r0Paskffjypw/3vtTOy+rLgNjINPg7NFEJCvYMQ4e5EwCrYm 7FwA== X-Gm-Message-State: ANoB5pl2g+jpyAmcU46h90DRIRAxysvQa6FBVohF2BqzcXm8Q4Ru8lmO db3unDVkN4zddi2uD6xW7mJoKw== X-Received: by 2002:a05:6000:1c4:b0:241:792f:a914 with SMTP id t4-20020a05600001c400b00241792fa914mr3478420wrx.117.1668755935610; Thu, 17 Nov 2022 23:18:55 -0800 (PST) Received: from localhost.localdomain ([167.98.215.174]) by smtp.gmail.com with ESMTPSA id j16-20020adff010000000b002302dc43d77sm2754349wro.115.2022.11.17.23.18.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 23:18:55 -0800 (PST) From: Srinivas Kandagatla To: 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, Srinivas Kandagatla Subject: [PATCH v2 1/2] ASoC: dt-bindings: lpass-va: add npl clock for new VA macro Date: Fri, 18 Nov 2022 07:18:48 +0000 Message-Id: <20221118071849.25506-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221118071849.25506-1-srinivas.kandagatla@linaro.org> References: <20221118071849.25506-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749817619912447124?= X-GMAIL-MSGID: =?utf-8?q?1749817619912447124?= LPASS VA Macro now has soundwire master to deal with access to analog mic in low power island use cases. This also means that VA macro now needs to get hold of the npl clock too. Add clock bindings required for this. As part of adding this bindings, also update bindings to be able to specific and associate the clock names specific to the SoC. Signed-off-by: Srinivas Kandagatla Reviewed-by: Krzysztof Kozlowski --- .../bindings/sound/qcom,lpass-va-macro.yaml | 63 ++++++++++++++++--- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml index c36caf90b837..288a1d5ad585 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml @@ -27,16 +27,12 @@ properties: const: 0 clocks: - maxItems: 3 + minItems: 1 + maxItems: 4 clock-names: - oneOf: - - items: #for ADSP based platforms - - const: mclk - - const: core - - const: dcodec - - items: #for ADSP bypass based platforms - - const: mclk + minItems: 1 + maxItems: 4 clock-output-names: maxItems: 1 @@ -60,6 +56,57 @@ required: - compatible - reg - "#sound-dai-cells" + - clock-names + - clocks + +allOf: + - if: + properties: + compatible: + contains: + const: qcom,sc7280-lpass-va-macro + then: + properties: + clocks: + maxItems: 1 + clock-names: + items: + - const: mclk + + - if: + properties: + compatible: + contains: + const: qcom,sm8250-lpass-va-macro + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: mclk + - const: core + - const: dcodec + + - if: + properties: + compatible: + contains: + enum: + - qcom,sc8280xp-lpass-va-macro + - qcom,sm8450-lpass-va-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: core + - const: dcodec + - const: npl additionalProperties: false From patchwork Fri Nov 18 07:18:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 22154 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp42890wrr; Thu, 17 Nov 2022 23:22:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf5StGXkrbjEtNfT5wazl2Ch4s5c3v4FIgFu2XmfvRLbrKZqZnCoDGa91CjOJCz3aEXRNLx8 X-Received: by 2002:a17:906:4bc4:b0:78d:6325:356 with SMTP id x4-20020a1709064bc400b0078d63250356mr4952545ejv.6.1668756153485; Thu, 17 Nov 2022 23:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668756153; cv=none; d=google.com; s=arc-20160816; b=v/cPd9wyjEspZhbJBDDr51aZKjACQxH+OoxJ366yL1oQ7tIvZ8KPobYWsUxHPMAXIq di+LSLddpsODGS2K3LL8aOX/45J9LzOHNDoSSA0SUosZV1qHmUxYIq0Aq7tuArOT5KFH q+Rdcjtv0/6F+RP0ObYSMp4kaYNYitVrXZGuvoqiqZpnnrHxaDjPkN/pg3AWU58IOjcz 7qu+cZ+ZL3v1ZX+thdgZtlLPC4mn9PB+V1RbmShvVFAomzsQiiaiUh9xForoChyHY8Gq TCLFA+XWjPLE9ewxhwj2E9muEgs/yRcYNo+rkht7ViOaEvdZedhea3ykIPdU6ZexPGrx 6pSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=j5HJML9y11R46OtDRqClWdXS2bPj3NqH8YWdkAW2AqU=; b=uUqinjb3DMB1nSXUmtZGnkmaNHcmDBjABEkir0IygKVMHCABQhSlgDxKj37hJxZ5qG zyy6UACyFY2PzS7arfJ782NXj6lSOFmUEpI2jDe+C/Ugk+UV8UDKNZH0tHxg1bpeQ58j 6wY90J3Dq1cZKiHHzLGwzTxP52YSFDCAl4EV1Q0WJEA05qEVOTaN09j3v/4jyNS3X0JZ QM23P8bl/TBRrLO0E7vW2kS24a85Z4FjsBFxJhoxBgkDEGtZZTxaoMV8SV9zDhc6HWGP T4T9EeI/5RWQmOdnqcCMzxm7YifSEMGFNSqFk9orxX9R+21LGgaxoxl58szLXSPZ7Dgu msWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vehHn/Vw"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a056402400700b004676b9092e0si2503764eda.408.2022.11.17.23.22.09; Thu, 17 Nov 2022 23:22:33 -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="vehHn/Vw"; 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 S241108AbiKRHTE (ORCPT + 99 others); Fri, 18 Nov 2022 02:19:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240943AbiKRHS7 (ORCPT ); Fri, 18 Nov 2022 02:18:59 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 835F87343E for ; Thu, 17 Nov 2022 23:18:58 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id w14so7891343wru.8 for ; Thu, 17 Nov 2022 23:18:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=j5HJML9y11R46OtDRqClWdXS2bPj3NqH8YWdkAW2AqU=; b=vehHn/Vw/9TXfh7L4TosD4ihMHZH/NB/MEGLeKv62iak0qOdKU9xf9JojCGVMUgXhZ VaXjZagbTPvMnAaqbyUviDH3MluJCiHdlHPwJzC5WvFE/cFfwZI48OfJVeS4KdtauJEC DV4z59mH2o+iLxLS+5KuMFoCZYNFZXD58fbQWghJJQbwnhfVNbuZwMvjx64mh18wo8kC a2tOSTlTYgKl3DQIwPP1Ziwr90kcMPXRaHLERlfVVwhWoUWvp7xbck9E+cugx0gVrmdY NOhKJUZgjE1PkN0XPsPFIKaaT5lAnfP7Ro+PLJhcLyOlMgZSER5T3uHjJ8hyhYmOrG1c d76w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j5HJML9y11R46OtDRqClWdXS2bPj3NqH8YWdkAW2AqU=; b=0JvGt7wvSz3JfIMBCO/5zc3AooK9u6xm3hfpIWYzVCxROy/xtfrYDsk0zsulhNuZWG G4RYzakaCwKAjI7HGYzC1NYZhreQWXmtIpF+b5gJ+r9PJSLlWr/z/1YYUYfE28FdzESO VRwkBeh40TcL9smEFwFOCjLzOuPuc8LUZkcSzqXOi3Uob1ZExHpsjJbhrRkRwGyKIziY klkhwh5f0ibnju3k2AZSi6i1PwO59w5yfZiz4w+/6dtJH4kfdLn0Gt13KpoYHFyFumpS px8vOJX0s4UDLXrfuqH05VXnOp70qt1FzJ7ayYubGev1u2jJ9S66b+P8lxsJW44QT14w 3CGQ== X-Gm-Message-State: ANoB5pluHWg19wypDEpFTOOFCosRogvTYV8fQgEXMevWVNaH3gOf+Plm TdCCdtkr52RndPkILC3Xeq8R8A== X-Received: by 2002:a5d:6b0c:0:b0:241:c595:9f05 with SMTP id v12-20020a5d6b0c000000b00241c5959f05mr16601wrw.439.1668755937028; Thu, 17 Nov 2022 23:18:57 -0800 (PST) Received: from localhost.localdomain ([167.98.215.174]) by smtp.gmail.com with ESMTPSA id j16-20020adff010000000b002302dc43d77sm2754349wro.115.2022.11.17.23.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 23:18:56 -0800 (PST) From: Srinivas Kandagatla To: 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, Srinivas Kandagatla Subject: [PATCH v2 2/2] ASoC: codecs: va-macro: add npl clk Date: Fri, 18 Nov 2022 07:18:49 +0000 Message-Id: <20221118071849.25506-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221118071849.25506-1-srinivas.kandagatla@linaro.org> References: <20221118071849.25506-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749817652398576637?= X-GMAIL-MSGID: =?utf-8?q?1749817652398576637?= 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 | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c index b0b6cf29cba3..eef8dd5d58f8 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,12 @@ static int fsgen_gate_enable(struct clk_hw *hw) struct regmap *regmap = va->regmap; int ret; + if (va->has_swr_master) { + ret = clk_prepare_enable(va->mclk); + if (ret) + return ret; + } + ret = va_macro_mclk_enable(va, true); if (!va->has_swr_master) return ret; @@ -1358,6 +1365,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 +1395,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 +1524,16 @@ 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"); + if (IS_ERR(va->npl)) { + ret = PTR_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; @@ -1524,6 +1546,12 @@ static int va_macro_probe(struct platform_device *pdev) if (ret) goto err_mclk; + if (va->has_swr_master) { + ret = clk_prepare_enable(va->npl); + if (ret) + goto err_npl; + } + ret = va_macro_register_fsgen_output(va); if (ret) goto err_clkout; @@ -1563,6 +1591,9 @@ static int va_macro_probe(struct platform_device *pdev) return 0; err_clkout: + if (va->has_swr_master) + clk_disable_unprepare(va->npl); +err_npl: clk_disable_unprepare(va->mclk); err_mclk: clk_disable_unprepare(va->dcodec); @@ -1578,6 +1609,9 @@ static int va_macro_remove(struct platform_device *pdev) { struct va_macro *va = dev_get_drvdata(&pdev->dev); + if (va->has_swr_master) + clk_disable_unprepare(va->npl); + clk_disable_unprepare(va->mclk); clk_disable_unprepare(va->dcodec); clk_disable_unprepare(va->macro); @@ -1594,6 +1628,9 @@ static int __maybe_unused va_macro_runtime_suspend(struct device *dev) regcache_cache_only(va->regmap, true); regcache_mark_dirty(va->regmap); + if (va->has_swr_master) + clk_disable_unprepare(va->npl); + clk_disable_unprepare(va->mclk); return 0; @@ -1610,6 +1647,15 @@ static int __maybe_unused va_macro_runtime_resume(struct device *dev) return ret; } + if (va->has_swr_master) { + ret = clk_prepare_enable(va->npl); + if (ret) { + clk_disable_unprepare(va->mclk); + dev_err(va->dev, "unable to prepare npl\n"); + return ret; + } + } + regcache_cache_only(va->regmap, false); regcache_sync(va->regmap);