From patchwork Tue May 4 05:28:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 430798 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3474879jao; Mon, 3 May 2021 22:29:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlY0Py4uTpwr4cC+ZfQwu9v5BvR2eLeItokks+6s1PW2i3Az3zGqU40tQLLK9KMEaYgRoI X-Received: by 2002:a17:90b:38f:: with SMTP id ga15mr25612826pjb.196.1620106147403; Mon, 03 May 2021 22:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620106147; cv=none; d=google.com; s=arc-20160816; b=Q58XONYHT51kJXPEzAUsGfktqo3BUMBTU0p8gCUpTVRW4ng2IUk/XX9N7iKxl71c34 ZdyV1dGEefDxR/ySR+OzDwSNjHt+pDXVFm9RGFUg/sYJJWwltsd74k5Ia/HkWhkxvofP 2v+t1XoLEyG22s+6VQ8C29gUSsr/kUgFYRx5mbEuy4G7MmaTvyKyHY5i+QrC3LrgOI8X V5hgWiiGoljQ8AcagVXFljxsy+eL+QIU70N7MOIr8kJ+VXNxtjp6t/XmK47ytb8Gg5Wf LMD4/RMIjnaUNF3/qbZAdnEOYCVO0QE+M+HPwZoHGozF5jnKD+b/cWI6+BMuMsr+rbg2 GzWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=gIUTD/xcjRZwD9lqPa/K9njfq+3aHSwHrSeb5ACE0xU=; b=jTnk44vsIKCNa+BeAdRocQa6/Tv9Ol2Lpzgg0agQ7Hchyex/u/SVKgbEolcvGraWRw aTZ43bdw9i5S9oo/FpEO/mSPusZof4S/HERmoKd0x7Dngw93MipOg3z1CVxn8wOHZbGK GvGomjpDzn5DqIjLReC0J2WxW95g50uh4FryDqKmKfC9Vur9NUGLENI/qY32F+fRCUK6 EdPHUDS0D5vwrzReQBjJRhTBgYMTy0EWpapwJWqYd8BI6qOtnu6a7+2IccRxFh2IcxV0 vnbY/VvAIzhLD6AbiDXI5F4K/TKzPyrV+/YaMFLcW2J782uFxhv+7o5+lpmzkl1YAW87 dO1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QIVCAcQd; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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. [23.128.96.18]) by mx.google.com with ESMTP id x7si2109914pgp.564.2021.05.03.22.29.07; Mon, 03 May 2021 22:29:07 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QIVCAcQd; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S229806AbhEDF35 (ORCPT + 6 others); Tue, 4 May 2021 01:29:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229802AbhEDF35 (ORCPT ); Tue, 4 May 2021 01:29:57 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17C63C061574 for ; Mon, 3 May 2021 22:29:03 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id b15so6305275pfl.4 for ; Mon, 03 May 2021 22:29:03 -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=gIUTD/xcjRZwD9lqPa/K9njfq+3aHSwHrSeb5ACE0xU=; b=QIVCAcQd/JmeV2I5FJybb+PlBKZFa6WoZXs9qKR9SoOX0cOuvd70hAfpHS6zJnaQw+ mpW9xcgkSFs4bvFVpT7ahwP+JULNBJNcPnsQIzYEjv+wz5Pd5I3lXunFyCrdxECtJ7Qh 4IzsL/AIUfpW5xwzPyymI8DaRI9m2Fq1j3V+FhsB+WSjt7//BH+EdX5pRvgJVuDd5FEP tuGjtf0D62t1jmE6wtzJZiq6FnlZbEqBQGUXwBH2MUWAD1aJe52hFs4q9+ccEo003AV3 mz5Gc/NfqSeb1ywBlFtHLpAOP//ILN3O0imX/qUtGIrve/RXMjrHpyEyuwbeK9qHB4pY tR+g== 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; bh=gIUTD/xcjRZwD9lqPa/K9njfq+3aHSwHrSeb5ACE0xU=; b=JVJ/uPJg3HDLyXVbCfkNl4q6cqmpWnkoHLQ/PL5lJZtU6bDcI+KbnOY9JecMDc51Bx wqjsF6jWGXqcsw8vrlxpDrA9Ohw25X6xqZqfRgfbryK9p9dzGAra8Hsd3HwtOQ3afSN+ 49DvNw8FUg+RMwhRn06KWxXAkG8wau415qugRDfsRIxz+M4s98zTeg8zYrPx3t8a5S3q FWaJfO1loX8lZEuHQGzzyMlaSr5xZitAJdoF+EoZtKkeryRn5P2QN4stHwRC/oU98O/C VIWd7LJ8LXxAYnVhgiUBTzfQEQW+UOGWKkq20VG0kJeIx3Pw6lGI4+uziHp31mHPnKVG cBiQ== X-Gm-Message-State: AOAM533aZ5QSZhFQVy84ADPVoLsBqgT5gLuV47XYMC6sVov7G7AnMiHV tI1XomEf8i+QqofOzx1VqqE+sw== X-Received: by 2002:a65:5083:: with SMTP id r3mr21706072pgp.231.1620106142718; Mon, 03 May 2021 22:29:02 -0700 (PDT) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id 145sm5933229pfv.196.2021.05.03.22.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 22:29:02 -0700 (PDT) From: Shawn Guo To: Stephen Boyd Cc: Bjorn Andersson , Rob Herring , Sivaprakash Murugesan , Benjamin Li , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, Shawn Guo Subject: [PATCH 3/5] clk: qcom: apcs-msm8916: Retrieve clock name from DT Date: Tue, 4 May 2021 13:28:42 +0800 Message-Id: <20210504052844.21096-4-shawn.guo@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210504052844.21096-1-shawn.guo@linaro.org> References: <20210504052844.21096-1-shawn.guo@linaro.org> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Unlike MSM8916 which has only one APCS clock, MSM8939 gets three for Cluster0 (little cores), Cluster1 (big cores) and CCI (Cache Coherent Interconnect). Instead of hard coding APCS (and A53PLL) clock name, retrieve the name from DT, so that multiple APCS clocks can be registered. Signed-off-by: Shawn Guo --- drivers/clk/qcom/a53-pll.c | 5 ++++- drivers/clk/qcom/apcs-msm8916.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/clk/qcom/a53-pll.c b/drivers/clk/qcom/a53-pll.c index 8614b0b0e82c..964f5ab7d02f 100644 --- a/drivers/clk/qcom/a53-pll.c +++ b/drivers/clk/qcom/a53-pll.c @@ -42,6 +42,7 @@ static int qcom_a53pll_probe(struct platform_device *pdev) struct clk_pll *pll; void __iomem *base; struct clk_init_data init = { }; + const char *clk_name = NULL; int ret; pll = devm_kzalloc(dev, sizeof(*pll), GFP_KERNEL); @@ -66,7 +67,9 @@ static int qcom_a53pll_probe(struct platform_device *pdev) pll->status_bit = 16; pll->freq_tbl = a53pll_freq; - init.name = "a53pll"; + of_property_read_string(pdev->dev.of_node, "clock-output-names", + &clk_name); + init.name = clk_name ? clk_name : "a53pll"; init.parent_names = (const char *[]){ "xo" }; init.num_parents = 1; init.ops = &clk_pll_sr2_ops; diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index d7ac6d6b15b6..b8bbfe9622e1 100644 --- a/drivers/clk/qcom/apcs-msm8916.c +++ b/drivers/clk/qcom/apcs-msm8916.c @@ -49,6 +49,7 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) struct clk_regmap_mux_div *a53cc; struct regmap *regmap; struct clk_init_data init = { }; + const char *clk_name = NULL; int ret = -ENODEV; regmap = dev_get_regmap(parent, NULL); @@ -61,7 +62,9 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) if (!a53cc) return -ENOMEM; - init.name = "a53mux"; + of_property_read_string(parent->of_node, "clock-output-names", + &clk_name); + init.name = clk_name ? clk_name : "a53mux"; init.parent_data = pdata; init.num_parents = ARRAY_SIZE(pdata); init.ops = &clk_regmap_mux_div_ops;