Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: imx6sx: add missing lvds2 clock to the clock tree

i.MX6SX has lvds2 (analog clock2), an I/O clock like lvds1.
And this lvds2, along with lvds1, can be used to provide
external clock source to the internal pll, such as pll4_audio
and pll5_video.

This patch mainly adds the lvds2 to the clock tree and fix its
relationship with pll accordingly.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Anson Huang and committed by
Stephen Boyd
5cc73ff7 60cc43fc

+12 -4
+7 -3
drivers/clk/imx/clk-imx6sx.c
··· 80 80 "arm", "pll1_sys", "dummy", "dummy", "dummy", "dummy", "dummy", "pll5_video_div", 81 81 "dummy", "dummy", "pcie_ref_125m", "dummy", "usbphy1", "usbphy2", 82 82 }; 83 - static const char *pll_bypass_src_sels[] = { "osc", "lvds1_in", }; 83 + static const char *pll_bypass_src_sels[] = { "osc", "lvds1_in", "lvds2_in", "dummy", }; 84 84 static const char *pll1_bypass_sels[] = { "pll1", "pll1_bypass_src", }; 85 85 static const char *pll2_bypass_sels[] = { "pll2", "pll2_bypass_src", }; 86 86 static const char *pll3_bypass_sels[] = { "pll3", "pll3_bypass_src", }; ··· 158 158 clks[IMX6SX_CLK_IPP_DI0] = of_clk_get_by_name(ccm_node, "ipp_di0"); 159 159 clks[IMX6SX_CLK_IPP_DI1] = of_clk_get_by_name(ccm_node, "ipp_di1"); 160 160 161 - /* Clock source from external clock via CLK1 PAD */ 162 - clks[IMX6SX_CLK_ANACLK1] = imx_obtain_fixed_clock("anaclk1", 0); 161 + /* Clock source from external clock via CLK1/2 PAD */ 162 + clks[IMX6SX_CLK_ANACLK1] = of_clk_get_by_name(ccm_node, "anaclk1"); 163 + clks[IMX6SX_CLK_ANACLK2] = of_clk_get_by_name(ccm_node, "anaclk2"); 163 164 164 165 np = of_find_compatible_node(NULL, NULL, "fsl,imx6sx-anatop"); 165 166 base = of_iomap(np, 0); ··· 229 228 clks[IMX6SX_CLK_PCIE_REF_125M] = imx_clk_gate("pcie_ref_125m", "pcie_ref", base + 0xe0, 19); 230 229 231 230 clks[IMX6SX_CLK_LVDS1_OUT] = imx_clk_gate_exclusive("lvds1_out", "lvds1_sel", base + 0x160, 10, BIT(12)); 231 + clks[IMX6SX_CLK_LVDS2_OUT] = imx_clk_gate_exclusive("lvds2_out", "lvds2_sel", base + 0x160, 11, BIT(13)); 232 232 clks[IMX6SX_CLK_LVDS1_IN] = imx_clk_gate_exclusive("lvds1_in", "anaclk1", base + 0x160, 12, BIT(10)); 233 + clks[IMX6SX_CLK_LVDS2_IN] = imx_clk_gate_exclusive("lvds2_in", "anaclk2", base + 0x160, 13, BIT(11)); 233 234 234 235 clks[IMX6SX_CLK_ENET_REF] = clk_register_divider_table(NULL, "enet_ref", "pll6_enet", 0, 235 236 base + 0xe0, 0, 2, 0, clk_enet_ref_table, ··· 273 270 274 271 /* name reg shift width parent_names num_parents */ 275 272 clks[IMX6SX_CLK_LVDS1_SEL] = imx_clk_mux("lvds1_sel", base + 0x160, 0, 5, lvds_sels, ARRAY_SIZE(lvds_sels)); 273 + clks[IMX6SX_CLK_LVDS2_SEL] = imx_clk_mux("lvds2_sel", base + 0x160, 5, 5, lvds_sels, ARRAY_SIZE(lvds_sels)); 276 274 277 275 np = ccm_node; 278 276 base = of_iomap(np, 0);
+5 -1
include/dt-bindings/clock/imx6sx-clock.h
··· 275 275 #define IMX6SX_PLL6_BYPASS 262 276 276 #define IMX6SX_PLL7_BYPASS 263 277 277 #define IMX6SX_CLK_SPDIF_GCLK 264 278 - #define IMX6SX_CLK_CLK_END 265 278 + #define IMX6SX_CLK_LVDS2_SEL 265 279 + #define IMX6SX_CLK_LVDS2_OUT 266 280 + #define IMX6SX_CLK_LVDS2_IN 267 281 + #define IMX6SX_CLK_ANACLK2 268 282 + #define IMX6SX_CLK_CLK_END 269 279 283 280 284 #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */