]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clk: sprd: add mipi_csi_xx gate clocks
authorChunyan Zhang <chunyan.zhang@unisoc.com>
Wed, 27 May 2020 05:36:38 +0000 (13:36 +0800)
committerStephen Boyd <sboyd@kernel.org>
Wed, 27 May 2020 06:41:14 +0000 (23:41 -0700)
mipi_csi_xx clocks are used by camera sensors.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Link: https://lkml.kernel.org/r/20200527053638.31439-5-zhang.lyra@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/sprd/sc9863a-clk.c

index 5dec0faa62392c02fd22fdf11c772ddd5f587041..c2e4fe719a1769e712f06c6a56cf9a2e43895c7a 100644 (file)
@@ -1615,6 +1615,36 @@ static const struct sprd_clk_desc sc9863a_mm_gate_desc = {
        .hw_clks        = &sc9863a_mm_gate_hws,
 };
 
+/* camera sensor clocks */
+static SPRD_GATE_CLK_HW(mipi_csi_clk, "mipi-csi-clk", &mahb_ckg_eb.common.hw,
+                       0x20, BIT(16), 0, SPRD_GATE_NON_AON);
+static SPRD_GATE_CLK_HW(mipi_csi_s_clk, "mipi-csi-s-clk", &mahb_ckg_eb.common.hw,
+                       0x24, BIT(16), 0, SPRD_GATE_NON_AON);
+static SPRD_GATE_CLK_HW(mipi_csi_m_clk, "mipi-csi-m-clk", &mahb_ckg_eb.common.hw,
+                       0x28, BIT(16), 0, SPRD_GATE_NON_AON);
+
+static struct sprd_clk_common *sc9863a_mm_clk_clks[] = {
+       /* address base is 0x60900000 */
+       &mipi_csi_clk.common,
+       &mipi_csi_s_clk.common,
+       &mipi_csi_m_clk.common,
+};
+
+static struct clk_hw_onecell_data sc9863a_mm_clk_hws = {
+       .hws    = {
+               [CLK_MIPI_CSI]          = &mipi_csi_clk.common.hw,
+               [CLK_MIPI_CSI_S]        = &mipi_csi_s_clk.common.hw,
+               [CLK_MIPI_CSI_M]        = &mipi_csi_m_clk.common.hw,
+       },
+       .num    = CLK_MM_CLK_NUM,
+};
+
+static const struct sprd_clk_desc sc9863a_mm_clk_desc = {
+       .clk_clks       = sc9863a_mm_clk_clks,
+       .num_clk_clks   = ARRAY_SIZE(sc9863a_mm_clk_clks),
+       .hw_clks        = &sc9863a_mm_clk_hws,
+};
+
 static SPRD_SC_GATE_CLK_FW_NAME(sim0_eb,       "sim0-eb",      "ext-26m", 0x0,
                                0x1000, BIT(0), 0, 0);
 static SPRD_SC_GATE_CLK_FW_NAME(iis0_eb,       "iis0-eb",      "ext-26m", 0x0,
@@ -1737,6 +1767,8 @@ static const struct of_device_id sprd_sc9863a_clk_ids[] = {
          .data = &sc9863a_aonapb_gate_desc },
        { .compatible = "sprd,sc9863a-mm-gate", /* 0x60800000 */
          .data = &sc9863a_mm_gate_desc },
+       { .compatible = "sprd,sc9863a-mm-clk",  /* 0x60900000 */
+         .data = &sc9863a_mm_clk_desc },
        { .compatible = "sprd,sc9863a-apapb-gate",      /* 0x71300000 */
          .data = &sc9863a_apapb_gate_desc },
        { }