mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
106 lines
3.3 KiB
Diff
106 lines
3.3 KiB
Diff
From b5c28ea3b9a963d425ae88ef53d266ff8ae95bc2 Mon Sep 17 00:00:00 2001
|
|
From: Sivaprakash Murugesan <sivaprak@codeaurora.org>
|
|
Date: Fri, 24 Apr 2020 23:05:50 +0530
|
|
Subject: [PATCH 2/3] clk: qcom: ipq8074: make apss clock as child of mailbox
|
|
|
|
both apcs mailbox and apss clock controller access the same register
|
|
space, resource request will fail for one of the two drivers.
|
|
|
|
to resolve this make apss clock controller as child of mailbox, the apss
|
|
clock controller will use mailbox regmap for resource request and probe.
|
|
|
|
Signed-off-by: Sivaprakash Murugesan <sivaprak@codeaurora.org>
|
|
Change-Id: Ic26ee78b6f680fa0655a73d3176bae271725ab05
|
|
---
|
|
drivers/clk/qcom/apss-ipq8074.c | 14 ++++++--------
|
|
drivers/mailbox/qcom-apcs-ipc-mailbox.c | 18 +++++++++++++++---
|
|
2 files changed, 21 insertions(+), 11 deletions(-)
|
|
|
|
--- a/drivers/clk/qcom/apss-ipq8074.c
|
|
+++ b/drivers/clk/qcom/apss-ipq8074.c
|
|
@@ -147,12 +147,6 @@ static struct clk_regmap *apss_ipq807x_c
|
|
[APCS_ALIAS0_CORE_CLK] = &apcs_alias0_core_clk.clkr,
|
|
};
|
|
|
|
-static const struct of_device_id apss_ipq807x_match_table[] = {
|
|
- { .compatible = "qcom,apss-ipq807x" },
|
|
- { }
|
|
-};
|
|
-MODULE_DEVICE_TABLE(of, apss_ipq807x_match_table);
|
|
-
|
|
static const struct regmap_config apss_ipq807x_regmap_config = {
|
|
.reg_bits = 32,
|
|
.reg_stride = 4,
|
|
@@ -170,8 +164,13 @@ static const struct qcom_cc_desc apss_ip
|
|
static int apss_ipq807x_probe(struct platform_device *pdev)
|
|
{
|
|
int ret;
|
|
+ struct regmap *regmap;
|
|
+
|
|
+ regmap = dev_get_regmap(pdev->dev.parent, NULL);
|
|
+ if (IS_ERR(regmap))
|
|
+ return PTR_ERR(regmap);
|
|
|
|
- ret = qcom_cc_probe(pdev, &apss_ipq807x_desc);
|
|
+ ret = qcom_cc_really_probe(pdev, &apss_ipq807x_desc, regmap);
|
|
|
|
dev_dbg(&pdev->dev, "Registered ipq807x apss clock provider\n");
|
|
|
|
@@ -189,7 +188,6 @@ static struct platform_driver apss_ipq80
|
|
.driver = {
|
|
.name = "qcom,apss-ipq807x",
|
|
.owner = THIS_MODULE,
|
|
- .of_match_table = apss_ipq807x_match_table,
|
|
},
|
|
};
|
|
|
|
--- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
|
|
+++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
|
|
@@ -65,7 +65,7 @@ static const struct regmap_config apcs_r
|
|
.reg_bits = 32,
|
|
.reg_stride = 4,
|
|
.val_bits = 32,
|
|
- .max_register = 0xFFC,
|
|
+ .max_register = 0x5FFC,
|
|
.fast_io = true,
|
|
};
|
|
|
|
@@ -82,6 +82,16 @@ static const struct mbox_chan_ops qcom_a
|
|
.send_data = qcom_apcs_ipc_send_data,
|
|
};
|
|
|
|
+static const struct of_device_id apcs_clk_match_table[] = {
|
|
+ { .compatible = "qcom,msm8916-apcs-kpss-global",
|
|
+ . data = "qcom-apcs-msm8916-clk", },
|
|
+ { .compatible = "qcom,qcs404-apcs-apps-global",
|
|
+ .data = "qcom-apcs-msm8916-clk", },
|
|
+ { .compatible = "qcom,ipq8074-apcs-apps-global",
|
|
+ .data = "qcom,apss-ipq807x", },
|
|
+ {}
|
|
+};
|
|
+
|
|
static int qcom_apcs_ipc_probe(struct platform_device *pdev)
|
|
{
|
|
struct qcom_apcs_ipc *apcs;
|
|
@@ -91,6 +101,7 @@ static int qcom_apcs_ipc_probe(struct pl
|
|
void __iomem *base;
|
|
unsigned long i;
|
|
int ret;
|
|
+ const struct of_device_id *device_id;
|
|
|
|
apcs = devm_kzalloc(&pdev->dev, sizeof(*apcs), GFP_KERNEL);
|
|
if (!apcs)
|
|
@@ -125,9 +136,10 @@ static int qcom_apcs_ipc_probe(struct pl
|
|
return ret;
|
|
}
|
|
|
|
- if (apcs_data->clk_name) {
|
|
+ device_id = of_match_device(apcs_clk_match_table, &pdev->dev);
|
|
+ if (device_id) {
|
|
apcs->clk = platform_device_register_data(&pdev->dev,
|
|
- apcs_data->clk_name,
|
|
+ device_id->data,
|
|
PLATFORM_DEVID_AUTO,
|
|
NULL, 0);
|
|
if (IS_ERR(apcs->clk))
|