From patchwork Sun Oct 31 02:07:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 12594899 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EC4EC433FE for ; Sun, 31 Oct 2021 02:07:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C26A60EBB for ; Sun, 31 Oct 2021 02:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232081AbhJaCKC (ORCPT ); Sat, 30 Oct 2021 22:10:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbhJaCKB (ORCPT ); Sat, 30 Oct 2021 22:10:01 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79E60C061714 for ; Sat, 30 Oct 2021 19:07:30 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id y14-20020a17090a2b4e00b001a5824f4918so6774533pjc.4 for ; Sat, 30 Oct 2021 19:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lZj1Wo7snHpxaiqNZlxW9ksc5HcIv7ZuWTTzFxW+1bI=; b=pbmfnxpfPtOKoMzAn7qKdkruLD1kcNxMzZ6P/FAlIn/L7esgIAj4FNvbM4+bv/N4Kd wF3UM/Dz25rwpRqUMllSCRnXZW10Dqi7npw6bR+0PLGxD36lr0qsVeg4gRBF21YdZt1G SRj2PZudbCab6s8hT3kNS+wZtTdiVNCpHcTVQp8Onxug+CpM1r5qgArHkPjGzuCoywJl 91Frkv0k87sbuZhJgqSLJUBdW96CW5oXW6XtDGQozZl9kQ0tbI9ZyhyQZvMQWAtUtYX0 is2OvyS4iaMQbFFrLHmpXKZ2xVMfJi2XiZD9hcPRZW8nnXHk6+ry4PLJXtJAaswxoM5x Ibrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lZj1Wo7snHpxaiqNZlxW9ksc5HcIv7ZuWTTzFxW+1bI=; b=WXQ86Fp1PbGanAi10BrpmVlxHoX5ton8GsFYcqgp+p7eBrGg80CYUCprs3jCYdhbCF cYrgrm5mQ7sHP8ERKSKhFiHfNAdevT7nlPeX+rxSd9yDo6F4XlvziEUJ30VCDDVfEZ5l yXSHvx8NEwffpCkbE1rpydB77mbLM12b5e4EYCoS0PKPPzg0ASjYwFGNrodr4DKACeSm J8mOD0nWF7MH5FwKbjYOjI1iEtZbEhWyh4gN8yOUzWE8cm/+gh4ra6JuVHnEBYAPj+NF mxSY9L/tVdOolLVsCj1bFzcrKShp0M6VdkKzKZ91pUHDc3jPJcpH5G29KTT1+Uwxa5IF nlIw== X-Gm-Message-State: AOAM531J5GqH2b/c9TPlKBHGpwYoClDdNsKTfUeDM5hhDMtwB0ktx9Gg zB+5uuHTSxrIow6eBN7b24B3xw== X-Google-Smtp-Source: ABdhPJzyoT75DeamHu27XxiLxgVbbshM7+vSrdQz4CyU+abVHVmncVJItOQIezOQIqKAIyqHJoIdpw== X-Received: by 2002:a17:902:8a90:b0:13f:ee6e:cc59 with SMTP id p16-20020a1709028a9000b0013fee6ecc59mr17826390plo.75.1635646050040; Sat, 30 Oct 2021 19:07:30 -0700 (PDT) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id p9sm10748986pfn.7.2021.10.30.19.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Oct 2021 19:07:29 -0700 (PDT) From: Shawn Guo To: Stephen Boyd Cc: Bjorn Andersson , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 1/3] clk: qcom: smd-rpm: Drop MFD qcom-rpm reference Date: Sun, 31 Oct 2021 10:07:13 +0800 Message-Id: <20211031020715.21636-2-shawn.guo@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211031020715.21636-1-shawn.guo@linaro.org> References: <20211031020715.21636-1-shawn.guo@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The MFD qcom-rpm interface is not used by this driver. Drop the 'struct qcom_rpm' reference and include of . Signed-off-by: Shawn Guo --- drivers/clk/qcom/clk-smd-rpm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 5776d85a1e5c..a27c0e740ab7 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -17,7 +17,6 @@ #include #include -#include #define QCOM_RPM_KEY_SOFTWARE_ENABLE 0x6e657773 #define QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY 0x62636370 @@ -152,7 +151,6 @@ struct clk_smd_rpm_req { }; struct rpm_cc { - struct qcom_rpm *rpm; struct clk_smd_rpm **clks; size_t num_clks; }; From patchwork Sun Oct 31 02:07:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 12594901 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3042EC433EF for ; Sun, 31 Oct 2021 02:07:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 179FE60FDA for ; Sun, 31 Oct 2021 02:07:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232109AbhJaCKY (ORCPT ); Sat, 30 Oct 2021 22:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbhJaCKH (ORCPT ); Sat, 30 Oct 2021 22:10:07 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805AEC061714 for ; Sat, 30 Oct 2021 19:07:32 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id b4so6729331pgh.10 for ; Sat, 30 Oct 2021 19:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2+ffyI9OZZpP3lY0AHhAJ8sA/wkP1dbrlB/3sN839Ik=; b=BmYkSErE+WwlMV8TFgrRz7sjh2rWQ6vQeNlaX/QLMAAH6ZftWSOGI0PaX7UVSvZzQz Od0EBQAWHab+Rpw2rnxi+vadNnOZ8KnnVH+vrxHgPxx3C+IzGwH5KXYwCcKU+xira1y5 YRANqoM8C1UKhAWazgUsHjD/2F248wQYrlFhmsdfvTSXMmamrsKB/CLlI1exECx9UYYz a2SXDzAvNa7dxLbKLYV9whtKbuEzAeEzy3xNYmQE2F4ucnGjNXGw84OnOkeNgGebkPc8 M4lrSbEEj9bwWE7Jxv8tPv1eQN/ne1A66i3HWUWJzq6DnCVRI3KrKxw6T/D4AYV1n3zz HRkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2+ffyI9OZZpP3lY0AHhAJ8sA/wkP1dbrlB/3sN839Ik=; b=dtCg7WusvFYoqODlTFoGCw7sAun/o12ENwEDJFf1VT4v3xx0e9ShPS7SK6ZWI34xKn K23CIvntbTeHlJBONzijsNXO0ffrKlZCyM0QW/W4ni6DrOfsHShstCx8Ct6pfV9r+B6u xnv9pKV5DQRwNYgPlY3yuSMJvy9aeGUspcW9GN8lvhWl28+9dfEjQWKC8ZRztqdVr44q Ofoq9XoiCbnd8RuFmk6aPO4pXb4qrgu8ZihAvGoM566KL0zjozmojKYhaMINpJN7vkaX 1YwqcIlyWqf/DGudGTd+kAMqRdKtacCO1XzUClcM8nutF00ti2Y36/AxWvo3/BQ9YHZm 6vmA== X-Gm-Message-State: AOAM531/DrP0RfzbV/SP79yIUbvUyZP1vLsJ6+zAElhxGJn/M3fg0Ebf E7Pvyij/al9HmtwqE1eQ6t82/g== X-Google-Smtp-Source: ABdhPJyEwuKshFuDRGbY3NasksEfpyTOsE6hSALQC2rHV5Du28iQy4M6UN7UtFUNWYdkR9dXurI0JA== X-Received: by 2002:a63:330f:: with SMTP id z15mr15312243pgz.42.1635646052031; Sat, 30 Oct 2021 19:07:32 -0700 (PDT) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id p9sm10748986pfn.7.2021.10.30.19.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Oct 2021 19:07:31 -0700 (PDT) From: Shawn Guo To: Stephen Boyd Cc: Bjorn Andersson , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 2/3] clk: qcom: smd-rpm: Drop the use of struct rpm_cc Date: Sun, 31 Oct 2021 10:07:14 +0800 Message-Id: <20211031020715.21636-3-shawn.guo@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211031020715.21636-1-shawn.guo@linaro.org> References: <20211031020715.21636-1-shawn.guo@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Considering that struct rpm_cc is now identical to rpm_smd_clk_desc, and function qcom_smdrpm_clk_hw_get() uses rpm_cc in a read-only manner, rpm_cc can be dropped by getting the function use rpm_smd_clk_desc directly. Signed-off-by: Shawn Guo Reviewed-by: Bjorn Andersson --- drivers/clk/qcom/clk-smd-rpm.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index a27c0e740ab7..dd3d373a1309 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -150,11 +150,6 @@ struct clk_smd_rpm_req { __le32 value; }; -struct rpm_cc { - struct clk_smd_rpm **clks; - size_t num_clks; -}; - struct rpm_smd_clk_desc { struct clk_smd_rpm **clks; size_t num_clks; @@ -1157,20 +1152,19 @@ MODULE_DEVICE_TABLE(of, rpm_smd_clk_match_table); static struct clk_hw *qcom_smdrpm_clk_hw_get(struct of_phandle_args *clkspec, void *data) { - struct rpm_cc *rcc = data; + const struct rpm_smd_clk_desc *desc = data; unsigned int idx = clkspec->args[0]; - if (idx >= rcc->num_clks) { + if (idx >= desc->num_clks) { pr_err("%s: invalid index %u\n", __func__, idx); return ERR_PTR(-EINVAL); } - return rcc->clks[idx] ? &rcc->clks[idx]->hw : ERR_PTR(-ENOENT); + return desc->clks[idx] ? &desc->clks[idx]->hw : ERR_PTR(-ENOENT); } static int rpm_smd_clk_probe(struct platform_device *pdev) { - struct rpm_cc *rcc; int ret; size_t num_clks, i; struct qcom_smd_rpm *rpm; @@ -1190,13 +1184,6 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) rpm_smd_clks = desc->clks; num_clks = desc->num_clks; - rcc = devm_kzalloc(&pdev->dev, sizeof(*rcc), GFP_KERNEL); - if (!rcc) - return -ENOMEM; - - rcc->clks = rpm_smd_clks; - rcc->num_clks = num_clks; - for (i = 0; i < num_clks; i++) { if (!rpm_smd_clks[i]) continue; @@ -1222,7 +1209,7 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) } ret = devm_of_clk_add_hw_provider(&pdev->dev, qcom_smdrpm_clk_hw_get, - rcc); + (void *)desc); if (ret) goto err; From patchwork Sun Oct 31 02:07:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 12594903 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEA1AC433EF for ; Sun, 31 Oct 2021 02:07:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 936A261058 for ; Sun, 31 Oct 2021 02:07:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232167AbhJaCK0 (ORCPT ); Sat, 30 Oct 2021 22:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbhJaCKM (ORCPT ); Sat, 30 Oct 2021 22:10:12 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B96DAC061767 for ; Sat, 30 Oct 2021 19:07:34 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id 187so12979718pfc.10 for ; Sat, 30 Oct 2021 19:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vqKYg6dNuNcTvm4gAvh9iY3XhP1oG3tG2dM4lX9EWLU=; b=FqQ+WYpzW/8dJmtef4TQNCOMBHv/+8ehEx1sXKW5SitexXRcNqc+kl2iD6C7cIH13t X4dzh4sqB7sgNq9qVJB7U3Jid9Q8mzo5Oy3wcZFDK2RWR27DUzkz3xr7pplD1of6Hsln IME09zob+JHkU03vNL3kYCfnlEgVavqnKxEucgRolhsTqyHs6Jss015kuXyYPOrmctbf +2RQU8TGjmQVisadqnXVN2rXhe++c4jXuHDabGWx45QrcdsGlCG8dJkR+B2hLRbrxd+0 BBSpUOngyF+xyjH+G/0Vc7xZtncucyEwszkpZlGqQlkOXaYb32iktiOZqZgLA6vxe4yb d1JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vqKYg6dNuNcTvm4gAvh9iY3XhP1oG3tG2dM4lX9EWLU=; b=IxwX8fRTM/Vp2VQJsb+iV6QQ73r6awhVd269YkCLtj0N8dWvsOc3/9z9cFhEmlBU2A T3tYQjh8UCZxJf8nzZThtxMjo9kPrFfBuGAbpvkkcaEUREnbFFLhy1a8+MOdUv3SP3+I 1h7xDa5eJ7+VEEVCr4MtnOznHXUuNNUYX6mNDIeVoR1WQh36dS1kFPv5EW/5Qrp0IofD ok111Sy/Lze/UKE8I4GVuJau7eMiw/BQ5eT/zDT2etXWZhbq15mj63NDPTu5G87Y1d7U rKep68XxUclASNEcP6Y3QxDZH8H5ZrNkKEGJZ7IPIbCN+TUk9OlELAgCpSmXZH84wp5e NSpg== X-Gm-Message-State: AOAM531uM+oUWFYaccnNg8s4EJZqnzVPP8SGqaLKVhnaoqecSPrKyIpC ZuQs/pQN3qv/mROuJgo+qMoDhw== X-Google-Smtp-Source: ABdhPJzn24RYS3oErnKGYpc3gzdG/yLAzl/Rea65kdjXmf4hJKcqkFFDBKEi5vC2ws5LUvYMd1P3sw== X-Received: by 2002:a63:155d:: with SMTP id 29mr5700982pgv.245.1635646053900; Sat, 30 Oct 2021 19:07:33 -0700 (PDT) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id p9sm10748986pfn.7.2021.10.30.19.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Oct 2021 19:07:33 -0700 (PDT) From: Shawn Guo To: Stephen Boyd Cc: Bjorn Andersson , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 3/3] clk: qcom: smd-rpm: Drop binary value handling for buffered clock Date: Sun, 31 Oct 2021 10:07:15 +0800 Message-Id: <20211031020715.21636-4-shawn.guo@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211031020715.21636-1-shawn.guo@linaro.org> References: <20211031020715.21636-1-shawn.guo@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The buffered clock binary value handling added by commit 36354c32bd76 ("clk: qcom: smd-rpm: Add .recalc_rate hook for clk_smd_rpm_branch_ops") is redundant, because buffered clock is branch type, and the binary value handling for branch clock has been handled by clk_smd_rpm_prepare/unprepare functions. Signed-off-by: Shawn Guo Reviewed-by: Bjorn Andersson --- drivers/clk/qcom/clk-smd-rpm.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index dd3d373a1309..ea28e45ca371 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -189,10 +189,6 @@ static int clk_smd_rpm_set_rate_active(struct clk_smd_rpm *r, .value = cpu_to_le32(DIV_ROUND_UP(rate, 1000)), /* to kHz */ }; - /* Buffered clock needs a binary value */ - if (r->rpm_res_type == QCOM_SMD_RPM_CLK_BUF_A) - req.value = cpu_to_le32(!!req.value); - return qcom_rpm_smd_write(r->rpm, QCOM_SMD_RPM_ACTIVE_STATE, r->rpm_res_type, r->rpm_clk_id, &req, sizeof(req)); @@ -207,10 +203,6 @@ static int clk_smd_rpm_set_rate_sleep(struct clk_smd_rpm *r, .value = cpu_to_le32(DIV_ROUND_UP(rate, 1000)), /* to kHz */ }; - /* Buffered clock needs a binary value */ - if (r->rpm_res_type == QCOM_SMD_RPM_CLK_BUF_A) - req.value = cpu_to_le32(!!req.value); - return qcom_rpm_smd_write(r->rpm, QCOM_SMD_RPM_SLEEP_STATE, r->rpm_res_type, r->rpm_clk_id, &req, sizeof(req));