diff options
author | Kumar Gala <galak@codeaurora.org> | 2014-04-04 12:31:29 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-04-30 14:54:16 -0400 |
commit | 2d85a713dca8b1c96e78e9f17c6a9bc88d11515a (patch) | |
tree | b714b9425b639a86b1685a512eef0a8a26b31c05 | |
parent | 49fc825f0cc221768c5711b8ec6a71bd49f2663e (diff) |
clk: qcom: Add basic support for APQ8064 global clock controller clocks
The APQ8064 and MSM8960 share a significant amount of clock data and
code between the two SoCs. Rather than duplicating the data we just add
support for a unqiue APQ8064 clock table into the MSM8960 code.
For now add just enough clocks to get a basic serial port going on an
APQ8064 device.
Signed-off-by: Kumar Gala <galak@codeaurora.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
[mturquette@linaro.org: trivial conflict due to missing ipq8064 support]
-rw-r--r-- | Documentation/devicetree/bindings/clock/qcom,gcc.txt | 1 | ||||
-rw-r--r-- | drivers/clk/qcom/Kconfig | 4 | ||||
-rw-r--r-- | drivers/clk/qcom/gcc-msm8960.c | 30 |
3 files changed, 30 insertions, 5 deletions
diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc.txt b/Documentation/devicetree/bindings/clock/qcom,gcc.txt index 767401f42871..7b7104e8cb1e 100644 --- a/Documentation/devicetree/bindings/clock/qcom,gcc.txt +++ b/Documentation/devicetree/bindings/clock/qcom,gcc.txt | |||
@@ -4,6 +4,7 @@ Qualcomm Global Clock & Reset Controller Binding | |||
4 | Required properties : | 4 | Required properties : |
5 | - compatible : shall contain only one of the following: | 5 | - compatible : shall contain only one of the following: |
6 | 6 | ||
7 | "qcom,gcc-apq8064" | ||
7 | "qcom,gcc-msm8660" | 8 | "qcom,gcc-msm8660" |
8 | "qcom,gcc-msm8960" | 9 | "qcom,gcc-msm8960" |
9 | "qcom,gcc-msm8974" | 10 | "qcom,gcc-msm8974" |
diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig index 995bcfa021a4..7f696b7d4422 100644 --- a/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig | |||
@@ -13,10 +13,10 @@ config MSM_GCC_8660 | |||
13 | i2c, USB, SD/eMMC, etc. | 13 | i2c, USB, SD/eMMC, etc. |
14 | 14 | ||
15 | config MSM_GCC_8960 | 15 | config MSM_GCC_8960 |
16 | tristate "MSM8960 Global Clock Controller" | 16 | tristate "APQ8064/MSM8960 Global Clock Controller" |
17 | depends on COMMON_CLK_QCOM | 17 | depends on COMMON_CLK_QCOM |
18 | help | 18 | help |
19 | Support for the global clock controller on msm8960 devices. | 19 | Support for the global clock controller on apq8064/msm8960 devices. |
20 | Say Y if you want to use peripheral devices such as UART, SPI, | 20 | Say Y if you want to use peripheral devices such as UART, SPI, |
21 | i2c, USB, SD/eMMC, SATA, PCIe, etc. | 21 | i2c, USB, SD/eMMC, SATA, PCIe, etc. |
22 | 22 | ||
diff --git a/drivers/clk/qcom/gcc-msm8960.c b/drivers/clk/qcom/gcc-msm8960.c index 633b019891bb..8e2b6ddcb8e4 100644 --- a/drivers/clk/qcom/gcc-msm8960.c +++ b/drivers/clk/qcom/gcc-msm8960.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | 2 | * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. |
3 | * | 3 | * |
4 | * This software is licensed under the terms of the GNU General Public | 4 | * This software is licensed under the terms of the GNU General Public |
5 | * License version 2, as published by the Free Software Foundation, and | 5 | * License version 2, as published by the Free Software Foundation, and |
@@ -2868,6 +2868,16 @@ static const struct qcom_reset_map gcc_msm8960_resets[] = { | |||
2868 | [RIVA_RESET] = { 0x35e0 }, | 2868 | [RIVA_RESET] = { 0x35e0 }, |
2869 | }; | 2869 | }; |
2870 | 2870 | ||
2871 | static struct clk_regmap *gcc_apq8064_clks[] = { | ||
2872 | [PLL8] = &pll8.clkr, | ||
2873 | [PLL8_VOTE] = &pll8_vote, | ||
2874 | [GSBI7_UART_SRC] = &gsbi7_uart_src.clkr, | ||
2875 | [GSBI7_UART_CLK] = &gsbi7_uart_clk.clkr, | ||
2876 | [GSBI7_QUP_SRC] = &gsbi7_qup_src.clkr, | ||
2877 | [GSBI7_QUP_CLK] = &gsbi7_qup_clk.clkr, | ||
2878 | [GSBI7_H_CLK] = &gsbi7_h_clk.clkr, | ||
2879 | }; | ||
2880 | |||
2871 | static const struct regmap_config gcc_msm8960_regmap_config = { | 2881 | static const struct regmap_config gcc_msm8960_regmap_config = { |
2872 | .reg_bits = 32, | 2882 | .reg_bits = 32, |
2873 | .reg_stride = 4, | 2883 | .reg_stride = 4, |
@@ -2884,8 +2894,17 @@ static const struct qcom_cc_desc gcc_msm8960_desc = { | |||
2884 | .num_resets = ARRAY_SIZE(gcc_msm8960_resets), | 2894 | .num_resets = ARRAY_SIZE(gcc_msm8960_resets), |
2885 | }; | 2895 | }; |
2886 | 2896 | ||
2897 | static const struct qcom_cc_desc gcc_apq8064_desc = { | ||
2898 | .config = &gcc_msm8960_regmap_config, | ||
2899 | .clks = gcc_apq8064_clks, | ||
2900 | .num_clks = ARRAY_SIZE(gcc_apq8064_clks), | ||
2901 | .resets = gcc_msm8960_resets, | ||
2902 | .num_resets = ARRAY_SIZE(gcc_msm8960_resets), | ||
2903 | }; | ||
2904 | |||
2887 | static const struct of_device_id gcc_msm8960_match_table[] = { | 2905 | static const struct of_device_id gcc_msm8960_match_table[] = { |
2888 | { .compatible = "qcom,gcc-msm8960" }, | 2906 | { .compatible = "qcom,gcc-msm8960", .data = &gcc_msm8960_desc }, |
2907 | { .compatible = "qcom,gcc-apq8064", .data = &gcc_apq8064_desc }, | ||
2889 | { } | 2908 | { } |
2890 | }; | 2909 | }; |
2891 | MODULE_DEVICE_TABLE(of, gcc_msm8960_match_table); | 2910 | MODULE_DEVICE_TABLE(of, gcc_msm8960_match_table); |
@@ -2894,6 +2913,11 @@ static int gcc_msm8960_probe(struct platform_device *pdev) | |||
2894 | { | 2913 | { |
2895 | struct clk *clk; | 2914 | struct clk *clk; |
2896 | struct device *dev = &pdev->dev; | 2915 | struct device *dev = &pdev->dev; |
2916 | const struct of_device_id *match; | ||
2917 | |||
2918 | match = of_match_device(gcc_msm8960_match_table, &pdev->dev); | ||
2919 | if (!match) | ||
2920 | return -EINVAL; | ||
2897 | 2921 | ||
2898 | /* Temporary until RPM clocks supported */ | 2922 | /* Temporary until RPM clocks supported */ |
2899 | clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 19200000); | 2923 | clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 19200000); |
@@ -2904,7 +2928,7 @@ static int gcc_msm8960_probe(struct platform_device *pdev) | |||
2904 | if (IS_ERR(clk)) | 2928 | if (IS_ERR(clk)) |
2905 | return PTR_ERR(clk); | 2929 | return PTR_ERR(clk); |
2906 | 2930 | ||
2907 | return qcom_cc_probe(pdev, &gcc_msm8960_desc); | 2931 | return qcom_cc_probe(pdev, match->data); |
2908 | } | 2932 | } |
2909 | 2933 | ||
2910 | static int gcc_msm8960_remove(struct platform_device *pdev) | 2934 | static int gcc_msm8960_remove(struct platform_device *pdev) |