From patchwork Thu Sep 12 14:15:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 173713 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp2190903ilq; Thu, 12 Sep 2019 07:15:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY3br15JS65cSV2d6j5U1K0FBNBnykbdmUyaVf8+uhFSjm+kShFHbCtsd2Pw/wv2JJNi8P X-Received: by 2002:a50:ad5b:: with SMTP id z27mr42135520edc.252.1568297748756; Thu, 12 Sep 2019 07:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568297748; cv=none; d=google.com; s=arc-20160816; b=k8luI6mSr5IvVUVOT+LemUg0A0f0DEqW60RR4ARNQZlKNeTW/zsp+oSzSUtNj4dmbR knTeLOhnXgBCWtDM7Vphc0Z9SrUy1GyUpYxsdNXN52+0OzQgoQT8gU1kbsnBF61kFjY/ CvFPgN5VMLOW2kJTpWwYIzYibtELw0U8AG6TCgOJ/3qfaNZgKSgNn9WbcRW1XD5i1Kbf jCkT4/Dzed9mShTtzQvHPp+JqWrJM6rQcZ0FXkhVJm0Q7RnO6uFq4qeZbNf/xWA+EZje 8TIo/PmtmpinmJ75Numl7CVSiZD6i7dLfyJ86t1Fo1f3F7FcN/tgSRzxh6zZZTXIXji5 Grgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z05c2SbQyHgmdiyuA9SdCH+TDRrblP4cUHUsGoERNgM=; b=DkEMEJK2ZOuKaoW9XopwiotXqNQFo7zTjX8tDwzZvjW6NHLKyeMCqMdSt3v2/lDMdx zPKFTjSJ7iXv47IA7j/nG1mkG8sbq3saoeG+WCxdXTE9qV8f2/iZ0qdOukcwpkm3mjTw PzSZreBKyjW1JK3kjnjpzTljQOcwmeFMhw1T/Z80/+h1x4OeGBo0QpNI3u4r29QnRj3Y LHEyxORizMx5DbT9JgGSvfzzqAK3nYRCGiDbgC1raZiLur2ytXeqkwNM9LMbYZ0KFlDB mZKEZUwdw/RhaltmBz3LdNA1KgRKHUYs5V4eWqEFpqVW26u0hNSe9f45Xt+F0a97XNCn WuTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PUmIQ5HD; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si12715123ejv.41.2019.09.12.07.15.47; Thu, 12 Sep 2019 07:15:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PUmIQ5HD; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732566AbfILOPo (ORCPT + 15 others); Thu, 12 Sep 2019 10:15:44 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35465 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732468AbfILOPn (ORCPT ); Thu, 12 Sep 2019 10:15:43 -0400 Received: by mail-wr1-f68.google.com with SMTP id g7so28737489wrx.2 for ; Thu, 12 Sep 2019 07:15:42 -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 :mime-version:content-transfer-encoding; bh=z05c2SbQyHgmdiyuA9SdCH+TDRrblP4cUHUsGoERNgM=; b=PUmIQ5HDdUAHPqQqa2qkOdoCcTkoTOmHBainGMaiWInzyotClK6/EvL+Lr5NX2w2pn /51IqSxwmwlUB11nQJO51XWYrN1f8TZQrQSR+nsWJc0ru1KXHDZtduvWYvTLNImSiWba 7cylqwtEiPEzC/LQD+1vb9adi8MeFrOafQpA9S3CfQnT0t7TGUegUPHp6wPAMTNF7bZD ZUtzngU4q3yceUwhcFiPt9gur5UX4H86SzjybcQgVnzuwzmBElqZv9deF+wovJ22gHWO VjAx1hVSxrAkSivUMHqHJC1XKXjrUr7xm7sWTtPFJJg3KJAZZvqj+Vf5T2pWyEVVv3bX O/vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z05c2SbQyHgmdiyuA9SdCH+TDRrblP4cUHUsGoERNgM=; b=Nqp3pnoPYwS8G4PKyrXH/3oEc2HwMSlGPiUkyrJyPKRcSh5OPG+wGJuFTW3OUddIW6 45QiLHnQILw3Q88KPI5Sj7UY4d8y/o9vbtdNNp+OKfz8OR80XXymUAR+o5Mo5Ljb/k2O +6WkUC76hIbnvdqwc8HvFRq7QRw4LKpz+GgjXG54bYHMs7+7EXJ0fcm57mhrP8QBAG4k 6UChKH+J8Cmh4vmpPuz5yq4t5Tls2pidBgW9NIyJWSfpGRkwNM8iehHAxWW5rSLeOuTL rbkoBkW+mFoxaXt9WOSDKmyHkW8/1KQtGCyvbW5ysrIRdgEmJ/qMzDlJR+smQoDPZaEs So9w== X-Gm-Message-State: APjAAAUMeKgiKv6ok9nl6nSkDvX1zh4JhWuiroRsusK2qoNplat9ID3e y+F+K196pX7S7qA/hQZflgOGug== X-Received: by 2002:a5d:650d:: with SMTP id x13mr2334646wru.37.1568297741707; Thu, 12 Sep 2019 07:15:41 -0700 (PDT) Received: from localhost.localdomain (69.red-83-35-113.dynamicip.rima-tde.net. [83.35.113.69]) by smtp.gmail.com with ESMTPSA id p23sm137599wma.18.2019.09.12.07.15.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Sep 2019 07:15:41 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, sboyd@kernel.org, agross@kernel.org, mturquette@baylibre.com, bjorn.andersson@linaro.org Cc: niklas.cassel@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] clk: qcom: gcc: limit GPLL0_AO_OUT operating frequency Date: Thu, 12 Sep 2019 16:15:30 +0200 Message-Id: <20190912141534.28870-2-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190912141534.28870-1-jorge.ramirez-ortiz@linaro.org> References: <20190912141534.28870-1-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Limit the GPLL0_AO_OUT_MAIN operating frequency as per its hardware specifications. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson Acked-by: Stephen Boyd --- drivers/clk/qcom/clk-alpha-pll.c | 8 ++++++++ drivers/clk/qcom/clk-alpha-pll.h | 1 + drivers/clk/qcom/gcc-qcs404.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) -- 2.23.0 diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index 0ced4a5a9a17..ef51f302bdf0 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -730,6 +730,14 @@ static long alpha_pll_huayra_round_rate(struct clk_hw *hw, unsigned long rate, return alpha_huayra_pll_round_rate(rate, *prate, &l, &a); } +const struct clk_ops clk_alpha_pll_fixed_ops = { + .enable = clk_alpha_pll_enable, + .disable = clk_alpha_pll_disable, + .is_enabled = clk_alpha_pll_is_enabled, + .recalc_rate = clk_alpha_pll_recalc_rate, +}; +EXPORT_SYMBOL_GPL(clk_alpha_pll_fixed_ops); + const struct clk_ops clk_alpha_pll_ops = { .enable = clk_alpha_pll_enable, .disable = clk_alpha_pll_disable, diff --git a/drivers/clk/qcom/clk-alpha-pll.h b/drivers/clk/qcom/clk-alpha-pll.h index 66755f0f84fc..6b4eb74706b4 100644 --- a/drivers/clk/qcom/clk-alpha-pll.h +++ b/drivers/clk/qcom/clk-alpha-pll.h @@ -104,6 +104,7 @@ struct alpha_pll_config { }; extern const struct clk_ops clk_alpha_pll_ops; +extern const struct clk_ops clk_alpha_pll_fixed_ops; extern const struct clk_ops clk_alpha_pll_hwfsm_ops; extern const struct clk_ops clk_alpha_pll_postdiv_ops; extern const struct clk_ops clk_alpha_pll_huayra_ops; diff --git a/drivers/clk/qcom/gcc-qcs404.c b/drivers/clk/qcom/gcc-qcs404.c index 29cf464dd2c8..18c6563889f3 100644 --- a/drivers/clk/qcom/gcc-qcs404.c +++ b/drivers/clk/qcom/gcc-qcs404.c @@ -330,7 +330,7 @@ static struct clk_alpha_pll gpll0_ao_out_main = { .parent_names = (const char *[]){ "cxo" }, .num_parents = 1, .flags = CLK_IS_CRITICAL, - .ops = &clk_alpha_pll_ops, + .ops = &clk_alpha_pll_fixed_ops, }, }, }; From patchwork Thu Sep 12 14:15:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 173712 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp2190909ilq; Thu, 12 Sep 2019 07:15:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4fctPbMSQqAvhNmfkvLrfJFnW/9boOUVUlOwnV+iw7Wr+064nLYjsEBssh6hKu5c28RiQ X-Received: by 2002:aa7:c719:: with SMTP id i25mr15159085edq.5.1568297749141; Thu, 12 Sep 2019 07:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568297749; cv=none; d=google.com; s=arc-20160816; b=JvfwydL7UA9Pus0oJpSqrMQYF+FHT2ri+pxspLGACfvU8+zffumwW/CaehbIjdpDmy VYmf8kj8eRcI5YkLp+otQM+/iYSLJyM/qCedKhTYWzlytXxkDOZciQN/7BzdsgqYSRdr wM3UiYMi/fXbhfCszd8am+iUtuTfxDqpPyJbVm0yaijcG/8rxGHm0f5RjdaubkQGXcLs B3IBV31YkxuXcnnWHHWp4RYpQ2H/+c7ab3WQ1o3m//C1k5vID6j4sQj5+ZAZBnvvW7Rz st9HG/fJWsHbgc4Jn362qqxbl88NyNRu15A1hHUXjskVrM/kb3U5S/+tW++8hasaaI5u Zwlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MyCCet13LkijoDqtWJYtA/7gCLRctgr20CN4r0Zl6Mg=; b=OMq1V1bWkZEPB2KTVoDWrHq7JcztQT6Zo+A82yFoi64sPEJoTMfuA43tlBiHlWnYc/ mO+K55NFzvqqXHpLIUnBsVXzxyCHgXir9qG+hWmAhWqHHMc76F/bvfQEcC/RjwivfLTS uC3hvlAFgnaY1TpMGZsokKL7CvYYNK6sudSlv+vOS7nptDIkuUEDPOM47VOES7KJ3gEl ggTuNVUaglX3rHxjZFTCQD3aXhlZFbqnLwVfKFafL0gjE3LbwRWLEugkkEwQYimNMymd 7zHwfL5bHA5dOyMla0EzyxcBLhDdlMNqi77+KtcJc/0RTLLDeD1rXoRqTKw3QB7+2Bul Aj4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zeRGnx9J; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si12715123ejv.41.2019.09.12.07.15.48; Thu, 12 Sep 2019 07:15:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zeRGnx9J; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732579AbfILOPp (ORCPT + 15 others); Thu, 12 Sep 2019 10:15:45 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39267 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732480AbfILOPo (ORCPT ); Thu, 12 Sep 2019 10:15:44 -0400 Received: by mail-wr1-f68.google.com with SMTP id t16so28659811wra.6 for ; Thu, 12 Sep 2019 07:15:43 -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 :mime-version:content-transfer-encoding; bh=MyCCet13LkijoDqtWJYtA/7gCLRctgr20CN4r0Zl6Mg=; b=zeRGnx9Jl5O3X7Jd4SHlQ0k/Z1HyWXgLVZ7K6qOsjBO4t7cEJY2Atb4S61Y5e3Mo6W iWDKSfGYbBtsw95T7xSReKUHHARk8fx+5BXT/9kojZfo59vSEZSPnc2wZ9aUNFXPeMP/ RINSZZ69wStZe3kzgVNrCS91tG3fuWI5h2eLczRUzzFwqMa07Gq61x0B+SrvNdSKcjfo SqRqCApVvCoEaKoQVY9nOuo8uF5McNy0JGG5JK3XWfuRBQD1ZyPeC0a87DJM9uPD1Pki qHGktZH0ZQNDu91OGL8XwkLY2jGn/6jD0LHwROdyPaApTNV3bmnJRIhst4z7rAZW5ZG3 l7Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MyCCet13LkijoDqtWJYtA/7gCLRctgr20CN4r0Zl6Mg=; b=lnDSI2VZd+S3N2Wpe6BNUTcw2563eiI2mpd/SaWT54+CNHuqCEmOM4c4E6gQ9WLZOJ gpVezMbt6kzu6I+3ggUseZW37vIqR0yJ+tCR0Uc365/JTBb3oJqSAHWO6JSboRivx3Jg qIfwvltEY6f+He+9zqCqZD07ge1O5Tl/e8sMrePep+GEIze8PBpyXFAHA9lCBq9kQND+ S5oPmmjS+37kyKSJieJcKXMOOVdvVkgeAO/JqKwuP0SeZPUnCbMTtEac4npHDYpdET01 qwCA9z8hwJeJYpmjQJESosDI2VkAmDFuttkemFgnZ+2Tq8Lk+a/otoj9c0qh7RlC9NFj K6Hw== X-Gm-Message-State: APjAAAUscdFUoAzcnluAS8eOJ61DZlyHsFYQVtU+Z4/pXyb8rSlcwFm8 wsR/5iX3LYyaFA9tDsQZZN/N6A== X-Received: by 2002:a5d:4044:: with SMTP id w4mr36896685wrp.281.1568297742744; Thu, 12 Sep 2019 07:15:42 -0700 (PDT) Received: from localhost.localdomain (69.red-83-35-113.dynamicip.rima-tde.net. [83.35.113.69]) by smtp.gmail.com with ESMTPSA id p23sm137599wma.18.2019.09.12.07.15.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Sep 2019 07:15:42 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, sboyd@kernel.org, agross@kernel.org, mturquette@baylibre.com, bjorn.andersson@linaro.org Cc: niklas.cassel@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] clk: qcom: hfpll: register as clock provider Date: Thu, 12 Sep 2019 16:15:31 +0200 Message-Id: <20190912141534.28870-3-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190912141534.28870-1-jorge.ramirez-ortiz@linaro.org> References: <20190912141534.28870-1-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Make the output of the high frequency pll a clock provider. On the QCS404 this PLL controls cpu frequency scaling. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson Acked-by: Stephen Boyd --- drivers/clk/qcom/hfpll.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.23.0 diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c index a6de7101430c..e64c0fd82fe4 100644 --- a/drivers/clk/qcom/hfpll.c +++ b/drivers/clk/qcom/hfpll.c @@ -57,6 +57,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev) .num_parents = 1, .ops = &clk_ops_hfpll, }; + int ret; h = devm_kzalloc(dev, sizeof(*h), GFP_KERNEL); if (!h) @@ -79,7 +80,14 @@ static int qcom_hfpll_probe(struct platform_device *pdev) h->clkr.hw.init = &init; spin_lock_init(&h->lock); - return devm_clk_register_regmap(&pdev->dev, &h->clkr); + ret = devm_clk_register_regmap(dev, &h->clkr); + if (ret) { + dev_err(dev, "failed to register regmap clock: %d\n", ret); + return ret; + } + + return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, + &h->clkr.hw); } static struct platform_driver qcom_hfpll_driver = { From patchwork Thu Sep 12 14:15:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 173715 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp2191029ilq; Thu, 12 Sep 2019 07:15:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnUldht55YJ4eyuXBYpnd3CrKfK++EaefqqTbg3p956OA33clJ9tIh92uSdB/A1FaXjvq7 X-Received: by 2002:aa7:d95a:: with SMTP id l26mr42328590eds.297.1568297754376; Thu, 12 Sep 2019 07:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568297754; cv=none; d=google.com; s=arc-20160816; b=Trw+ZpZ4ABM5KFHCKz8wbVxrmbETq/X2SMBO+Yf5WJu4WWqREBnKYVW+xP/NqBg/rh gCsAkzoAa6LNFbOUOnM2c0eYrkV+QAzIDZDcgCW6YDEeRDtlJ2zJ4t5INapc3Bn71zwP TxKOBQh32qmEl4DKt01OSCmV1f6Du5GtH5hpjmzVIP6SE6zkk+l6rDlZOyPq5Kz61+v6 g0glw0Kk6UG+7kmMDKLrfHlC4VSLoxAG0cbwT1nA8R0/rxp8JYee95qBOnS4XndGy7hC l7RxFKLiVTe0kcd0ys5PKxUuj4+r6DScc8pvJlDohvx47QL5X2++X5LyplnsolisQPsH 8P8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=U94LXB0H1SLchTUsgjMZwjp3h0cafdMB0BynvaN+clQ=; b=MQCBtsSIi/CFsPS6uqa7K2wcrozMx2I+7MKT/xbOSZpfpcR6I+roaNbggt/HrLKH5y +qZlB28jjHSQ5WfWCxwe+oeeQffKlSvdGApt9OTwswxnjDRdJWxnqsA198xyBWUJqqtE 46gDwmbKZxG9XnolCTpdZzRctc35A5Xk8cpV0bNphCK3aMHtZrJP68AUEN4S3YXgpjba k1kdJUBhfuUbYOkvkZV5BE65tNDJhV5dK4eVAH1mmkuw8E+SPwjiCLd9qZf2GqkCgvvj U9RymJ/TCJD44vnWNTqOckzLN2Dt301fcNV7595T2RHjb6bNr/hCmpuLB5d//zoS25/r zfFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c2LsHJ3t; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e46si14674191eda.401.2019.09.12.07.15.54; Thu, 12 Sep 2019 07:15:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c2LsHJ3t; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732480AbfILOPu (ORCPT + 15 others); Thu, 12 Sep 2019 10:15:50 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53263 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732573AbfILOPt (ORCPT ); Thu, 12 Sep 2019 10:15:49 -0400 Received: by mail-wm1-f65.google.com with SMTP id q18so238789wmq.3 for ; Thu, 12 Sep 2019 07:15:46 -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 :mime-version:content-transfer-encoding; bh=U94LXB0H1SLchTUsgjMZwjp3h0cafdMB0BynvaN+clQ=; b=c2LsHJ3tBEwEu++rxVvsn78g0L8UGdn7yiC4/N4WA91klnp22ccVAB1m6chQL/Onzq RhHrr9XFtyyqbHwCu1B1W+g94jvzJjkTfeDlIRm1O27WepyHaoth/Gs16hJe+L0Z9pbo njNWTGxQCTm1gyfrIhwhNHhqw+frkZfE4FpyYuoXtKj2XdpxVE/NV4Y4VvX/AakWvjys v8tipJcte9cSWKsE9GIJCbTR/X74OPRpl09XBDpkPW9vo/zKKDTtXStOUMoe4g4o6n9k xZxx0QvX8cFKWC00/Y1UN+WXaYKiXKNDC7V+qx0/JFXxnzziXfJBQM+gb9Y2DGDnJ1r+ tTMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U94LXB0H1SLchTUsgjMZwjp3h0cafdMB0BynvaN+clQ=; b=jliZoZkrqA+CrACLCIjrum0eyVa1UNIKtffgKgNNEuIQF7bPm9rQSZc/DCquME3Awb Ag7karLpv+dqTcHAOV4WNzX8Ch00Yu/4Rp9kbpIPjS4fnfxZa4kOrQyL44+DdA1yBaED AyTqrmBChg3PbsII430wpH4/eTQPCQudN0i3OUXe5fAgl7u6U8Rej3FGN5DvkO/PfzW3 DMn+jM+CiL51nkhhmryV0cX7JKTtdw/EuKh3EM62DvkQghmfsqHmPLEO9RWP3yoP9LiG qtr4L+yhBEvj9+ye8N029dqVIAbb2Zp2olr5Qi0fyoQal+9rtWUBmn3ftOXsoTUZRirs noeA== X-Gm-Message-State: APjAAAUutaELpU6F2J0aA5bsA3ZfdmxnWkva+a0zF6caz7KZ+8WebvD5 BsAwQjctmjCJAmylqRpg3lFVGw== X-Received: by 2002:a1c:7a14:: with SMTP id v20mr197811wmc.75.1568297745884; Thu, 12 Sep 2019 07:15:45 -0700 (PDT) Received: from localhost.localdomain (69.red-83-35-113.dynamicip.rima-tde.net. [83.35.113.69]) by smtp.gmail.com with ESMTPSA id p23sm137599wma.18.2019.09.12.07.15.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Sep 2019 07:15:45 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, sboyd@kernel.org, agross@kernel.org, mturquette@baylibre.com, bjorn.andersson@linaro.org Cc: niklas.cassel@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] clk: qcom: apcs-msm8916: get parent clock names from DT Date: Thu, 12 Sep 2019 16:15:34 +0200 Message-Id: <20190912141534.28870-6-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190912141534.28870-1-jorge.ramirez-ortiz@linaro.org> References: <20190912141534.28870-1-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Allow accessing the parent clock names required for the driver operation by using the device tree node. This permits extending the driver to other platforms without having to modify its source code. For backwards compatibility leave previous values as default. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson --- drivers/clk/qcom/apcs-msm8916.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) -- 2.23.0 diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index a6c89a310b18..099b028dbc20 100644 --- a/drivers/clk/qcom/apcs-msm8916.c +++ b/drivers/clk/qcom/apcs-msm8916.c @@ -19,7 +19,7 @@ static const u32 gpll0_a53cc_map[] = { 4, 5 }; -static const char * const gpll0_a53cc[] = { +static const char *gpll0_a53cc[] = { "gpll0_vote", "a53pll", }; @@ -50,6 +50,7 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) struct regmap *regmap; struct clk_init_data init = { }; int ret = -ENODEV; + const char *parents[2]; regmap = dev_get_regmap(parent, NULL); if (!regmap) { @@ -61,6 +62,9 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) if (!a53cc) return -ENOMEM; + if (of_clk_parent_fill(parent->of_node, parents, 2) == 2) + memcpy(gpll0_a53cc, parents, sizeof(parents)); + init.name = "a53mux"; init.parent_names = gpll0_a53cc; init.num_parents = ARRAY_SIZE(gpll0_a53cc); @@ -76,10 +80,11 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) a53cc->src_shift = 8; a53cc->parent_map = gpll0_a53cc_map; - a53cc->pclk = devm_clk_get(parent, NULL); + a53cc->pclk = of_clk_get(parent->of_node, 0); if (IS_ERR(a53cc->pclk)) { ret = PTR_ERR(a53cc->pclk); - dev_err(dev, "failed to get clk: %d\n", ret); + if (ret != -EPROBE_DEFER) + dev_err(dev, "failed to get clk: %d\n", ret); return ret; } @@ -87,6 +92,7 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) ret = clk_notifier_register(a53cc->pclk, &a53cc->clk_nb); if (ret) { dev_err(dev, "failed to register clock notifier: %d\n", ret); + clk_put(a53cc->pclk); return ret; } @@ -109,6 +115,8 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) err: clk_notifier_unregister(a53cc->pclk, &a53cc->clk_nb); + clk_put(a53cc->pclk); + return ret; } @@ -117,6 +125,7 @@ static int qcom_apcs_msm8916_clk_remove(struct platform_device *pdev) struct clk_regmap_mux_div *a53cc = platform_get_drvdata(pdev); clk_notifier_unregister(a53cc->pclk, &a53cc->clk_nb); + clk_put(a53cc->pclk); return 0; }