From patchwork Tue Nov 15 10:55:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 20309 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2647407wru; Tue, 15 Nov 2022 03:00:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Veh68uwcidgaHtf60mI+oIkHNKrx3rWDMG0KvD5r8+on3WLIm0QpoOFAwryMaonIx3d92 X-Received: by 2002:a05:6402:604:b0:458:d1c4:106f with SMTP id n4-20020a056402060400b00458d1c4106fmr14296608edv.408.1668510052669; Tue, 15 Nov 2022 03:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668510052; cv=none; d=google.com; s=arc-20160816; b=UsjLDcthvWVs06lmUYdUZaVMxsF0pgcziLeMPBzXtNAqQGfpTX8nZSDjwLjCbFJkK3 RK5zKC/DaBLzbzCty2/TDv2r/IlooM/z99vYCSddFi2kMrCLs5OsXMiw8HpvvhZBfXS0 ERuunwY5F/N8OJUknHaIBmz+gdIdcNXg23t0FQf2lQr9npIUPlwdrjjk2cic0zN5u1Fy /HctM0BiRJAhZrLYK15X1oJ8n5MUxeOuo3dCTjwhKprBSTikF91rXBNpgbdYmOZYhJc1 8gfYDdNitBBjqSducv8DQRK/Ge2eLGb/7JMzeaRP9OWtylEulEHuy51OGhDXKQt3zEyy JEEg== 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=bCi7YFy2fjbBE3WEf3zcS1kGXNt63J9q4Tgiqiwur08=; b=PLtheNm5a0JHezeX8SjyZLono2r0ck9PoZns1rH2NqIIuMtOpm+cctH4opskEiN1BW 1ud44zwaN/6UZ/jmUitdIrNE1gIMTPsLvNcMn6N7X3SFP0Qb82XaONImeewlCqsWol44 V+NzUyJSWUsg8w40GQWFVBYjKbqYcjiMsT/di7UeQ4gdmoFSraZlGaiSk+hteAVHZDrQ 4dP/Wg3UviN1V0f3vcLkBT1mrCPiGa+1GQZI7kQWFmfl9hSGa7EiYIRuis4QVvX+DVlu n0U44lz076iZbm2MzyR+fCKtwvX5OvsF6D9hCrO85OGkqllToVFUCbswgnmdGfVBqQQy +TTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d2snvaMp; 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 l18-20020a056402029200b004614db9083csi9712725edv.313.2022.11.15.03.00.26; Tue, 15 Nov 2022 03:00:52 -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=d2snvaMp; 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 S232245AbiKOK61 (ORCPT + 99 others); Tue, 15 Nov 2022 05:58:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232305AbiKOK5t (ORCPT ); Tue, 15 Nov 2022 05:57:49 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4B765F86 for ; Tue, 15 Nov 2022 02:56:00 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id t4so9389838wmj.5 for ; Tue, 15 Nov 2022 02:56:00 -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=bCi7YFy2fjbBE3WEf3zcS1kGXNt63J9q4Tgiqiwur08=; b=d2snvaMp96sDrYHfndctd8uvR2posqG3lOgKLGpu8H38Gs46hOBPPnJkWcCwKXdPD2 NSNTvr7gwRTLab2w2L57LA76aluuMFKthfckaCkDazbgZtkhoNWS6zrt6Cx/MH9+R1q9 Lvx7Hz6cd3nBqi62rFoGeaaC6UYhvMdpQqPG0bLO9Z17a78LkfnSys2ZCtOnxmUnP16r ZnnTJESLFwNMoZs1ZF+ocEDQBbp0ukiV2EXLpK/rGSLBaCp8ctOaQg7HEajNCtEeDCZr caO2OyjV5qF9ColI0fUiyE2D4QaV8ASpriwjIr4Q/giiRzU1NaLZ0Wn4bC9p870qdyMX ZHbg== 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=bCi7YFy2fjbBE3WEf3zcS1kGXNt63J9q4Tgiqiwur08=; b=jwcsPx2CPZ8lk88/QtjygGJGEwbi7OB1CqoSkkhSZEzLuDmnLUq0ePLBZf34Wfj91l P9/eDJxC2O1bj+nZ5pZJcZCHsXqz9zKhNsQP93QGXMPfGQwKgWXcV+oZajwyJHywewEB iEFo9c/GqXb+HCc+csM8/AAXkYzQvXN7Iv5V9vJPDk+OBJiunngLQ7X8Sw5Ia4YLRAxn /BO+Jh9qWtmuE+aBvFi+lOcm4IwAG3h0Pp7MQQIo0v0LRvrhg9YZcxgh3vmfVGULQUcn U2XKY7L2PZE4OmcBDtNPrIlTS2HhVsweM7k1iYJu+2M2kwl9l2ZOJzRrovSrLgwQR/71 p6zg== X-Gm-Message-State: ANoB5plOQ8uIvoPCIYxQ4FPg+1jAc5DSeJfOr6yUFv0WGwhHXGM2COTf evHAiLHdD8vQlTOwAL01uv/BsA== X-Received: by 2002:a05:600c:1f0d:b0:3cf:7556:a592 with SMTP id bd13-20020a05600c1f0d00b003cf7556a592mr1004863wmb.199.1668509759244; Tue, 15 Nov 2022 02:55:59 -0800 (PST) Received: from localhost.localdomain ([185.201.60.217]) by smtp.gmail.com with ESMTPSA id r18-20020adfe692000000b00238df11940fsm12185046wrm.16.2022.11.15.02.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 02:55:58 -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 1/2] ASoC: dt-bindings: lpass-va: add npl clock for new VA macro Date: Tue, 15 Nov 2022 10:55:40 +0000 Message-Id: <20221115105541.16322-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221115105541.16322-1-srinivas.kandagatla@linaro.org> References: <20221115105541.16322-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?1749559596897450212?= X-GMAIL-MSGID: =?utf-8?q?1749559596897450212?= 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 --- .../bindings/sound/qcom,lpass-va-macro.yaml | 72 ++++++++++++++++--- 1 file changed, 64 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..848e34111df1 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml @@ -27,16 +27,13 @@ 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 @@ -61,6 +58,65 @@ required: - reg - "#sound-dai-cells" +allOf: + - if: + properties: + compatible: + contains: + const: qcom,sc7280-lpass-va-macro + then: + properties: + clocks: + minItems: 1 + maxItems: 1 + clock-names: + items: + - const: mclk + required: + - clock-names + - clocks + + - 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 + required: + - clock-names + - clocks + + - 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: npl + - const: core + - const: dcodec + required: + - clock-names + - clocks + additionalProperties: false examples: From patchwork Tue Nov 15 10:55:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 20308 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2646971wru; Tue, 15 Nov 2022 03:00:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jnETTheHeY+sNLcday2vMfPSjU7ODVlH3IfOsOkCWfRpuflHiZk0A8NkhXfFZ0xTBfaFT X-Received: by 2002:a05:6402:414e:b0:463:1a0c:4dd1 with SMTP id x14-20020a056402414e00b004631a0c4dd1mr14815451eda.137.1668510005825; Tue, 15 Nov 2022 03:00:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668510005; cv=none; d=google.com; s=arc-20160816; b=huhH5GUXehWmaNcGwTczM9GwC4p3y3SCEtqiZ89R74/HQGHo0SQr9n7+2CT6XxMoOg u8AwXMzQsrGKsnJ1oPNDT9S7gezPwEHQW8YYPGtobaL6k2yHafNr4zn/6clwtdFi1hn9 Axcpe6uC6ipw3I+iIdGvFGXjPvSsK5Df7W0+kgaDCwd9SQu0WqOBlnxaTAkk4aDzj1bf 6M+jdsrJLPIzQf4RHE2KJQ4ZnPJeGrcTPFHauf8iZ+CdV+gAdk1SDod0cDXiSGGHGE0O fYQApniUAMcVqWrs/Bq8qVGDXsZHKTAYDX7LYnVCTwLOomOssYgQldaiYHjTWL43jO9u CVQQ== 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=tEZm7AO72PHR8XXAieuiGQq4vGYxo48R04rB6nNJWT4=; b=ewAx6WpbVUDSLoHVTXPagZlZbwEz5yZbvnzUaJeAmU3okfD+oyvch4cmn931h0U5dz pVkvh0XWUY3oFThT3eXWdj9eZSv8DzB+E0QqRQ3D76DGzD4PIp4c2eKI4OTr6kymxawS jXFhpLMgFmfJX93KNq1dRXYuRsmRRO3ke4BoZbDXPbdhvkvOqvzgs/TjCIEiGR7h4G44 c2q4Ndo1GWFXxxiOCFFmRx5yopqcXsSKzeW5bA/uXH5mj101X62mRQPnd/UCuD9xoSZg BioLRaJSDEqsaHqR7+xLADds47OmbYh1u4cfbUxf+eYRYQryg7u8TCykwG0h4Emo+Z4P et6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fJcHcyqO; 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 sc23-20020a1709078a1700b00783ddc8b643si11035947ejc.317.2022.11.15.02.59.40; Tue, 15 Nov 2022 03:00:05 -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=fJcHcyqO; 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 S229967AbiKOK6j (ORCPT + 99 others); Tue, 15 Nov 2022 05:58:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237725AbiKOK5y (ORCPT ); Tue, 15 Nov 2022 05:57:54 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0683013D5E for ; Tue, 15 Nov 2022 02:56:06 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id j15so23608428wrq.3 for ; Tue, 15 Nov 2022 02:56:05 -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=tEZm7AO72PHR8XXAieuiGQq4vGYxo48R04rB6nNJWT4=; b=fJcHcyqOrrgOgwsSt2rCsZ/uwD3S/JL4d47KGHeh/Tf6mK9Vku8dZ/oXPmb0CQV71J P/s1aoBhCg2+b7c0tJIIg6yjtekcSENMpBdMa7u0QLrWoJ5Z7LeuFxaeC5Ho+z34MMmf gP3KVaSJePtzcW4nXsHWNIhsEd1Cl2J/HqN9nHxC9Tr29J/BWN15Gj0lqYGJ1EqmWoF3 Th0R3cv0rglBYQ0SbQ8fWFTh0bkaU8d7P81eWas1KYEViDmobZWR0kMMAc8IDGcOhUlw Yf76wd8OZqbJZU4K0Bj5Y7/k/2x0bgW4EVD5s14hUlW3CKHzDos1A+sbmqn1fHios0lk EQvw== 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=tEZm7AO72PHR8XXAieuiGQq4vGYxo48R04rB6nNJWT4=; b=h76Xk07WzHxTxMEzaSC84nD+u0GGyW57Kt9V5oSJMwuqrMfgxkbaa0y8U4HGcczPur R+gbS4gNZPAj6eCJSbaoikiRc33M5P4+iI77ltvKlJYIHA6wM312XZvSGQM9xFuF9GdZ +ojsLaC8+vyfVS3oSX663cwFL6+O90064FD/FyLxNo3TtxkvslPqXeKuANsDX4lmrtYq Ge/RFsFvtHfUdLghJUjhoeFEgYOO+TTFtvkacFBEqSjyl57pL6cShpO7JOA4gTdpY1JC tPCrhNmVDhOCJOWnEZXxB56NlfTpE1V5KXvxcWaNhjnby+suJQEHB1uwq5mqemilk3UT 1QJw== X-Gm-Message-State: ANoB5pl2Ep7boby/PhW2oJ5C5ny341kHdgus5tNSif+/sqTRSxhOjrIB jNgqhjrCdzkj3RFRnLiDNG8OXqYQlu5cexaX X-Received: by 2002:a5d:4290:0:b0:236:6e66:3447 with SMTP id k16-20020a5d4290000000b002366e663447mr10318548wrq.24.1668509764523; Tue, 15 Nov 2022 02:56:04 -0800 (PST) Received: from localhost.localdomain ([185.201.60.217]) by smtp.gmail.com with ESMTPSA id r18-20020adfe692000000b00238df11940fsm12185046wrm.16.2022.11.15.02.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 02:56:03 -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 2/2] ASoC: codecs: va-macro: add npl clk Date: Tue, 15 Nov 2022 10:55:41 +0000 Message-Id: <20221115105541.16322-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221115105541.16322-1-srinivas.kandagatla@linaro.org> References: <20221115105541.16322-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?1749559547866331179?= X-GMAIL-MSGID: =?utf-8?q?1749559547866331179?= 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); + 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"); + 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; @@ -1524,6 +1541,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 +1586,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 +1604,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 +1623,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 +1642,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);