From: Govind Singh <govinds@codeaurora.org>
To: bjorn.andersson@linaro.org, linux-remoteproc@vger.kernel.org,
sboyd@kernel.org, linux-clk@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Cc: andy.gross@linaro.org, linux-soc@vger.kernel.org,
devicetree@vger.kernel.org, Govind Singh <govinds@codeaurora.org>
Subject: [PATCH v5 3/7] clk: qcom: define probe by index API as common API
Date: Fri, 26 Jul 2019 14:53:28 +0530 [thread overview]
Message-ID: <20190726092332.25202-4-govinds@codeaurora.org> (raw)
In-Reply-To: <20190726092332.25202-1-govinds@codeaurora.org>
Extend the probe by index API in common code to be used
by other qcom clock controller.
Signed-off-by: Govind Singh <govinds@codeaurora.org>
---
drivers/clk/qcom/common.c | 20 ++++++++++++++++++++
drivers/clk/qcom/common.h | 2 ++
drivers/clk/qcom/lpasscc-sdm845.c | 23 ++---------------------
3 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
index a6b2f86112d8..28ddc747d703 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -306,4 +306,24 @@ int qcom_cc_probe(struct platform_device *pdev, const struct qcom_cc_desc *desc)
}
EXPORT_SYMBOL_GPL(qcom_cc_probe);
+int qcom_cc_probe_by_index(struct platform_device *pdev, int index,
+ const struct qcom_cc_desc *desc)
+{
+ struct regmap *regmap;
+ struct resource *res;
+ void __iomem *base;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, index);
+ base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(base))
+ return -ENOMEM;
+
+ regmap = devm_regmap_init_mmio(&pdev->dev, base, desc->config);
+ if (IS_ERR(regmap))
+ return PTR_ERR(regmap);
+
+ return qcom_cc_really_probe(pdev, desc, regmap);
+}
+EXPORT_SYMBOL_GPL(qcom_cc_probe_by_index);
+
MODULE_LICENSE("GPL v2");
diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h
index 1e2a8bdac55a..bb39a7e106d8 100644
--- a/drivers/clk/qcom/common.h
+++ b/drivers/clk/qcom/common.h
@@ -61,5 +61,7 @@ extern int qcom_cc_really_probe(struct platform_device *pdev,
struct regmap *regmap);
extern int qcom_cc_probe(struct platform_device *pdev,
const struct qcom_cc_desc *desc);
+extern int qcom_cc_probe_by_index(struct platform_device *pdev, int index,
+ const struct qcom_cc_desc *desc);
#endif
diff --git a/drivers/clk/qcom/lpasscc-sdm845.c b/drivers/clk/qcom/lpasscc-sdm845.c
index e246b99dfbc6..56d3e9928892 100644
--- a/drivers/clk/qcom/lpasscc-sdm845.c
+++ b/drivers/clk/qcom/lpasscc-sdm845.c
@@ -112,25 +112,6 @@ static const struct qcom_cc_desc lpass_qdsp6ss_sdm845_desc = {
.num_clks = ARRAY_SIZE(lpass_qdsp6ss_sdm845_clocks),
};
-static int lpass_clocks_sdm845_probe(struct platform_device *pdev, int index,
- const struct qcom_cc_desc *desc)
-{
- struct regmap *regmap;
- struct resource *res;
- void __iomem *base;
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, index);
- base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(base))
- return PTR_ERR(base);
-
- regmap = devm_regmap_init_mmio(&pdev->dev, base, desc->config);
- if (IS_ERR(regmap))
- return PTR_ERR(regmap);
-
- return qcom_cc_really_probe(pdev, desc, regmap);
-}
-
static int lpass_cc_sdm845_probe(struct platform_device *pdev)
{
const struct qcom_cc_desc *desc;
@@ -139,14 +120,14 @@ static int lpass_cc_sdm845_probe(struct platform_device *pdev)
lpass_regmap_config.name = "cc";
desc = &lpass_cc_sdm845_desc;
- ret = lpass_clocks_sdm845_probe(pdev, 0, desc);
+ ret = qcom_cc_probe_by_index(pdev, 0, desc);
if (ret)
return ret;
lpass_regmap_config.name = "qdsp6ss";
desc = &lpass_qdsp6ss_sdm845_desc;
- return lpass_clocks_sdm845_probe(pdev, 1, desc);
+ return qcom_cc_probe_by_index(pdev, 1, desc);
}
static const struct of_device_id lpass_cc_sdm845_match_table[] = {
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2019-07-26 9:23 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-26 9:23 [PATCH v5 0/7] Add non PAS wcss Q6 support for QCS404 Govind Singh
2019-07-26 9:23 ` [PATCH v5 1/7] clk: qcom: Add WCSS gcc clock control " Govind Singh
2019-08-08 15:10 ` Stephen Boyd
2019-07-26 9:23 ` [PATCH v5 2/7] dt-bindings: clock: qcom: Add QCOM Q6SSTOP clock controller bindings Govind Singh
2019-07-26 19:43 ` Stephen Boyd
2019-07-26 9:23 ` Govind Singh [this message]
2019-08-08 15:20 ` [PATCH v5 3/7] clk: qcom: define probe by index API as common API Stephen Boyd
2019-07-26 9:23 ` [PATCH v5 4/7] clk: qcom: Add Q6SSTOP clock controller for QCS404 Govind Singh
2019-08-08 15:09 ` Stephen Boyd
2019-08-13 13:14 ` Govind Singh
2019-07-26 9:23 ` [PATCH v5 5/7] remoteproc: qcom: wcss: populate hardcoded param using driver data Govind Singh
2019-07-26 9:23 ` [PATCH v5 6/7] remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404 Govind Singh
2019-07-26 9:23 ` [PATCH v5 7/7] remoteproc: qcom: wcss: explicitly request exclusive reset control Govind Singh
2020-07-03 8:12 ` [v6 0/4] Add non PAS wcss Q6 support for QCS404 Gokul Sriram Palanisamy
2020-07-03 8:12 ` [v6 1/4] remoteproc: qcom: wcss: populate hardcoded param using driver data Gokul Sriram Palanisamy
2020-07-03 8:12 ` [v6 2/4] dt-bindings: remoteproc: qcom: Add Q6V5 Modem PIL binding for QCS404 Gokul Sriram Palanisamy
2020-07-03 8:12 ` [v6 3/4] remoteproc: qcom: wcss: Add non pas wcss Q6 support " Gokul Sriram Palanisamy
2020-07-03 8:12 ` [v6 4/4] remoteproc: qcom: wcss: explicitly request exclusive reset control Gokul Sriram Palanisamy
2020-07-03 8:58 ` [v7 0/4] Add non PAS wcss Q6 support for QCS404 Gokul Sriram Palanisamy
2020-07-03 8:58 ` [v7 1/4] remoteproc: qcom: wcss: populate hardcoded param using driver data Gokul Sriram Palanisamy
2020-07-10 23:44 ` Stephen Boyd
2020-07-28 10:45 ` gokulsri
2020-07-03 8:58 ` [v7 2/4] dt-bindings: remoteproc: qcom: Add Q6V5 Modem PIL binding for QCS404 Gokul Sriram Palanisamy
2020-07-09 20:38 ` Rob Herring
2020-07-03 8:58 ` [v7 3/4] remoteproc: qcom: wcss: Add non pas wcss Q6 support " Gokul Sriram Palanisamy
2020-07-03 8:58 ` [v7 4/4] remoteproc: qcom: wcss: explicitly request exclusive reset control Gokul Sriram Palanisamy
2020-07-10 23:40 ` [v7 0/4] Add non PAS wcss Q6 support for QCS404 Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190726092332.25202-4-govinds@codeaurora.org \
--to=govinds@codeaurora.org \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).