clk: qcom: Move cxo/pxo/xo into dt files
authorStephen Boyd <sboyd@codeaurora.org>
Tue, 27 Oct 2015 01:10:09 +0000 (18:10 -0700)
committerStephen Boyd <sboyd@codeaurora.org>
Mon, 16 Nov 2015 19:07:06 +0000 (11:07 -0800)
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: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/qcom/gcc-apq8084.c
drivers/clk/qcom/gcc-ipq806x.c
drivers/clk/qcom/gcc-msm8660.c
drivers/clk/qcom/gcc-msm8960.c
drivers/clk/qcom/gcc-msm8974.c

index 1567c3a7953474af552fd71d6f92773ec23bc898..070037a29ea5842ba6cd332563570fc1ffd8689c 100644 (file)
@@ -3607,18 +3607,16 @@ MODULE_DEVICE_TABLE(of, gcc_apq8084_match_table);
 
 static int gcc_apq8084_probe(struct platform_device *pdev)
 {
-       struct clk *clk;
+       int ret;
        struct device *dev = &pdev->dev;
 
-       /* Temporary until RPM clocks supported */
-       clk = clk_register_fixed_rate(dev, "xo", NULL, CLK_IS_ROOT, 19200000);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_board_clk(dev, "xo_board", "xo", 19200000);
+       if (ret)
+               return ret;
 
-       clk = clk_register_fixed_rate(dev, "sleep_clk_src", NULL,
-                                     CLK_IS_ROOT, 32768);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_sleep_clk(dev);
+       if (ret)
+               return ret;
 
        return qcom_cc_probe(pdev, &gcc_apq8084_desc);
 }
index 16fc64c082a5e1e351e5c957cfe7d1a44b1c8d22..dd5402bac62029824fd059a353d0c00d4e8576fc 100644 (file)
@@ -3023,19 +3023,17 @@ MODULE_DEVICE_TABLE(of, gcc_ipq806x_match_table);
 
 static int gcc_ipq806x_probe(struct platform_device *pdev)
 {
-       struct clk *clk;
        struct device *dev = &pdev->dev;
        struct regmap *regmap;
        int ret;
 
-       /* Temporary until RPM clocks supported */
-       clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 25000000);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_board_clk(dev, "cxo_board", "cxo", 19200000);
+       if (ret)
+               return ret;
 
-       clk = clk_register_fixed_rate(dev, "pxo", NULL, CLK_IS_ROOT, 25000000);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_board_clk(dev, "pxo_board", "pxo", 27000000);
+       if (ret)
+               return ret;
 
        ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc);
        if (ret)
index f110bb5a1df3ea868c19f491c33ee2c86bab9fb0..ad413036f7c783ee0ba8576bf512dfe3dea08dda 100644 (file)
@@ -2720,17 +2720,16 @@ MODULE_DEVICE_TABLE(of, gcc_msm8660_match_table);
 
 static int gcc_msm8660_probe(struct platform_device *pdev)
 {
-       struct clk *clk;
+       int ret;
        struct device *dev = &pdev->dev;
 
-       /* Temporary until RPM clocks supported */
-       clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 19200000);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_board_clk(dev, "cxo_board", "cxo", 19200000);
+       if (ret)
+               return ret;
 
-       clk = clk_register_fixed_rate(dev, "pxo", NULL, CLK_IS_ROOT, 27000000);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_board_clk(dev, "pxo_board", "pxo", 27000000);
+       if (ret)
+               return ret;
 
        return qcom_cc_probe(pdev, &gcc_msm8660_desc);
 }
index 66c18bc97857d8d7cf75318fe91a153dcb3945d1..983dd7dc89a7970e3c1c8d35a427a56b48959929 100644 (file)
@@ -3503,7 +3503,6 @@ MODULE_DEVICE_TABLE(of, gcc_msm8960_match_table);
 
 static int gcc_msm8960_probe(struct platform_device *pdev)
 {
-       struct clk *clk;
        struct device *dev = &pdev->dev;
        const struct of_device_id *match;
        struct platform_device *tsens;
@@ -3513,14 +3512,13 @@ static int gcc_msm8960_probe(struct platform_device *pdev)
        if (!match)
                return -EINVAL;
 
-       /* Temporary until RPM clocks supported */
-       clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 19200000);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_board_clk(dev, "cxo_board", "cxo", 19200000);
+       if (ret)
+               return ret;
 
-       clk = clk_register_fixed_rate(dev, "pxo", NULL, CLK_IS_ROOT, 27000000);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_board_clk(dev, "pxo_board", "pxo", 27000000);
+       if (ret)
+               return ret;
 
        ret = qcom_cc_probe(pdev, match->data);
        if (ret)
index 28abb8f8f293d1c3ad373139796d4725bd040e77..335952db309bd3260c4c86cd048417fb43ac9cbd 100644 (file)
@@ -2717,7 +2717,7 @@ static void msm8974_pro_clock_override(void)
 
 static int gcc_msm8974_probe(struct platform_device *pdev)
 {
-       struct clk *clk;
+       int ret;
        struct device *dev = &pdev->dev;
        bool pro;
        const struct of_device_id *id;
@@ -2730,16 +2730,13 @@ static int gcc_msm8974_probe(struct platform_device *pdev)
        if (pro)
                msm8974_pro_clock_override();
 
-       /* Temporary until RPM clocks supported */
-       clk = clk_register_fixed_rate(dev, "xo", NULL, CLK_IS_ROOT, 19200000);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_board_clk(dev, "xo_board", "xo", 19200000);
+       if (ret)
+               return ret;
 
-       /* Should move to DT node? */
-       clk = clk_register_fixed_rate(dev, "sleep_clk_src", NULL,
-                                     CLK_IS_ROOT, 32768);
-       if (IS_ERR(clk))
-               return PTR_ERR(clk);
+       ret = qcom_cc_register_sleep_clk(dev);
+       if (ret)
+               return ret;
 
        return qcom_cc_probe(pdev, &gcc_msm8974_desc);
 }