Commit a085f877 authored by Stephen Boyd's avatar Stephen Boyd

clk: qcom: Move cxo/pxo/xo into dt files

Put these clocks into the dt files instead of registering them
from C code. This provides a few benefits. It allows us to
specify the frequency of these clocks at the board level instead
of hard-coding them in the driver. It allows us to insert an RPM
clock in between the consumers of the crystals and the actual
clock. And finally, it helps us transition the GCC driver to use
RPM clocks when that configuration is enabled.

Cc: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent ee15faff
...@@ -3607,18 +3607,16 @@ MODULE_DEVICE_TABLE(of, gcc_apq8084_match_table); ...@@ -3607,18 +3607,16 @@ MODULE_DEVICE_TABLE(of, gcc_apq8084_match_table);
static int gcc_apq8084_probe(struct platform_device *pdev) static int gcc_apq8084_probe(struct platform_device *pdev)
{ {
struct clk *clk; int ret;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
/* Temporary until RPM clocks supported */ ret = qcom_cc_register_board_clk(dev, "xo_board", "xo", 19200000);
clk = clk_register_fixed_rate(dev, "xo", NULL, CLK_IS_ROOT, 19200000); if (ret)
if (IS_ERR(clk)) return ret;
return PTR_ERR(clk);
clk = clk_register_fixed_rate(dev, "sleep_clk_src", NULL, ret = qcom_cc_register_sleep_clk(dev);
CLK_IS_ROOT, 32768); if (ret)
if (IS_ERR(clk)) return ret;
return PTR_ERR(clk);
return qcom_cc_probe(pdev, &gcc_apq8084_desc); return qcom_cc_probe(pdev, &gcc_apq8084_desc);
} }
......
...@@ -3023,19 +3023,17 @@ MODULE_DEVICE_TABLE(of, gcc_ipq806x_match_table); ...@@ -3023,19 +3023,17 @@ MODULE_DEVICE_TABLE(of, gcc_ipq806x_match_table);
static int gcc_ipq806x_probe(struct platform_device *pdev) static int gcc_ipq806x_probe(struct platform_device *pdev)
{ {
struct clk *clk;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct regmap *regmap; struct regmap *regmap;
int ret; int ret;
/* Temporary until RPM clocks supported */ ret = qcom_cc_register_board_clk(dev, "cxo_board", "cxo", 19200000);
clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 25000000); if (ret)
if (IS_ERR(clk)) return ret;
return PTR_ERR(clk);
clk = clk_register_fixed_rate(dev, "pxo", NULL, CLK_IS_ROOT, 25000000); ret = qcom_cc_register_board_clk(dev, "pxo_board", "pxo", 27000000);
if (IS_ERR(clk)) if (ret)
return PTR_ERR(clk); return ret;
ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc); ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc);
if (ret) if (ret)
......
...@@ -2720,17 +2720,16 @@ MODULE_DEVICE_TABLE(of, gcc_msm8660_match_table); ...@@ -2720,17 +2720,16 @@ MODULE_DEVICE_TABLE(of, gcc_msm8660_match_table);
static int gcc_msm8660_probe(struct platform_device *pdev) static int gcc_msm8660_probe(struct platform_device *pdev)
{ {
struct clk *clk; int ret;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
/* Temporary until RPM clocks supported */ ret = qcom_cc_register_board_clk(dev, "cxo_board", "cxo", 19200000);
clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 19200000); if (ret)
if (IS_ERR(clk)) return ret;
return PTR_ERR(clk);
clk = clk_register_fixed_rate(dev, "pxo", NULL, CLK_IS_ROOT, 27000000); ret = qcom_cc_register_board_clk(dev, "pxo_board", "pxo", 27000000);
if (IS_ERR(clk)) if (ret)
return PTR_ERR(clk); return ret;
return qcom_cc_probe(pdev, &gcc_msm8660_desc); return qcom_cc_probe(pdev, &gcc_msm8660_desc);
} }
......
...@@ -3503,7 +3503,6 @@ MODULE_DEVICE_TABLE(of, gcc_msm8960_match_table); ...@@ -3503,7 +3503,6 @@ MODULE_DEVICE_TABLE(of, gcc_msm8960_match_table);
static int gcc_msm8960_probe(struct platform_device *pdev) static int gcc_msm8960_probe(struct platform_device *pdev)
{ {
struct clk *clk;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
const struct of_device_id *match; const struct of_device_id *match;
struct platform_device *tsens; struct platform_device *tsens;
...@@ -3513,14 +3512,13 @@ static int gcc_msm8960_probe(struct platform_device *pdev) ...@@ -3513,14 +3512,13 @@ static int gcc_msm8960_probe(struct platform_device *pdev)
if (!match) if (!match)
return -EINVAL; return -EINVAL;
/* Temporary until RPM clocks supported */ ret = qcom_cc_register_board_clk(dev, "cxo_board", "cxo", 19200000);
clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 19200000); if (ret)
if (IS_ERR(clk)) return ret;
return PTR_ERR(clk);
clk = clk_register_fixed_rate(dev, "pxo", NULL, CLK_IS_ROOT, 27000000); ret = qcom_cc_register_board_clk(dev, "pxo_board", "pxo", 27000000);
if (IS_ERR(clk)) if (ret)
return PTR_ERR(clk); return ret;
ret = qcom_cc_probe(pdev, match->data); ret = qcom_cc_probe(pdev, match->data);
if (ret) if (ret)
......
...@@ -2717,7 +2717,7 @@ static void msm8974_pro_clock_override(void) ...@@ -2717,7 +2717,7 @@ static void msm8974_pro_clock_override(void)
static int gcc_msm8974_probe(struct platform_device *pdev) static int gcc_msm8974_probe(struct platform_device *pdev)
{ {
struct clk *clk; int ret;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
bool pro; bool pro;
const struct of_device_id *id; const struct of_device_id *id;
...@@ -2730,16 +2730,13 @@ static int gcc_msm8974_probe(struct platform_device *pdev) ...@@ -2730,16 +2730,13 @@ static int gcc_msm8974_probe(struct platform_device *pdev)
if (pro) if (pro)
msm8974_pro_clock_override(); msm8974_pro_clock_override();
/* Temporary until RPM clocks supported */ ret = qcom_cc_register_board_clk(dev, "xo_board", "xo", 19200000);
clk = clk_register_fixed_rate(dev, "xo", NULL, CLK_IS_ROOT, 19200000); if (ret)
if (IS_ERR(clk)) return ret;
return PTR_ERR(clk);
/* Should move to DT node? */ ret = qcom_cc_register_sleep_clk(dev);
clk = clk_register_fixed_rate(dev, "sleep_clk_src", NULL, if (ret)
CLK_IS_ROOT, 32768); return ret;
if (IS_ERR(clk))
return PTR_ERR(clk);
return qcom_cc_probe(pdev, &gcc_msm8974_desc); return qcom_cc_probe(pdev, &gcc_msm8974_desc);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment