1 From 0f171b8a6e1723f0ce6f98f8b3fba7d2583088c1 Mon Sep 17 00:00:00 2001
2 From: Kumar Gala <galak@codeaurora.org>
3 Date: Fri, 4 Apr 2014 11:31:29 -0500
4 Subject: [PATCH 079/182] clk: qcom: Add basic support for APQ8064 global
5 clock controller clocks
7 The APQ8064 and MSM8960 share a significant amount of clock data and
8 code between the two SoCs. Rather than duplicating the data we just add
9 support for a unqiue APQ8064 clock table into the MSM8960 code.
11 For now add just enough clocks to get a basic serial port going on an
14 Signed-off-by: Kumar Gala <galak@codeaurora.org>
15 Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
16 Signed-off-by: Mike Turquette <mturquette@linaro.org>
17 [mturquette@linaro.org: trivial conflict due to missing ipq8064 support]
19 .../devicetree/bindings/clock/qcom,gcc.txt | 1 +
20 drivers/clk/qcom/Kconfig | 4 +--
21 drivers/clk/qcom/gcc-msm8960.c | 30 ++++++++++++++++++--
22 3 files changed, 30 insertions(+), 5 deletions(-)
24 diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc.txt b/Documentation/devicetree/bindings/clock/qcom,gcc.txt
25 index 767401f..7b7104e 100644
26 --- a/Documentation/devicetree/bindings/clock/qcom,gcc.txt
27 +++ b/Documentation/devicetree/bindings/clock/qcom,gcc.txt
28 @@ -4,6 +4,7 @@ Qualcomm Global Clock & Reset Controller Binding
30 - compatible : shall contain only one of the following:
36 diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
37 index 995bcfa..7f696b7 100644
38 --- a/drivers/clk/qcom/Kconfig
39 +++ b/drivers/clk/qcom/Kconfig
40 @@ -13,10 +13,10 @@ config MSM_GCC_8660
41 i2c, USB, SD/eMMC, etc.
44 - tristate "MSM8960 Global Clock Controller"
45 + tristate "APQ8064/MSM8960 Global Clock Controller"
46 depends on COMMON_CLK_QCOM
48 - Support for the global clock controller on msm8960 devices.
49 + Support for the global clock controller on apq8064/msm8960 devices.
50 Say Y if you want to use peripheral devices such as UART, SPI,
51 i2c, USB, SD/eMMC, SATA, PCIe, etc.
53 diff --git a/drivers/clk/qcom/gcc-msm8960.c b/drivers/clk/qcom/gcc-msm8960.c
54 index 633b019..8e2b6dd 100644
55 --- a/drivers/clk/qcom/gcc-msm8960.c
56 +++ b/drivers/clk/qcom/gcc-msm8960.c
59 - * Copyright (c) 2013, The Linux Foundation. All rights reserved.
60 + * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
62 * This software is licensed under the terms of the GNU General Public
63 * License version 2, as published by the Free Software Foundation, and
64 @@ -2868,6 +2868,16 @@ static const struct qcom_reset_map gcc_msm8960_resets[] = {
65 [RIVA_RESET] = { 0x35e0 },
68 +static struct clk_regmap *gcc_apq8064_clks[] = {
69 + [PLL8] = &pll8.clkr,
70 + [PLL8_VOTE] = &pll8_vote,
71 + [GSBI7_UART_SRC] = &gsbi7_uart_src.clkr,
72 + [GSBI7_UART_CLK] = &gsbi7_uart_clk.clkr,
73 + [GSBI7_QUP_SRC] = &gsbi7_qup_src.clkr,
74 + [GSBI7_QUP_CLK] = &gsbi7_qup_clk.clkr,
75 + [GSBI7_H_CLK] = &gsbi7_h_clk.clkr,
78 static const struct regmap_config gcc_msm8960_regmap_config = {
81 @@ -2884,8 +2894,17 @@ static const struct qcom_cc_desc gcc_msm8960_desc = {
82 .num_resets = ARRAY_SIZE(gcc_msm8960_resets),
85 +static const struct qcom_cc_desc gcc_apq8064_desc = {
86 + .config = &gcc_msm8960_regmap_config,
87 + .clks = gcc_apq8064_clks,
88 + .num_clks = ARRAY_SIZE(gcc_apq8064_clks),
89 + .resets = gcc_msm8960_resets,
90 + .num_resets = ARRAY_SIZE(gcc_msm8960_resets),
93 static const struct of_device_id gcc_msm8960_match_table[] = {
94 - { .compatible = "qcom,gcc-msm8960" },
95 + { .compatible = "qcom,gcc-msm8960", .data = &gcc_msm8960_desc },
96 + { .compatible = "qcom,gcc-apq8064", .data = &gcc_apq8064_desc },
99 MODULE_DEVICE_TABLE(of, gcc_msm8960_match_table);
100 @@ -2894,6 +2913,11 @@ static int gcc_msm8960_probe(struct platform_device *pdev)
103 struct device *dev = &pdev->dev;
104 + const struct of_device_id *match;
106 + match = of_match_device(gcc_msm8960_match_table, &pdev->dev);
110 /* Temporary until RPM clocks supported */
111 clk = clk_register_fixed_rate(dev, "cxo", NULL, CLK_IS_ROOT, 19200000);
112 @@ -2904,7 +2928,7 @@ static int gcc_msm8960_probe(struct platform_device *pdev)
116 - return qcom_cc_probe(pdev, &gcc_msm8960_desc);
117 + return qcom_cc_probe(pdev, match->data);
120 static int gcc_msm8960_remove(struct platform_device *pdev)