From patchwork Fri Jan 13 09:07:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 642140 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBF22C54EBD for ; Fri, 13 Jan 2023 09:11:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241102AbjAMJLA (ORCPT ); Fri, 13 Jan 2023 04:11:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240754AbjAMJKW (ORCPT ); Fri, 13 Jan 2023 04:10:22 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A41073E29 for ; Fri, 13 Jan 2023 01:07:50 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id o20so255824lfk.5 for ; Fri, 13 Jan 2023 01:07:50 -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=aw+Ll8gA8CDi1Y7f1Cqn7fscIlNjH9PUmDYuMqv7naQ=; b=NP+jd3HDsMkWOG9vZclmMojbPQ4Vmq6Zpc2ekluLj+tMha9VLxvLwA4c6jhi+by46N 6EBuZXui4mIJuF5rAyur+sEYGq6T2ROyiret2vUcHDZrJ8FUw+nE6c9ZX95u6JX5Seo8 hDoKvGkoLsBVXK/TS07noOBN5qw6qDNOPqidhhTP103tFiWRRVDKagTGuEfSvEJcUzsi pRjXGSfvW4OMoky7ogaeD7vK/UyxBsEomtMpbPc3wtafqkUYymIs2YNvB8XVeFYC+nV3 K+Xomvzx/2mFtekEOhax5tBu3ggkSwjklWpWKHF+E1pMXmNyH9NwRzfqADy9UkMsYfUP 3/fw== 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=aw+Ll8gA8CDi1Y7f1Cqn7fscIlNjH9PUmDYuMqv7naQ=; b=7ViIE9/wcQjde0w0eLFsy7e8DQSuksyE10ryTE9K3ffort3y/p/K28n8p3TzUTK0fA RP0FzuAMoEq2oYJZrwpH15IHbrLIPB+fFOuF2/uq+zOPaaigPECUXXD5JwCG8hiPguir EiQSSbjY8335m2Cjd1LoZb38SPQ1YqCau9+qltv9Oq6M1WKElJeXsdYsNjGTf4Rm1fBp HG6zQYbmfUL8qOZSjWC2pAgWygmzNepSlS5qitJcLDwEof62b927dKTX5XNYs29H8dFm PsUBR8/3+X3ZbOd2y2LoOSMWQanZXf6XQFHUr3fu+WlrHjKJjRsqcKeI2MMtIU4kSeiQ +R0A== X-Gm-Message-State: AFqh2kqKsQDPPzQBsZScaAe4/3aZam8FdeURj7Iv1oxq8aYO/HThSRuO Fa+Cr8TSmBBESl/+6+oURYVe5Q== X-Google-Smtp-Source: AMrXdXselyV/UW7hbOvgzPFB9DfU664EPmewva7fCJNwkIwvUxBoxx1grYKqbnbK4lqJ9/huF8tK2Q== X-Received: by 2002:a05:6512:1087:b0:4d1:331:f6df with SMTP id j7-20020a056512108700b004d10331f6dfmr611512lfg.64.1673600868856; Fri, 13 Jan 2023 01:07:48 -0800 (PST) Received: from eriador.lumag.spb.ru ([194.204.33.9]) by smtp.gmail.com with ESMTPSA id d4-20020a05651233c400b004947a12232bsm3735296lfg.275.2023.01.13.01.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 01:07:48 -0800 (PST) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Stephen Boyd , Michael Turquette , Rob Herring , Krzysztof Kozlowski , Taniya Das Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 1/4] dt-bindings: mailbox: qcom: correct the list of platforms using clocks Date: Fri, 13 Jan 2023 11:07:36 +0200 Message-Id: <20230113090739.45805-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113090739.45805-1-dmitry.baryshkov@linaro.org> References: <20230113090739.45805-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Only three platforms require `pll' and `aux' clocks: msm8916, msm8939 and qcs404. Correct the list of platforms in the corresponding clause. Fixes: 0d17014e9189 ("dt-bindings: mailbox: Add binding for SDX55 APCS") Signed-off-by: Dmitry Baryshkov --- .../bindings/mailbox/qcom,apcs-kpss-global.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml index 943f9472ae10..b8a44ef0540f 100644 --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml @@ -71,15 +71,8 @@ allOf: compatible: enum: - qcom,msm8916-apcs-kpss-global - - qcom,msm8994-apcs-kpss-global - - qcom,msm8996-apcs-hmss-global - - qcom,msm8998-apcs-hmss-global + - qcom,msm8939-apcs-kpss-global - qcom,qcs404-apcs-apps-global - - qcom,sc7180-apss-shared - - qcom,sdm660-apcs-hmss-global - - qcom,sdm845-apss-shared - - qcom,sm6125-apcs-hmss-global - - qcom,sm8150-apss-shared then: properties: clocks: From patchwork Fri Jan 13 09:07:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 642716 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00D47C54EBE for ; Fri, 13 Jan 2023 09:11:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240754AbjAMJLB (ORCPT ); Fri, 13 Jan 2023 04:11:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241180AbjAMJKY (ORCPT ); Fri, 13 Jan 2023 04:10:24 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8806C73E2E for ; Fri, 13 Jan 2023 01:07:52 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id g13so32220268lfv.7 for ; Fri, 13 Jan 2023 01:07:52 -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=3eCp5P/TMVFbFTF7vzefqI/ZA2E3ZQFeIqWdTLT1Q4s=; b=HM8sx/v06ph5D8nBfI/gnRCdbBcGkRlz9G9eAMxhTOythqrp8URubU3w0Lgiz79WZw QNSsCo73Lii2SdrN5ybv5YUTWia9Ovm5suipcsjNOmN95vKh569rtoOW4wVE0LIBlUyd w9AalLd/3+ycJlKVD8/cgEDCSy+wrnEajMalxLhQM/QYQFVYFaNB9p8UHxbRmZ3S8UMX 6ZuZSat050V3jpP8J4VnBTZMuFnj5F1d6kiO0c45xwOUgjYVRyzlOTFkI+zqZi8jpE4e tBW4fE5JPPMgVSedwCJxFuzLWkRzmGL7+LwX1o3+OY7lOWcBN5u/gEUE2xMq5WLseUj+ zgQg== 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=3eCp5P/TMVFbFTF7vzefqI/ZA2E3ZQFeIqWdTLT1Q4s=; b=38f5erUvIVZslJF162xuU6Ore7z375RLAkzk9FBchOyloNOd+uVdTJcHmEdt66QJzg 2tFJd11Pt9RUGaCEEqB6RX/861CM0YE8/g4sa69+WB4c+TtaP/EeIL0Ut1Wu1Z1Mln9p cBbPerv3tWWZGI/UgTk54y9IGJ1z/smh6jNtVffmffBqoECvADH1G7zdsbC2xsrFpBFa +oeDFdsd7aub6PiU7BR+jzAA2rK8Pl3WVIB5eEKt0IrFsX7ZyGTs0fu9c/IoQaYZAynX oGQBDVABs19AqPAXOwNgEmR6Ag70PJRM+CRBPP/j346Jd2gBuVWf4LYGnk6QBhEoMcVZ v6hA== X-Gm-Message-State: AFqh2kr4ulO3vbRyYnfzEOp3F6oCnwHAkRGiqDC+k3Mi6uM7JAQo68DU bQkcEM1H2xdI7kzTwovuQTveuGdLc4mu1dmPfww= X-Google-Smtp-Source: AMrXdXvxZZm6392EWT1MaPSsii9UKpBAx3zLyhu7p6kipsBV5ZZLuiGSTGaIIxTXTP2frdfKnSVPOQ== X-Received: by 2002:a19:ac41:0:b0:4cb:3471:ab94 with SMTP id r1-20020a19ac41000000b004cb3471ab94mr9933151lfc.31.1673600870936; Fri, 13 Jan 2023 01:07:50 -0800 (PST) Received: from eriador.lumag.spb.ru ([194.204.33.9]) by smtp.gmail.com with ESMTPSA id d4-20020a05651233c400b004947a12232bsm3735296lfg.275.2023.01.13.01.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 01:07:50 -0800 (PST) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Stephen Boyd , Michael Turquette , Rob Herring , Krzysztof Kozlowski , Taniya Das Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/4] dt-bindings: mailbox: qcom: add #clock-cells to msm8996 example Date: Fri, 13 Jan 2023 11:07:37 +0200 Message-Id: <20230113090739.45805-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113090739.45805-1-dmitry.baryshkov@linaro.org> References: <20230113090739.45805-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add the #clock-cells property to the MSM8996 example, as the APCS block is going to provide the `sys_apcs_aux' clock to the consumers. Signed-off-by: Dmitry Baryshkov Acked-by: Krzysztof Kozlowski --- .../devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml index b8a44ef0540f..5e7c83345774 100644 --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml @@ -141,6 +141,7 @@ examples: reg = <0x9820000 0x1000>; #mbox-cells = <1>; + #clock-cells = <0>; }; rpm-glink { From patchwork Fri Jan 13 09:07:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 642139 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 404C0C678D9 for ; Fri, 13 Jan 2023 09:11:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241138AbjAMJLD (ORCPT ); Fri, 13 Jan 2023 04:11:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240969AbjAMJKZ (ORCPT ); Fri, 13 Jan 2023 04:10:25 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C6F97575C for ; Fri, 13 Jan 2023 01:07:53 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id b3so32213513lfv.2 for ; Fri, 13 Jan 2023 01:07:53 -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=60yxEW22hoAOOhOWGOTH5M2hZiABdMD97947KesUJto=; b=REXQMGrJIZiWEPdOgQHYLdJ9o+K2QMjcuaT+NTV+ebUUz4hhyPNl9sS599Q6Ybm7on LjFQxGfLaVPqPg5CNyr7pWxxYPYt99yLCFsnkoU0UH6WnbuqPHHNqSOjSYhwD74f3Lig Z2Kuvn5xMbIy8l7iXCZ8oWHZ4WxCyJE4Ztf6vAMucE4c8LRI9NlKyDiNeavPUhV+EnhX DjNYDvoFKcpxXdqP2jflY7yQYUHA1Kf0Wx5ozomvhedwtI5rIxe3Ws6ZwAjqPt/9SWOV RHO5xV2KDTI58qogbnCe2QuGJMEicSGwPyCEXB06Jls1QNS5SbT+XSuQQZXrrmouxgfy IHug== 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=60yxEW22hoAOOhOWGOTH5M2hZiABdMD97947KesUJto=; b=f5/hSDhF35YHolOPVhxaj1yhUdfl9SpkVjkZrmWpYGKqnaSVlz2PDmzQUzd4uWXm22 TorXMl8qLsiA3vcm6T8uAE7RHG8a21CgA+bfN49cgzjZeHbOQ9i168v3YJMgOIj3+CPo edc+WKcwrDMGTN0WtVxu+Z8QDxdFw+tYvr74RIsUwn71cQDAVpApWdYisJsUkD233X3D jfO4Ob7axfwN6/vw7FdczRerxBLP+DljKZxEKU5l0oU9HhClJrB7Jy5NZ6zLViKZzF5I fy3F4vIkYlXIQOVv/+fiGktefJIE69yNMAfjeYFOC3c7g1cOReg+goOvAhai1PfYeSOo DyFg== X-Gm-Message-State: AFqh2kpsl7569ol+YfUn6//VSHFjFZCKK0CLhJHmjcrArnnoswtNHNsk TPAPJpuS/Gzmeaq1Et2HdzWscw== X-Google-Smtp-Source: AMrXdXtXkDr/H6UigCTKrCgJk574+PyWuTRkf5tQWSma76n0kWaaeffJv22h2NdCvHUGDJNVy3Ixog== X-Received: by 2002:a05:6512:3051:b0:4b5:79ca:e62d with SMTP id b17-20020a056512305100b004b579cae62dmr32092348lfb.16.1673600872902; Fri, 13 Jan 2023 01:07:52 -0800 (PST) Received: from eriador.lumag.spb.ru ([194.204.33.9]) by smtp.gmail.com with ESMTPSA id d4-20020a05651233c400b004947a12232bsm3735296lfg.275.2023.01.13.01.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 01:07:52 -0800 (PST) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Stephen Boyd , Michael Turquette , Rob Herring , Krzysztof Kozlowski , Taniya Das Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 3/4] mailbox: qcom-apcs-ipc: enable APCS clock device for MSM8996 Date: Fri, 13 Jan 2023 11:07:38 +0200 Message-Id: <20230113090739.45805-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113090739.45805-1-dmitry.baryshkov@linaro.org> References: <20230113090739.45805-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org MSM8996 also has the clock-related part of the APCS mailbox device. Follow the usual pattern and create a child device to handle these clocks. Signed-off-by: Dmitry Baryshkov --- drivers/mailbox/qcom-apcs-ipc-mailbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c index 0e9f9cba8668..bd61dacb44ba 100644 --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c @@ -42,7 +42,7 @@ static const struct qcom_apcs_ipc_data msm8994_apcs_data = { }; static const struct qcom_apcs_ipc_data msm8996_apcs_data = { - .offset = 16, .clk_name = NULL + .offset = 16, .clk_name = "qcom-apcs-msm8996-clk" }; static const struct qcom_apcs_ipc_data apps_shared_apcs_data = { From patchwork Fri Jan 13 09:07:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 642715 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B939C54EBD for ; Fri, 13 Jan 2023 09:11:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240941AbjAMJLG (ORCPT ); Fri, 13 Jan 2023 04:11:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240657AbjAMJKZ (ORCPT ); Fri, 13 Jan 2023 04:10:25 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8860076214 for ; Fri, 13 Jan 2023 01:07:55 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id g13so32220502lfv.7 for ; Fri, 13 Jan 2023 01:07:55 -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=aNU5vbwi8kesZ/PK2S0aMAB2OBF5X1de5BdV3sczaOc=; b=dsGR7Kj1Tt3BbMwlnb0omrdUBPVj6KE/1nHaMrn+rjH8F/MojYpCRdJCgSt0Cs6slx b3nJba5Kfko2Wldw558DF8nu4p/VoXwaLw2ig2iyisY6LxP/BnwAKnsQZPZQNcow0vwr J8zC3Q6ck60HkTJQbfaTKk3Cg15RWYB1uQHzWZs+8+c1h/oC45+Ed6flqGwa5VIGi4UE np++jymXHhYZ1C7+jKH9a6B6/NWWfWOjeeLIDvJGe3YHRsIwD2DZHb/uGIj5gPdPlN9p xL9ZNVKMNwz5jbR+3nLZ+rTUlFv4Cf2F62tWvk/fonEjFpjgkjf2lIrzWTcGd/9B3wN+ uBFg== 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=aNU5vbwi8kesZ/PK2S0aMAB2OBF5X1de5BdV3sczaOc=; b=IkUaqrce4LnDvRpytLyKgLLBMGCgxZ8p4DHuTZ3WMLVaDq9+x4L6mA9WEjepXQ5NsS kJaMusO/9RDWeyroH3cI3yLKfYsZK/E31lPn/w1zssjHpKgbiKeS2E93Zf4dFl/WXcxn 2Sl8U8zVlZFaa+glPCb5QekERmQh1eQpfha1w0/pdvcrN2VMXoePBBQ+0ahVXWhuUpsN Hb9KwVVVHozAl54yzqsURhcdOA3njl2wpdHhDvSCPIwEPPofSNtfsktNq8CtJnZG1fM7 FSYG6jgS04w+lSfU6dxXvCgJ6tzuygv7QKV/P9Td475kzJl+yQ0wTF4qkeUWmMA1/j5M SP9w== X-Gm-Message-State: AFqh2kqEEMVwkBUgrKF1Eu1vZTgjM+fSWh9YMdVUBbCiorPCROgD7SEa ffSvMp9pnlyynG8bvo+Bo8yqANWVwTnVNtqy7fc= X-Google-Smtp-Source: AMrXdXvS4QG/QOeOl+ud5xWwZgd9EDmJTRDthbzjEJzSZfX236IXTwIktpbaWLo+T6y1+KLpDPAPdQ== X-Received: by 2002:a05:6512:2a85:b0:4cc:7c51:bf46 with SMTP id dt5-20020a0565122a8500b004cc7c51bf46mr6316556lfb.63.1673600875100; Fri, 13 Jan 2023 01:07:55 -0800 (PST) Received: from eriador.lumag.spb.ru ([194.204.33.9]) by smtp.gmail.com with ESMTPSA id d4-20020a05651233c400b004947a12232bsm3735296lfg.275.2023.01.13.01.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 01:07:54 -0800 (PST) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Stephen Boyd , Michael Turquette , Rob Herring , Krzysztof Kozlowski , Taniya Das Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 4/4] clk: qcom: add the driver for the MSM8996 APCS clocks Date: Fri, 13 Jan 2023 11:07:39 +0200 Message-Id: <20230113090739.45805-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113090739.45805-1-dmitry.baryshkov@linaro.org> References: <20230113090739.45805-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add a simple driver handling the APCS clocks on MSM8996. For now it supports just a single aux clock, linking GPLL0 to CPU and CBF clocks. Note, there is little sense in registering sys_apcs_aux as a child of gpll0. The PLL is always-on. And listing the gpll0 as a property of the apcs would delay its probing until the GCC has been probed (while we would like for the apcs to be probed as early as possible). Signed-off-by: Dmitry Baryshkov --- drivers/clk/qcom/Makefile | 2 +- drivers/clk/qcom/apcs-msm8996.c | 76 +++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/qcom/apcs-msm8996.c diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile index f18c446a97ea..ca2f586edb3e 100644 --- a/drivers/clk/qcom/Makefile +++ b/drivers/clk/qcom/Makefile @@ -52,7 +52,7 @@ obj-$(CONFIG_MSM_MMCC_8998) += mmcc-msm8998.o obj-$(CONFIG_QCOM_A53PLL) += a53-pll.o obj-$(CONFIG_QCOM_A7PLL) += a7-pll.o obj-$(CONFIG_QCOM_CLK_APCS_MSM8916) += apcs-msm8916.o -obj-$(CONFIG_QCOM_CLK_APCC_MSM8996) += clk-cpu-8996.o +obj-$(CONFIG_QCOM_CLK_APCC_MSM8996) += apcs-msm8996.o clk-cpu-8996.o obj-$(CONFIG_QCOM_CLK_APCS_SDX55) += apcs-sdx55.o obj-$(CONFIG_QCOM_CLK_RPM) += clk-rpm.o obj-$(CONFIG_QCOM_CLK_RPMH) += clk-rpmh.o diff --git a/drivers/clk/qcom/apcs-msm8996.c b/drivers/clk/qcom/apcs-msm8996.c new file mode 100644 index 000000000000..7e46ea8ed444 --- /dev/null +++ b/drivers/clk/qcom/apcs-msm8996.c @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Qualcomm APCS clock controller driver + * + * Copyright (c) 2022, Linaro Limited + * Author: Dmitry Baryshkov + */ + +#include +#include +#include +#include +#include +#include + +#define APCS_AUX_OFFSET 0x50 + +#define APCS_AUX_DIV_MASK GENMASK(17, 16) +#define APCS_AUX_DIV_2 0x1 + +static int qcom_apcs_msm8996_clk_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device *parent = dev->parent; + struct regmap *regmap; + struct clk_hw *hw; + unsigned int val; + int ret = -ENODEV; + + regmap = dev_get_regmap(parent, NULL); + if (!regmap) { + dev_err(dev, "failed to get regmap: %d\n", ret); + return ret; + } + + regmap_read(regmap, APCS_AUX_OFFSET, &val); + regmap_update_bits(regmap, APCS_AUX_OFFSET, APCS_AUX_DIV_MASK, + FIELD_PREP(APCS_AUX_DIV_MASK, APCS_AUX_DIV_2)); + + /* Hardware mandated delay */ + udelay(5); + + /* + * Register the clock as fixed rate instead of being a child of gpll0 + * to let the driver register probe as early as possible. + */ + hw = devm_clk_hw_register_fixed_rate(dev, "sys_apcs_aux", NULL, 0, 300000000); + if (IS_ERR(hw)) + return PTR_ERR(hw); + + return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw); +} + +static struct platform_driver qcom_apcs_msm8996_clk_driver = { + .probe = qcom_apcs_msm8996_clk_probe, + .driver = { + .name = "qcom-apcs-msm8996-clk", + }, +}; + +/* Register early enough to fix the clock to be used for other cores */ +static int __init qcom_apcs_msm8996_clk_init(void) +{ + return platform_driver_register(&qcom_apcs_msm8996_clk_driver); +} +postcore_initcall(qcom_apcs_msm8996_clk_init); + +static void __exit qcom_apcs_msm8996_clk_exit(void) +{ + platform_driver_unregister(&qcom_apcs_msm8996_clk_driver); +} +module_exit(qcom_apcs_msm8996_clk_exit); + +MODULE_AUTHOR("Dmitry Baryshkov "); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Qualcomm MSM8996 APCS clock driver");