From patchwork Fri Mar 10 13:21:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 661691 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA203C6FA99 for ; Fri, 10 Mar 2023 13:24:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F29751866; Fri, 10 Mar 2023 14:23:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F29751866 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678454687; bh=4MWTDB6xmkyQqDGTss3nKymH9mFKCDBJEw0bzXEALnU=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Uub2HO/09FP1WTI3JebrJJ4Tn8TCxS5Ws8n2pFSb4n9ObEqlWXzhxqzJtJRLTHwWN dMbcJxZvceJTetUJTOm1Xi6r8Y3fx8Wx6q2DS0D/6mA/BheBNglxopgqnI+d75lycO uDl3djrHZFZbOQP37iuYjNnU1/rtJ1JhYQjZamS4= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6EC4CF80549; Fri, 10 Mar 2023 14:22:44 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A5310F8052E; Fri, 10 Mar 2023 14:22:21 +0100 (CET) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3CA30F80093 for ; Fri, 10 Mar 2023 14:22:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3CA30F80093 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jp1ewdyS Received: by mail-ed1-x529.google.com with SMTP id cw28so20368133edb.5 for ; Fri, 10 Mar 2023 05:22:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678454525; 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=BbnW+HQXXMov2YCkKGIA3Ip1jgaMjvv36rVivoZ/sxY=; b=jp1ewdyS3iKqffGyu1oG2Jm5BRpT1kO1nx77XSIFlV38VmHYOe38jBFOoVttHRTNe6 Roumacgk5N0FLiJzU1TCG67mhTvBAtUq2SY9pgVF8aeoZlfmWmQ3bBfYSzNQtJUahwkv 6GuIe/C+sTi5cKK2iaJgaC1NfPxcgD7jE6I0cagnZHfqfW5Yiq1DG6rjMeQ0KBSW1tTj jLv6XmhE5Yhr+PORyykLpu3JaCfhuVclH4fH0S5t02UkST8thCLJSoRBot0XGvnTx4rw 2ivclRZvIL8g1fJ1UxDjcLRgvaYb5D1YveDZvT5HdTAvvcZXMtIMGE2DM9jfRCI39u3c nE8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454525; 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=BbnW+HQXXMov2YCkKGIA3Ip1jgaMjvv36rVivoZ/sxY=; b=t3h2H9ZxLL6g2dfYsBc/zqli8ebUrGGtrLjaF2rccNpHh+K/XLKSuENqbIzNVMMRsg ARCHMGpoSpzg/xg4KPXXWglUUKTUKonjPrTdeDkS/AWtb+HlICkJpHMaQCozPSs/rqQv ahmeX4pHkJ+Xev58FdV+9wIFjrllsPsmiHl4W+jEqUA9orwL54pc3WBaL5yg+jmG8/QT lRRh8H2WfQ0ppO4Tc+8x1ZkdCHoGSmgB8BlFQz6xNS9UUzRVceDdY00beNR7tvxWAggI m5ChlIl9qYCuqaw+A9FrJp1nH0Lw5d5I5ZeTblZynOnhtDmU5z7u8J5yv7ZNydsWgS3C Avmw== X-Gm-Message-State: AO0yUKVuR63CZ76REQ0zJ/OSD6SMRXu4XSnjM+C4/Av6e2BApPqvEPDZ dEb6o1iTo1J+k40PZbuJFgTmOg== X-Google-Smtp-Source: AK7set89bwlmiWBuUwrH1uGGkGVacmOgb9VNWvOfJbCJIbNr2Ma9v0H90OaSF5yRm6toBSO+Hozexw== X-Received: by 2002:a17:906:eecc:b0:90b:167e:3050 with SMTP id wu12-20020a170906eecc00b0090b167e3050mr31863715ejb.36.1678454525311; Fri, 10 Mar 2023 05:22:05 -0800 (PST) Received: from krzk-bin.. ([2a02:810d:15c0:828:45c4:46be:ec71:4a51]) by smtp.gmail.com with ESMTPSA id zc4-20020a170906988400b008b17879ec95sm959124ejb.22.2023.03.10.05.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:22:04 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/9] ASoC: dt-bindings: qcom, lpass-rx-macro: narrow clocks per variants Date: Fri, 10 Mar 2023 14:21:53 +0100 Message-Id: <20230310132201.322148-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> References: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: SKCOCZE2NOQQSVIFHR3HJOCRGFCRAAWE X-Message-ID-Hash: SKCOCZE2NOQQSVIFHR3HJOCRGFCRAAWE X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Currently the Qualcomm RX macro codec binding allows two different clock setups - with (for ADSP) and without macro/dcodec entries (for ADSP bypassed). With more devices coming soon, this will keep growing, thus rework the clocks/clock-names to be specific for each binding. Signed-off-by: Krzysztof Kozlowski --- .../bindings/sound/qcom,lpass-rx-macro.yaml | 58 ++++++++++++++----- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml index b0b95689d78b..8b3d617a9578 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml @@ -9,9 +9,6 @@ title: LPASS(Low Power Audio Subsystem) RX Macro audio codec maintainers: - Srinivas Kandagatla -allOf: - - $ref: dai-common.yaml# - properties: compatible: enum: @@ -34,17 +31,8 @@ properties: maxItems: 5 clock-names: - oneOf: - - items: #for ADSP based platforms - - const: mclk - - const: npl - - const: macro - - const: dcodec - - const: fsgen - - items: #for ADSP bypass based platforms - - const: mclk - - const: npl - - const: fsgen + minItems: 3 + maxItems: 5 clock-output-names: maxItems: 1 @@ -62,6 +50,48 @@ required: - reg - "#sound-dai-cells" +allOf: + - $ref: dai-common.yaml# + - if: + properties: + compatible: + enum: + - qcom,sc7280-lpass-rx-macro + then: + properties: + clock-names: + oneOf: + - items: #for ADSP based platforms + - const: mclk + - const: npl + - const: macro + - const: dcodec + - const: fsgen + - items: #for ADSP bypass based platforms + - const: mclk + - const: npl + - const: fsgen + + - if: + properties: + compatible: + enum: + - qcom,sc8280xp-lpass-rx-macro + - qcom,sm8250-lpass-rx-macro + - qcom,sm8450-lpass-rx-macro + then: + properties: + clocks: + minItems: 5 + maxItems: 5 + clock-names: + items: + - const: mclk + - const: npl + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false examples: From patchwork Fri Mar 10 13:21:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 662373 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5E5EC6FA99 for ; Fri, 10 Mar 2023 13:24:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6195017FD; Fri, 10 Mar 2023 14:23:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6195017FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678454643; bh=pMXK2nU9TDhsMNF2O0ysGc2eN8QSKaEidbOTfNnAhHo=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ELTYKFZo9gpletBFkcjXQVQjTiQWaApoKQcvZOdDw6rKRz9IBjtKZOBAclUBqsf2v 5TF9yEuipGqYwKNasZiqYmAgQkr4PoticSrQbcUqfvJmYtTq3ccDUOXeqYP8aXGAe5 LVAIZ1dRXkVlJhxPAyGMIEzcg0PJWbqopnqP7HDI= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DC266F80093; Fri, 10 Mar 2023 14:22:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AE1FCF804FE; Fri, 10 Mar 2023 14:22:14 +0100 (CET) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 607C2F80236 for ; Fri, 10 Mar 2023 14:22:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 607C2F80236 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=QWRaO46r Received: by mail-ed1-x535.google.com with SMTP id j11so20364252edq.4 for ; Fri, 10 Mar 2023 05:22:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678454526; 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=AcXL6MCdOOilzj/9V8Bxhr6PgZvPsGUvEZbtUrf8CA0=; b=QWRaO46r5Vlo+LFpfEj41+oWL74m9vY9Ye1RziJsp7mkHfJg357wAQjE6BSqZxl1OP WBeQSKR+I0Vz4KemBZidBqo0sdYi30BB7QngnRQtPNPX9izS42xhL4QrpBlEpSMyS1La aCMC7sHmtJ9rov8CDTNGUPFBvGl0guj6xQ64aQOx50BOrKAOoADxn6xhQY0nsw40jBnO 7/yQ5OD8flLzXTkCHyfpRE4L200L6IxelwR7ynIAw5dVdpqoomUVZbyUMDvUKwVFskTc UdMTONwoarGEBF554WPMXmeWNd5fnI/gHGkGRiBPJGilCR9hYZj4bgMgX9KTmc2fBJGZ gm5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454526; 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=AcXL6MCdOOilzj/9V8Bxhr6PgZvPsGUvEZbtUrf8CA0=; b=Pj0NZLfYXfuZLPuKeuEMOwYEd8aWtKGcFR0aur/d9m4FBdiNFU9nyJHwZx9GB6jjp9 1R+Ek3uJeE3UiYAFfQQAuCxiPDDG/7w+N4H3CKBzVCuBfVu0rDidH6XvBScdSCdox0LW B5V2bEen3X+IkabGruWhaCRIUnpyUj5pM+3VGH81bdh2rh90LLOF7L3kC+OkwqGh2qPj 1HPsn4ektcAUVOv6Byz6YptvFMmCk1cqDSF7yyZ4YncwNFXD1nZrHMtkxkxrhvFQnv5f O8RxzhbiGEWlQBTmQXVqigh1CevSIi5zyP2zUyPaEz78deTSzccRvfri3feF1aqTcVwp LvDw== X-Gm-Message-State: AO0yUKVRlhl/UrdmoXw9QZ6O8naeyzi83bai0cUrG8p5iAg7SkudGVzI euoGpSphBRHXnajK9moA6vzatg== X-Google-Smtp-Source: AK7set86DEihjYozkYNfs2JVNMeu/cjpWbEQPkrPICoAQV9Zd2V3aoH5znXQFvekHR3LgD1deH2NWA== X-Received: by 2002:a17:906:32d9:b0:8aa:bf4e:7b2c with SMTP id k25-20020a17090632d900b008aabf4e7b2cmr26777378ejk.21.1678454526446; Fri, 10 Mar 2023 05:22:06 -0800 (PST) Received: from krzk-bin.. ([2a02:810d:15c0:828:45c4:46be:ec71:4a51]) by smtp.gmail.com with ESMTPSA id zc4-20020a170906988400b008b17879ec95sm959124ejb.22.2023.03.10.05.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:22:06 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/9] ASoC: dt-bindings: qcom,lpass-rx-macro: Add SM8550 RX macro Date: Fri, 10 Mar 2023 14:21:54 +0100 Message-Id: <20230310132201.322148-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> References: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: IH5HTYLDB5SCYQCZPAHLE45UKIMWT2KY X-Message-ID-Hash: IH5HTYLDB5SCYQCZPAHLE45UKIMWT2KY X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add the RX macro codec on Qualcomm SM8550, which comes without NPL clock exposed. Signed-off-by: Krzysztof Kozlowski --- .../bindings/sound/qcom,lpass-rx-macro.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml index 8b3d617a9578..0ae3c81abdf8 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml @@ -15,6 +15,7 @@ properties: - qcom,sc7280-lpass-rx-macro - qcom,sm8250-lpass-rx-macro - qcom,sm8450-lpass-rx-macro + - qcom,sm8550-lpass-rx-macro - qcom,sc8280xp-lpass-rx-macro reg: @@ -92,6 +93,23 @@ allOf: - const: dcodec - const: fsgen + - if: + properties: + compatible: + enum: + - qcom,sm8550-lpass-rx-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false examples: From patchwork Fri Mar 10 13:21:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 662372 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1DF1C6FA99 for ; Fri, 10 Mar 2023 13:24:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B5EA117E0; Fri, 10 Mar 2023 14:23:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B5EA117E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678454662; bh=h7RM655AcdQjRMwtijNsqpUhz/Td+V4qRQ01ePQlxh8=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=HJf5t7yzCDno939DB5qMOM05Dd/I4HUYvlT4p4zT1VSGalHpok1u8vC1nwdhD4RwS OvSoxsFp7V1fBtP3SXfY6x+0A2CtT7UkEllmJxkO6P+3tmsjNHwZd+lbMZRuBPVqQy WjwHxb3e2zjGI0NYkJblDyuuL8WVNYvlziQ7fz24= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0E897F80534; Fri, 10 Mar 2023 14:22:43 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C5020F804FE; Fri, 10 Mar 2023 14:22:19 +0100 (CET) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DF654F8007E for ; Fri, 10 Mar 2023 14:22:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DF654F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=EckjYIrE Received: by mail-ed1-x534.google.com with SMTP id x3so20274070edb.10 for ; Fri, 10 Mar 2023 05:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678454527; 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=Rto2D5OftYK1ID57dBSGS4QnEMib23DRCG76xg1zNII=; b=EckjYIrE4DJhMp6xe6dqYs9joBiyI1ngPyS/0OY9GgOP2nTQbi+9ZebR+rNljPuG36 F/SyIj/rGDkrmCfzmx3Wg9DE/aVxU/s9cDsnSlyRpYEGL+KbGPIpmitQLhPyZNnryIyU 6zwGgeGjcbTfKLAiqbdnwJzQvJN82nFfO6MY+2NjScneBbpLX1sRNJBvP1OIkffYoVxa XAVB8JDDrtlaz8FpxsLLA/2mjiJOJ2uHc62ToAcxhEIOQuT4VTRx55ZRE5DFxEqCQt1h ripnr9yzUtuZMAWmvBV/6gNz9XDXf/k01ARRcA+So1FaTcFAVzNrxd6FNTXiJQlbKTBo 3aKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454527; 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=Rto2D5OftYK1ID57dBSGS4QnEMib23DRCG76xg1zNII=; b=oENH11CUgzGJ3A3YJ9LL8ZhdVTkvaOVrpAmT3Pc48RVUUcNPaLspnYO1mxulXEYjqu HpvnYN6PnUubWi4yX3b9ZccWJvjayTZPPMGcgoxr1zVcafSN9liyltSv5+yfwABxApZE 6617pSnM2aumc1PqC+suJvxZDdBSBTOxIfE8gbyfCqeCgjrMAk0bzLHM8l2oPlRKA9Xq 9AUjwTGWiMXQQ0UbvKGTxCcDn3sgSKGCl02wNTQC68xCDqfveqiLmmDMqE/WBDLGgm7W QB9GwaqhkDydpVBGbtIXLWtYTU9lmfrCoWW652uUi1YhLxCxShUPvb9b0ifME2eBSdZe HMIw== X-Gm-Message-State: AO0yUKVKb3A4l8FlHTntb2+MvBHH2xVsuOF0T5eZu7O6hLsAfPZp9/VI f/s+YM0edo4HEWvcvA3Osu+lsQ== X-Google-Smtp-Source: AK7set+O3ImPHzDIFLhFK5/g1q7pHfzB69yohRjQEKyKjOzXBvIq6vsr/mv67mV4NXtNeqiTtWIRJw== X-Received: by 2002:a17:906:2bc2:b0:8b1:7de3:cfb4 with SMTP id n2-20020a1709062bc200b008b17de3cfb4mr24517931ejg.4.1678454527437; Fri, 10 Mar 2023 05:22:07 -0800 (PST) Received: from krzk-bin.. ([2a02:810d:15c0:828:45c4:46be:ec71:4a51]) by smtp.gmail.com with ESMTPSA id zc4-20020a170906988400b008b17879ec95sm959124ejb.22.2023.03.10.05.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:22:07 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/9] ASoC: codecs: lpass-rx-macro: add support for SM8550 Date: Fri, 10 Mar 2023 14:21:55 +0100 Message-Id: <20230310132201.322148-4-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> References: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: KOCWBODXWCX5ZLALMGBRZPM5BMDJAWAP X-Message-ID-Hash: KOCWBODXWCX5ZLALMGBRZPM5BMDJAWAP X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add support for the RX macro codec on Qualcomm SM8550. SM8550 does not use NPL clock, thus add flags allowing to skip it. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/lpass-rx-macro.c | 39 ++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c index a73a7d7a1c0a..e322d918db36 100644 --- a/sound/soc/codecs/lpass-rx-macro.c +++ b/sound/soc/codecs/lpass-rx-macro.c @@ -395,6 +395,9 @@ #define COMP_MAX_COEFF 25 #define RX_NUM_CLKS_MAX 5 +/* NPL clock is expected */ +#define RX_MACRO_FLAG_HAS_NPL_CLOCK BIT(0) + struct comp_coeff_val { u8 lsb; u8 msb; @@ -3491,7 +3494,10 @@ static int rx_macro_register_mclk_output(struct rx_macro *rx) struct clk_init_data init; int ret; - parent_clk_name = __clk_get_name(rx->npl); + if (rx->npl) + parent_clk_name = __clk_get_name(rx->npl); + else + parent_clk_name = __clk_get_name(rx->mclk); init.name = clk_name; init.ops = &swclk_gate_ops; @@ -3521,10 +3527,13 @@ static const struct snd_soc_component_driver rx_macro_component_drv = { static int rx_macro_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + kernel_ulong_t flags; struct rx_macro *rx; void __iomem *base; int ret; + flags = (kernel_ulong_t)device_get_match_data(dev); + rx = devm_kzalloc(dev, sizeof(*rx), GFP_KERNEL); if (!rx) return -ENOMEM; @@ -3541,9 +3550,11 @@ static int rx_macro_probe(struct platform_device *pdev) if (IS_ERR(rx->mclk)) return PTR_ERR(rx->mclk); - rx->npl = devm_clk_get(dev, "npl"); - if (IS_ERR(rx->npl)) - return PTR_ERR(rx->npl); + if (flags & RX_MACRO_FLAG_HAS_NPL_CLOCK) { + rx->npl = devm_clk_get(dev, "npl"); + if (IS_ERR(rx->npl)) + return PTR_ERR(rx->npl); + } rx->fsgen = devm_clk_get(dev, "fsgen"); if (IS_ERR(rx->fsgen)) @@ -3655,10 +3666,22 @@ static int rx_macro_remove(struct platform_device *pdev) } static const struct of_device_id rx_macro_dt_match[] = { - { .compatible = "qcom,sc7280-lpass-rx-macro" }, - { .compatible = "qcom,sm8250-lpass-rx-macro" }, - { .compatible = "qcom,sm8450-lpass-rx-macro" }, - { .compatible = "qcom,sc8280xp-lpass-rx-macro" }, + { + .compatible = "qcom,sc7280-lpass-rx-macro", + .data = (void *)RX_MACRO_FLAG_HAS_NPL_CLOCK, + + }, { + .compatible = "qcom,sm8250-lpass-rx-macro", + .data = (void *)RX_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8450-lpass-rx-macro", + .data = (void *)RX_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8550-lpass-rx-macro", + }, { + .compatible = "qcom,sc8280xp-lpass-rx-macro", + .data = (void *)RX_MACRO_FLAG_HAS_NPL_CLOCK, + }, { } }; MODULE_DEVICE_TABLE(of, rx_macro_dt_match); From patchwork Fri Mar 10 13:21:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 662369 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42305C64EC4 for ; Fri, 10 Mar 2023 13:26:09 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CFA0118B0; Fri, 10 Mar 2023 14:25:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CFA0118B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678454766; bh=CdNzpbrWaNp1dInazO8/AaWnjW3KfJ9478c/Ed32D2A=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=vUycRJvFTaA8LzCGj8snDgDBSGuHQyG2K+jxYDhOTbcWot+ECdvk2kY0+DjJ4p3up Gf/aDP+onMiq3ryOiWlwz6opwq3Nj99Nm0UeBF2luph20THmxnF0ky9HbVeFu8YPIS gskX14YxbfSPtau5raGODfnCrFf59qrGRDUouqKc= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D821EF804B1; Fri, 10 Mar 2023 14:24:31 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59EF2F8042F; Fri, 10 Mar 2023 14:24:28 +0100 (CET) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5ADE0F80527 for ; Fri, 10 Mar 2023 14:22:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5ADE0F80527 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=EcdkKLJy Received: by mail-ed1-x52d.google.com with SMTP id x3so20274254edb.10 for ; Fri, 10 Mar 2023 05:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678454528; 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=6QzRJBCNcVjpu9L/kbF+2hC2cCPihdtDKgQqCKfLkPA=; b=EcdkKLJy1nTwum3RcqOoQuWYwXOTfdJDBoXZoGlsPRz+RQifnrYVz1k/AIC2yTH3kP PAnmohk20qiWOFcy52MPyBSEA3vRZhnu8a5EeLBWp2HO/jdushRsRoeblC62wseZHmj2 AM/FT1KNCO8+4297rMkrfXyiFq51CbIERRp9royKeNIyfQ+C9mfQC2zjKXJoZFZdkfsk uLacUsy4mT9wFeo+mkYzixlOb05jWpBvrwxzbXGfg9BDanjJTT0Xm7Ze0FRkU6eX0u0K fe5zG01Nf/6Z/JRGzEapBHPsrftvvqUAcHyubUDAYc7IcugdLCH/6n4nGKfmVrRZFHTY 02LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454528; 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=6QzRJBCNcVjpu9L/kbF+2hC2cCPihdtDKgQqCKfLkPA=; b=H5Ih7WFd3vJR7KZEgQGf1uB3R0Ig/5ilNfkwepB2kGH7S7OZP51rDYCkV0hL/WGJVF 1EzqRlxUhBGqBIe2OS0G2/kGUAXmSk6LpO1cIDlEbjpB67sHi0yWIxoFrgsy+6ADT8Ia lv/u7bp2PIpAffWvLA+qTeXC6jNSfBIWKxOBkvH20xRMEchlff58wPcGo9vK9hC44Yn8 GFTeV1ylUWJ4QJXz3oOwsoFE6+IHHYK0xLxFabO4y+KQ5nvM46fYq+BfpJsqev5sgW9y NqbamNTRMhdxm4dvY+lgMGb1VBrvr+taEKHyXdeaR9775Gk1Sf3yqQGkfkE5HfPOm4B9 1+2Q== X-Gm-Message-State: AO0yUKUDJ9Lua+YHZXtk22kzaZeFi7ujf0+N9vZngGWSVlTSfrxqQYbo JGI4SQ8KCvSh/h3zG9bWTu6zdA== X-Google-Smtp-Source: AK7set99KdhfosHhNhcHm7ZbsjvUuuCLY5QJ01+eSjocVmVnePPGrExvdnFHezzFcBtWwDhU9Pon7g== X-Received: by 2002:a17:907:787:b0:8b1:7de3:cfb0 with SMTP id xd7-20020a170907078700b008b17de3cfb0mr32023701ejb.2.1678454528466; Fri, 10 Mar 2023 05:22:08 -0800 (PST) Received: from krzk-bin.. ([2a02:810d:15c0:828:45c4:46be:ec71:4a51]) by smtp.gmail.com with ESMTPSA id zc4-20020a170906988400b008b17879ec95sm959124ejb.22.2023.03.10.05.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:22:08 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/9] ASoC: dt-bindings: qcom, lpass-tx-macro: narrow clocks per variants Date: Fri, 10 Mar 2023 14:21:56 +0100 Message-Id: <20230310132201.322148-5-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> References: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: FWZCTVBJ6UTA6O7F6OBU3VMOF7HEOUWP X-Message-ID-Hash: FWZCTVBJ6UTA6O7F6OBU3VMOF7HEOUWP X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Currently the Qualcomm TX macro codec binding allows two different clock setups - with (for ADSP) and without macro/dcodec entries (for ADSP bypassed). With more devices coming soon, this will keep growing, thus rework the clocks/clock-names to be specific for each binding. Signed-off-by: Krzysztof Kozlowski --- .../bindings/sound/qcom,lpass-tx-macro.yaml | 63 ++++++++++++++----- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml index da5f70910da5..559da2509d8d 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml @@ -9,9 +9,6 @@ title: LPASS(Low Power Audio Subsystem) TX Macro audio codec maintainers: - Srinivas Kandagatla -allOf: - - $ref: dai-common.yaml# - properties: compatible: enum: @@ -30,22 +27,12 @@ properties: const: 0 clocks: - oneOf: - - maxItems: 3 - - maxItems: 5 + minItems: 3 + maxItems: 5 clock-names: - oneOf: - - items: #for ADSP based platforms - - const: mclk - - const: npl - - const: macro - - const: dcodec - - const: fsgen - - items: #for ADSP bypass based platforms - - const: mclk - - const: npl - - const: fsgen + minItems: 3 + maxItems: 5 clock-output-names: maxItems: 1 @@ -67,6 +54,48 @@ required: - reg - "#sound-dai-cells" +allOf: + - $ref: dai-common.yaml# + - if: + properties: + compatible: + enum: + - qcom,sc7280-lpass-tx-macro + then: + properties: + clock-names: + oneOf: + - items: #for ADSP based platforms + - const: mclk + - const: npl + - const: macro + - const: dcodec + - const: fsgen + - items: #for ADSP bypass based platforms + - const: mclk + - const: npl + - const: fsgen + + - if: + properties: + compatible: + enum: + - qcom,sc8280xp-lpass-tx-macro + - qcom,sm8250-lpass-tx-macro + - qcom,sm8450-lpass-tx-macro + then: + properties: + clocks: + minItems: 5 + maxItems: 5 + clock-names: + items: + - const: mclk + - const: npl + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false examples: From patchwork Fri Mar 10 13:21:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 661692 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8D4EC64EC4 for ; Fri, 10 Mar 2023 13:24:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3177E17ED; Fri, 10 Mar 2023 14:23:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3177E17ED DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678454650; bh=5gHnFM4rOILAVgKBZEHdZoPHi9yJjJVg8IX+esrrYSc=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Q+DjjMSUJ3iy8irUwv/EUjWbA150FV/kZ9xgZDxbvRB7kpAwmw3fnJBUFzPRABQzy eSIxMj0e4qJ8mmNp7wWodIsODCZSLQpQlvTIIcbj/HxKnIOWNNSel9xrSjikfmYIYi UXGx75tdtHEkJ20LrxpNK8tnhy95XXcdkQWOv/zo= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 70298F8052E; Fri, 10 Mar 2023 14:22:41 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 12687F80520; Fri, 10 Mar 2023 14:22:17 +0100 (CET) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 39627F8042F for ; Fri, 10 Mar 2023 14:22:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 39627F8042F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=oLwGVvsu Received: by mail-ed1-x534.google.com with SMTP id a25so20525575edb.0 for ; Fri, 10 Mar 2023 05:22:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678454529; 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=fDF0ZYXFDOllcKLsEzC0jJ5Ov6N9QuMsH10mVyhVQIQ=; b=oLwGVvsu4v/dczo8heTsQZTwVOKSatJ3guqetRKyIQUX0n+ilG+gjQ5StwZyfWd6Je ujoIULrFgb9ww6EtVZW332WURx5ePBT4fcrA6sb27dFmxxWQed5S80gDXdb+MmvOrTCv GtwGtcpS24mXGMserupwBs8l1e4X6PeV2x3C/PP6d131xKEdjZjB1VxAG/NZQJlFmq8E nh2rf+rCKWMz6TfrAJgtpoHYHYsKx2dn6Bz/VbHN96Lw+RruQJTNBPlSbp0QZRLgHKdx K8h7EpwJQxAlKggQUO5i/bgYylQv2h3J3Z7x+RSIQSRY75S7YosyQZHzrKArqjxfuT9f lH9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454529; 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=fDF0ZYXFDOllcKLsEzC0jJ5Ov6N9QuMsH10mVyhVQIQ=; b=7k2Cxt429kKxtYqcKPsg5tMn9OjHLS3eNFE8gp6TPDF8+BrOKOARIkd84yaK8BwIMg GrN2rBJxmau+Kar1MTXHXW4XipD2Tykh+I9DFX4raWdtFJ/UUKQqQF4oLFQjbNT/dADS GNNhAiVBldSsgYNAxFV4EAXIACcTgx2HWzjHOACVxuUAR5rcKBXYzyzrF6moya48BDZd BFG+OaUQynMlEri/jEOqmHV3x+LQW8zauJbqYrQpgeNsop8jKhb3QTH5E2Y/l8r59yF9 SaRswk0gic8BoRzqlaUdBU4jAkydrV+AS9V/frcZTdNwt4G4HQfZVHjBtlyIX73ohGTo /3dw== X-Gm-Message-State: AO0yUKXewCHlV+kLxsqkLt5PG6I7Y1RyS3xxWsnQWwfMaHl/dW01Rk8I kHRC0cafQTvOYIHKxKA6o1cS0w== X-Google-Smtp-Source: AK7set89Qn/1m1aeZv+N9sciSUxqSHuGksR73sKrN3UIa/BGEEosLsI4sUmNPKBLS69d2ARaCBE5wg== X-Received: by 2002:a17:907:7244:b0:8b1:78b6:bbd7 with SMTP id ds4-20020a170907724400b008b178b6bbd7mr31804262ejc.10.1678454529523; Fri, 10 Mar 2023 05:22:09 -0800 (PST) Received: from krzk-bin.. ([2a02:810d:15c0:828:45c4:46be:ec71:4a51]) by smtp.gmail.com with ESMTPSA id zc4-20020a170906988400b008b17879ec95sm959124ejb.22.2023.03.10.05.22.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:22:09 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/9] ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM8550 TX macro Date: Fri, 10 Mar 2023 14:21:57 +0100 Message-Id: <20230310132201.322148-6-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> References: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: DIFQ7V3WWRPOZHY2VLIICQKJHIWEQMPN X-Message-ID-Hash: DIFQ7V3WWRPOZHY2VLIICQKJHIWEQMPN X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add the TX macro codec on Qualcomm SM8550, which comes without NPL clock exposed. Signed-off-by: Krzysztof Kozlowski --- .../bindings/sound/qcom,lpass-tx-macro.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml index 559da2509d8d..9d6e67524daf 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml @@ -15,6 +15,7 @@ properties: - qcom,sc7280-lpass-tx-macro - qcom,sm8250-lpass-tx-macro - qcom,sm8450-lpass-tx-macro + - qcom,sm8550-lpass-tx-macro - qcom,sc8280xp-lpass-tx-macro reg: @@ -96,6 +97,23 @@ allOf: - const: dcodec - const: fsgen + - if: + properties: + compatible: + enum: + - qcom,sm8550-lpass-tx-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false examples: From patchwork Fri Mar 10 13:21:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 662370 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DABA7C64EC4 for ; Fri, 10 Mar 2023 13:25:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A5BAA1836; Fri, 10 Mar 2023 14:24:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A5BAA1836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678454729; bh=zfFFRq1UmL7fjSU/hb8ET4L33KIhj0qxtpThVfgGcRE=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Cty1nysWhHN0s5ubeBQz8qCvp95xbA0WhixfgRekEaE+hRyYJGabVxXB5p35RFenh Z/6KCZ2/sEfTJIwe3EZZVat0NuI39Xc2QJZMufY7DmzMaCGTvmWtOhyZkpSq/DXbGF Iq25a5DgYm6iSfJHA3GYGhcvoP5DXHNdfz7IMUvQ= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 645A2F80579; Fri, 10 Mar 2023 14:22:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 28DA3F8052E; Fri, 10 Mar 2023 14:22:26 +0100 (CET) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8D2AFF804B1 for ; Fri, 10 Mar 2023 14:22:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8D2AFF804B1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JgavJRWV Received: by mail-ed1-x536.google.com with SMTP id da10so20409480edb.3 for ; Fri, 10 Mar 2023 05:22:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678454530; 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=7wB+ZDQLED1lfGjvfm20Sk8PslUquOiz9jmctspNl1k=; b=JgavJRWVjXavsT+LNLiKq8j4sHA3egVc/3wVlar/9dWGpeoo98SDPex1hMfV7pY5yf 1ApuU822yhrebDtqVjYVKjz47l5hI0TdWfGiwEZapkXovmwUIYYl68blWk6e4mt71rcu gsdPePIHs1SGdDvQ7FH47ttAJ7julhHo1vkjhLXQbuB5DxVqX9s2palK3XkyV1Y14U/G 9of8H0ZcpX3/4gnnZeWp5U+L9dLQeCUUUg6tf1JW4TCcjedsfUgNiduvAGRq36N25YwB foicPk1df44T0zPT4m2SYXjH/VF2uumUZRbCFNAUV/qLB6NhWGe55n4ADar+apYuxcrW Ayhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454530; 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=7wB+ZDQLED1lfGjvfm20Sk8PslUquOiz9jmctspNl1k=; b=TM9Z1sVlLGsxRCaWUHeGrehx78x9+zAF1DFK+CNSkRVTu75YO1I5NtpPcrJDdHIVLr QYvi1jqgB/DI7WyUegGuKCo5mwKlTiZczBTt9Lh403IUhqOMH31PEPRfqq1okQaba2zj c/Ee6Omu3z2ense2nt3htLPnU3XNqkeXCLLE0UToAV+yU04W/fiZNcYLQymuVCxAKrFL REXOGp/HLVgXEQexvVla1oOvGxkp0/g+8o1qqH6Lgy+ZrAzHUMLeGiK4hLUoMM6REMJr 0vbLaqTdWy6DiSXh7D5Y8GX77kv2DHPqET4eQAOs+iVMG/AAXermP8lYOyxz6MW2+xH9 v29Q== X-Gm-Message-State: AO0yUKXCQBRiEsx8pvhNUSTvtantLIcjZF/NmSDoTV2AxAWb1pwNF8KX 2V+5rG9JnhXPQOUt1VBGH/j2Dg== X-Google-Smtp-Source: AK7set+PxUyg5gMa34e3JPIVei4cJk2opNLH6ajC/YSQ9yp4xl5ntn+cwfyczNMHa6C+1F4RH8fehg== X-Received: by 2002:a17:906:28d3:b0:8b2:3eb6:8661 with SMTP id p19-20020a17090628d300b008b23eb68661mr23663069ejd.8.1678454530577; Fri, 10 Mar 2023 05:22:10 -0800 (PST) Received: from krzk-bin.. ([2a02:810d:15c0:828:45c4:46be:ec71:4a51]) by smtp.gmail.com with ESMTPSA id zc4-20020a170906988400b008b17879ec95sm959124ejb.22.2023.03.10.05.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:22:10 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/9] ASoC: codecs: lpass-tx-macro: add support for SM8550 Date: Fri, 10 Mar 2023 14:21:58 +0100 Message-Id: <20230310132201.322148-7-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> References: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: AAV2CT6LBO4AG22CEVJFEO7JL7GVQME6 X-Message-ID-Hash: AAV2CT6LBO4AG22CEVJFEO7JL7GVQME6 X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add support for the TX macro codec on Qualcomm SM8550. SM8550 does not use NPL clock, thus add flags allowing to skip it. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/lpass-tx-macro.c | 38 ++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index 473d3cd39554..23371b21505e 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -205,6 +205,9 @@ #define TX_MACRO_AMIC_HPF_DELAY_MS 300 #define MCLK_FREQ 19200000 +/* NPL clock is expected */ +#define TX_MACRO_FLAG_HAS_NPL_CLOCK BIT(0) + enum { TX_MACRO_AIF_INVALID = 0, TX_MACRO_AIF1_CAP, @@ -1915,7 +1918,10 @@ static int tx_macro_register_mclk_output(struct tx_macro *tx) struct clk_init_data init; int ret; - parent_clk_name = __clk_get_name(tx->npl); + if (tx->npl) + parent_clk_name = __clk_get_name(tx->npl); + else + parent_clk_name = __clk_get_name(tx->mclk); init.name = clk_name; init.ops = &swclk_gate_ops; @@ -1946,10 +1952,13 @@ static int tx_macro_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; + kernel_ulong_t flags; struct tx_macro *tx; void __iomem *base; int ret, reg; + flags = (kernel_ulong_t)device_get_match_data(dev); + tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL); if (!tx) return -ENOMEM; @@ -1966,9 +1975,11 @@ static int tx_macro_probe(struct platform_device *pdev) if (IS_ERR(tx->mclk)) return PTR_ERR(tx->mclk); - tx->npl = devm_clk_get(dev, "npl"); - if (IS_ERR(tx->npl)) - return PTR_ERR(tx->npl); + if (flags & TX_MACRO_FLAG_HAS_NPL_CLOCK) { + tx->npl = devm_clk_get(dev, "npl"); + if (IS_ERR(tx->npl)) + return PTR_ERR(tx->npl); + } tx->fsgen = devm_clk_get(dev, "fsgen"); if (IS_ERR(tx->fsgen)) @@ -2145,10 +2156,21 @@ static const struct dev_pm_ops tx_macro_pm_ops = { }; static const struct of_device_id tx_macro_dt_match[] = { - { .compatible = "qcom,sc7280-lpass-tx-macro" }, - { .compatible = "qcom,sm8250-lpass-tx-macro" }, - { .compatible = "qcom,sm8450-lpass-tx-macro" }, - { .compatible = "qcom,sc8280xp-lpass-tx-macro" }, + { + .compatible = "qcom,sc7280-lpass-tx-macro", + .data = (void *)TX_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8250-lpass-tx-macro", + .data = (void *)TX_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8450-lpass-tx-macro", + .data = (void *)TX_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8550-lpass-tx-macro", + }, { + .compatible = "qcom,sc8280xp-lpass-tx-macro", + .data = (void *)TX_MACRO_FLAG_HAS_NPL_CLOCK, + }, { } }; MODULE_DEVICE_TABLE(of, tx_macro_dt_match); From patchwork Fri Mar 10 13:21:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 661690 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CC53C6FA99 for ; Fri, 10 Mar 2023 13:25:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 843BC1865; Fri, 10 Mar 2023 14:24:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 843BC1865 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678454713; bh=ima4IHqVZOJfDwanAmncSDMCsvurQ0bgCKhXhaTy4Ss=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VYohySt+IYLRFvzD1SG8VgwvnE0pGnMFqrHIGA6V76m1ka6DmPI58xftahGh3ZBQp 7avsJ7umA0fnrlOWJdMbdC9eRZyywxewaiz6Ie81vsmEIAIGp7sCc4WVGglBavNv+h MRZcoThXLn3jVAUaLmqz/p4vULbeGtmv0XnaN3zU= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8716EF8055C; Fri, 10 Mar 2023 14:22:48 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C4718F80533; Fri, 10 Mar 2023 14:22:23 +0100 (CET) Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4C779F80431 for ; Fri, 10 Mar 2023 14:22:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4C779F80431 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=RER2Rx5g Received: by mail-ed1-x531.google.com with SMTP id ay14so20251995edb.11 for ; Fri, 10 Mar 2023 05:22:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678454531; 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=goKtutnQ2PFd8NfCZ2pE04cCvKUKzYAaQ26RIq4NWcQ=; b=RER2Rx5gJ5R+wduk0rXzfE5ryA2rbohjb7XXb5g/kkl2V2gOITdv2x91WBUBe7GyZu gzQbl+KyFVnkjtsfyt9c8aTcZ18c1l+o5RLpBbGD68Ni62VRCbISEs5sNNCcsi+36g4f 2vVyUQ1J6lHFysa2mx7T/qGJ+l0ANCp4QCkyc0QDHgTG5l7m32OikC7JGiDQLVYgfyCH XjJe4M3wPRViScfkziAQb7/3RSrIi3jjT8TWv2XSG1eOnKcUU5ncO7NE6gh93BC8K+lC CFJiG/yjDHOOGiz9uglm9l8ev1HtlL2Y2sK6FaFJcbDq30igz/dR79IR18o3dXzc3Ke9 /7Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454531; 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=goKtutnQ2PFd8NfCZ2pE04cCvKUKzYAaQ26RIq4NWcQ=; b=uA63UZc9jDeS78g66R8v/ElMLcIR9X8u9cL3otOCZLWlhEf7ohIXB3f1JEM85Y3v8p 19+zCyktjB4+uOV4dtdmaG69xsjtpO3s7Wm0uOdhyXNSmtpWGCpQ/HHlMUoQCDB1jjTS W0wQ7gA6PylqjdGEDTUFNIsEILU4kuzh3SoHf9tco4Gdk4hD/kE0UaNOZs9QgE31VpU8 JN2GJ9t+HB8OwyNjw7TlNOo7Apg9P6zx44UjcYKcerIuuEiduElo3xzYKhsRDuWhwora lPuKmDnCZTDRrbNpZSvYzfXaDZxay6m33zPN/4Jvc4ee2tqQFu9wNWEKCbhQ5JgJulI6 mkVA== X-Gm-Message-State: AO0yUKVffyRvZN6eFUDVlNvWrtZymuboV9qgMYltiN89UbaP5R7/W/Tt uVAztrat/2+mZmDo4d+Xi+M5hg== X-Google-Smtp-Source: AK7set/7m+fKbY/1jI+CUKTq8FToiMZNX8tVAOxvsseLOOiw8ysUD1u+jkKI1OdVBofqe2vcOObR+g== X-Received: by 2002:a17:906:1ed1:b0:8e9:6f9f:7c2d with SMTP id m17-20020a1709061ed100b008e96f9f7c2dmr1874600ejj.35.1678454531631; Fri, 10 Mar 2023 05:22:11 -0800 (PST) Received: from krzk-bin.. ([2a02:810d:15c0:828:45c4:46be:ec71:4a51]) by smtp.gmail.com with ESMTPSA id zc4-20020a170906988400b008b17879ec95sm959124ejb.22.2023.03.10.05.22.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:22:11 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/9] ASoC: dt-bindings: qcom,lpass-va-macro: Add SM8550 VA macro Date: Fri, 10 Mar 2023 14:21:59 +0100 Message-Id: <20230310132201.322148-8-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> References: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: L6I4IM3YGFUWT7P56OFBUBMSLQUU2J36 X-Message-ID-Hash: L6I4IM3YGFUWT7P56OFBUBMSLQUU2J36 X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add the VA macro codec on Qualcomm SM8550, which comes without NPL clock exposed. Signed-off-by: Krzysztof Kozlowski --- Depends on: https://lore.kernel.org/r/20221118071849.25506-2-srinivas.kandagatla@linaro.org --- .../bindings/sound/qcom,lpass-va-macro.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml index 528b677a439c..4a56108c444b 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml @@ -15,6 +15,7 @@ properties: - qcom,sc7280-lpass-va-macro - qcom,sm8250-lpass-va-macro - qcom,sm8450-lpass-va-macro + - qcom,sm8550-lpass-va-macro - qcom,sc8280xp-lpass-va-macro reg: @@ -110,6 +111,23 @@ allOf: - const: dcodec - const: npl + - if: + properties: + compatible: + contains: + enum: + - qcom,sm8550-lpass-va-macro + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + unevaluatedProperties: false examples: From patchwork Fri Mar 10 13:22:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 662371 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E5BAC64EC4 for ; Fri, 10 Mar 2023 13:24:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 676A11897; Fri, 10 Mar 2023 14:24:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 676A11897 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678454696; bh=fKbiEXDschISZbDjW6hzu3bB/M7LVonJ1Y9FKmZPDpU=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=c3WcsJUl5ktmXTbew6BN8UcqbFnW633F/SDTK9xXsaYd8VFaBitFePN89FA7Eb87X TcIwBDfB2d1HSli81oh6GJ3rq9FiJOCEIj3CfQlakbLimRHSC92Y7TPkwOWdjLezhq BfJfTUStts3JIpMWwAiww5L/Nyj3FdgzAp2BHgEY= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 126C9F80557; Fri, 10 Mar 2023 14:22:46 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E333FF80534; Fri, 10 Mar 2023 14:22:22 +0100 (CET) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 28154F80236 for ; Fri, 10 Mar 2023 14:22:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 28154F80236 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JlQDMdsr Received: by mail-ed1-x529.google.com with SMTP id u9so20408812edd.2 for ; Fri, 10 Mar 2023 05:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678454532; 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=xZM2NPsZ49ia+Dqe6wkMeZpgWpRvBEKr1bmuDVGwMmU=; b=JlQDMdsrzCaAUa+EGwPt5baDL9e2sGUjcXtUdJmMtd7LdVysOe++LpLVZR62ZYEocf GGVu0LPvWKnC66Cv9zwZp3AKNIEU1IsV+efkj4Zdhpi1Qn705w49uz4Qt4ogxN68cuty 0btX2P47p6t+EP6BHBkWAX6XjqGKRBGaLunRWDvwsqanUk9dOf8jvcK9ViDIqNgwdom1 k4NSndhZRy4ftXOedg/VJHgTL8ZCB6pJHn7t6u1DrjNOUZWGxzBqnHKGkXTE5Fh27rvy b55y67Vv7B4MpMRYC+WHN+xQMbxaIMYtq4vueu0BPH6BTVqC6/qOMmKfnBkrNYJvSt06 0T8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454532; 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=xZM2NPsZ49ia+Dqe6wkMeZpgWpRvBEKr1bmuDVGwMmU=; b=8LZAqucyxjxAAJVKjG79o806Rkvf2d9c8fsPviWlNWoze9qxeqJI+gsXfuAK1t1dSs /J22hsXc3T8qgiIqx7xMgNl9umxudDtiV2VpvlmcvjS658CLWGO5UPOsNZA89QgY6WXa JcHrB/v5XJoyywKKddtY4PZpy8Zm4QuBkD3mVH8cjgpZZNO2XpxSwdZU/1Swl8iNova1 qfu6v6zmaxRBRtYpzs7GuTntHqH8hS0EixTXAh+Q40uyBdd8pVPmdRpswC/MpqvoepQn 02uOHukEnHZzmkS0jMDNFWtPQMUoPixT/aXAw8dSR476eBBlc7Cux+WDYyfKGqYKhFtX UH9g== X-Gm-Message-State: AO0yUKXTuj9K84G2VoLJuFm/jUuIrVVmXLLCnSoko4ZSoDj65+6fvvp8 42TOy48kJkDKmWV/EvL5NDi3qg== X-Google-Smtp-Source: AK7set8fTAqNDHmQ2vbdeXcsnUybj+MQE1TaFOBt/wDYcsvEaTyVp4p/mNTUNlPd4pLUH6uptZ5WVw== X-Received: by 2002:a17:906:30d3:b0:878:7291:d558 with SMTP id b19-20020a17090630d300b008787291d558mr23731297ejb.34.1678454532716; Fri, 10 Mar 2023 05:22:12 -0800 (PST) Received: from krzk-bin.. ([2a02:810d:15c0:828:45c4:46be:ec71:4a51]) by smtp.gmail.com with ESMTPSA id zc4-20020a170906988400b008b17879ec95sm959124ejb.22.2023.03.10.05.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:22:12 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/9] ASoC: dt-bindings: qcom,lpass-wsa-macro: Add SM8550 WSA macro Date: Fri, 10 Mar 2023 14:22:00 +0100 Message-Id: <20230310132201.322148-9-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> References: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: FVQ7KQNJGPNZUJQQXFVXPZLTZQ7AITU3 X-Message-ID-Hash: FVQ7KQNJGPNZUJQQXFVXPZLTZQ7AITU3 X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add the WSA macro codec on Qualcomm SM8550, which comes without NPL clock exposed. Signed-off-by: Krzysztof Kozlowski --- .../bindings/sound/qcom,lpass-wsa-macro.yaml | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml index 66cbb1f5e31a..eea7609d1b33 100644 --- a/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml @@ -15,6 +15,7 @@ properties: - qcom,sc7280-lpass-wsa-macro - qcom,sm8250-lpass-wsa-macro - qcom,sm8450-lpass-wsa-macro + - qcom,sm8550-lpass-wsa-macro - qcom,sc8280xp-lpass-wsa-macro reg: @@ -27,11 +28,11 @@ properties: const: 0 clocks: - minItems: 5 + minItems: 4 maxItems: 6 clock-names: - minItems: 5 + minItems: 4 maxItems: 6 clock-output-names: @@ -62,6 +63,7 @@ allOf: then: properties: clocks: + minItems: 5 maxItems: 5 clock-names: items: @@ -89,6 +91,23 @@ allOf: - const: va - const: fsgen + - if: + properties: + compatible: + enum: + - qcom,sm8550-lpass-wsa-macro + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: mclk + - const: macro + - const: dcodec + - const: fsgen + unevaluatedProperties: false examples: From patchwork Fri Mar 10 13:22:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 661689 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7FB4BC64EC4 for ; Fri, 10 Mar 2023 13:25:47 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 75F161890; Fri, 10 Mar 2023 14:24:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 75F161890 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678454745; bh=lz2C99wGv9Zk6fTFTeThPE/xxBmJoI/1pA86udLB1PA=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Kk+9fgK7fsSeIEHAX43zcZMvutMgqp4Xv8mc0vDuJx8FCskK4a1jrJ6YIhcLPTVUp H5iN27Z3bEkfEmXgdrIhIlpM9UHwe9dslJ88JzLZv4Z3OAJNimhC9Elx6KC8qPNZ+O xEGSM3UMGmzX1kuunzfPXSPap4uwyPXsz2z15tJM= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id EEBF2F8057C; Fri, 10 Mar 2023 14:22:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4B4FFF804B1; Fri, 10 Mar 2023 14:22:28 +0100 (CET) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2F927F8051B for ; Fri, 10 Mar 2023 14:22:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2F927F8051B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JIQkZtAp Received: by mail-ed1-x530.google.com with SMTP id s11so20331458edy.8 for ; Fri, 10 Mar 2023 05:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678454533; 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=YeDnl6eYe/Y1WHUjjQBiVQQ785HgKzOroIPYymGFtHY=; b=JIQkZtApYvCbzbSNsLyjszUm5ZltrUAYgrhR6dsl+1X2fMEMD5287v3iMgZKLL/Gf7 1BV3eBn4craIdBuyzofyeHhHj4SyBwaiKGMaThJ6TaL6ebqGjkqIPH2JmFPhO5bVwDWc Ha4GehtuYrC8GzMn0y3zAZ6CLKE+w0WBxmwunF4nFRataYTPmTuncSHXq5ONUyledlhP To+7ypxXaKOcFwWjQtVdF9L0/m3wQk0Hp/DAW7DmDGyMZ87LCKvPJ+o0KbNAMdhDfLBa jNyTrjph1qtpbtVEFbjIFiMnwoVoYiE85g5+0Es9nDL7Z+ld0Dl3IuNdfCE3MdaotvKp Ox9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678454533; 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=YeDnl6eYe/Y1WHUjjQBiVQQ785HgKzOroIPYymGFtHY=; b=eZiecvUUUNlUxnH6Av2UUZUjlRdaELoT0TGQkp5Q5XcZ1Po02gKczlUKufqfHLQg3g E7EW6oWqYHV+lJAeu8xu9vY0eCLGs5GQ3HUx1OKTzoGHFdoxAjLTq+QzwlO7MRpO3Il5 Huux4H5shqNxwr9AhlqH0pQE54aNaSfaUL1KZQa0WDaZhyErUijWc2PsSkBY3wfPtw33 GF+bNdA4/posUlc4BeI8Bo1mo1V+8nYjEDSktvoPknCrQZUD/YzPqB+PxHa0fhlT2cUQ 0+BN1eP8AOK+N8QsWdnze5R0Qm4J0/vM0sHU9msRVmXWnmoEig9bcYYfbhycy35XtDIY zKQw== X-Gm-Message-State: AO0yUKV/2HNGc1AP6VWZVS+4dSVMQQd0DFc9pzPABPc1+hfRM0SjCqE9 0oJqGVxd5kEG1tLnFvPkWzpldA== X-Google-Smtp-Source: AK7set88AkgWffk6HYNIFQUMvmQ8KVcmU2jML2j4j71jiqRgBFuHLjnjJU1DOFwTomCcbkWOutVKgA== X-Received: by 2002:a17:907:3f23:b0:84d:4e4f:1f85 with SMTP id hq35-20020a1709073f2300b0084d4e4f1f85mr33780491ejc.59.1678454533717; Fri, 10 Mar 2023 05:22:13 -0800 (PST) Received: from krzk-bin.. ([2a02:810d:15c0:828:45c4:46be:ec71:4a51]) by smtp.gmail.com with ESMTPSA id zc4-20020a170906988400b008b17879ec95sm959124ejb.22.2023.03.10.05.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 05:22:13 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 9/9] ASoC: codecs: lpass-wsa-macro: add support for SM8550 Date: Fri, 10 Mar 2023 14:22:01 +0100 Message-Id: <20230310132201.322148-10-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> References: <20230310132201.322148-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: UP4KPRBIQUNSBJSEF7YTIXYCJHCQFFBA X-Message-ID-Hash: UP4KPRBIQUNSBJSEF7YTIXYCJHCQFFBA X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add support for the WSA macro codec on Qualcomm SM8550. SM8550 does not use NPL clock, thus add flags allowing to skip it. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla --- sound/soc/codecs/lpass-wsa-macro.c | 38 +++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c index ba7480f3831e..5155362de111 100644 --- a/sound/soc/codecs/lpass-wsa-macro.c +++ b/sound/soc/codecs/lpass-wsa-macro.c @@ -246,6 +246,9 @@ #define WSA_MACRO_EC_MIX_TX1_MASK 0x18 #define WSA_MACRO_MAX_DMA_CH_PER_PORT 0x2 +/* NPL clock is expected */ +#define WSA_MACRO_FLAG_HAS_NPL_CLOCK BIT(0) + enum { WSA_MACRO_GAIN_OFFSET_M1P5_DB, WSA_MACRO_GAIN_OFFSET_0_DB, @@ -2346,7 +2349,10 @@ static int wsa_macro_register_mclk_output(struct wsa_macro *wsa) struct clk_init_data init; int ret; - parent_clk_name = __clk_get_name(wsa->npl); + if (wsa->npl) + parent_clk_name = __clk_get_name(wsa->npl); + else + parent_clk_name = __clk_get_name(wsa->mclk); init.name = "mclk"; of_property_read_string(dev_of_node(dev), "clock-output-names", @@ -2379,9 +2385,12 @@ static int wsa_macro_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct wsa_macro *wsa; + kernel_ulong_t flags; void __iomem *base; int ret; + flags = (kernel_ulong_t)device_get_match_data(dev); + wsa = devm_kzalloc(dev, sizeof(*wsa), GFP_KERNEL); if (!wsa) return -ENOMEM; @@ -2398,9 +2407,11 @@ static int wsa_macro_probe(struct platform_device *pdev) if (IS_ERR(wsa->mclk)) return PTR_ERR(wsa->mclk); - wsa->npl = devm_clk_get(dev, "npl"); - if (IS_ERR(wsa->npl)) - return PTR_ERR(wsa->npl); + if (flags & WSA_MACRO_FLAG_HAS_NPL_CLOCK) { + wsa->npl = devm_clk_get(dev, "npl"); + if (IS_ERR(wsa->npl)) + return PTR_ERR(wsa->npl); + } wsa->fsgen = devm_clk_get(dev, "fsgen"); if (IS_ERR(wsa->fsgen)) @@ -2553,10 +2564,21 @@ static const struct dev_pm_ops wsa_macro_pm_ops = { }; static const struct of_device_id wsa_macro_dt_match[] = { - {.compatible = "qcom,sc7280-lpass-wsa-macro"}, - {.compatible = "qcom,sm8250-lpass-wsa-macro"}, - {.compatible = "qcom,sm8450-lpass-wsa-macro"}, - {.compatible = "qcom,sc8280xp-lpass-wsa-macro" }, + { + .compatible = "qcom,sc7280-lpass-wsa-macro", + .data = (void *)WSA_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8250-lpass-wsa-macro", + .data = (void *)WSA_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8450-lpass-wsa-macro", + .data = (void *)WSA_MACRO_FLAG_HAS_NPL_CLOCK, + }, { + .compatible = "qcom,sm8550-lpass-wsa-macro", + }, { + .compatible = "qcom,sc8280xp-lpass-wsa-macro", + .data = (void *)WSA_MACRO_FLAG_HAS_NPL_CLOCK, + }, {} }; MODULE_DEVICE_TABLE(of, wsa_macro_dt_match);