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

ARM: imx: Add LVDS general-purpose clocks to i.MX6Q

The i.MX6 has two general-purpose LVDS clocks that can be driven
from a variety of sources. This patch adds a mux and a gate for
both of these clocks.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

authored by

Sean Cross and committed by
Shawn Guo
bf221721 7655fe53

+23 -1
+4
Documentation/devicetree/bindings/clock/imx6q-clock.txt
··· 216 216 cko 201 217 217 vdoa 202 218 218 pll4_audio_div 203 219 + lvds1_sel 204 220 + lvds2_sel 205 221 + lvds1_gate 206 222 + lvds2_gate 207 219 223 220 224 Examples: 221 225
+19 -1
arch/arm/mach-imx/clk-imx6q.c
··· 217 217 "uart_serial", "spdif", "asrc", "hsi_tx", 218 218 }; 219 219 static const char *cko_sels[] = { "cko1", "cko2", }; 220 + static const char *lvds_sels[] = { 221 + "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", 222 + "pll4_audio", "pll5_video", "pll8_mlb", "enet_ref", 223 + "pcie_ref", "sata_ref", 224 + }; 220 225 221 226 enum mx6q_clks { 222 227 dummy, ckil, ckih, osc, pll2_pfd0_352m, pll2_pfd1_594m, pll2_pfd2_396m, ··· 256 251 ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5, 257 252 sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref, usbphy1_gate, 258 253 usbphy2_gate, pll4_post_div, pll5_post_div, pll5_video_div, eim_slow, 259 - spdif, cko2_sel, cko2_podf, cko2, cko, vdoa, pll4_audio_div, clk_max 254 + spdif, cko2_sel, cko2_podf, cko2, cko, vdoa, pll4_audio_div, 255 + lvds1_sel, lvds2_sel, lvds1_gate, lvds2_gate, clk_max 260 256 }; 261 257 262 258 static struct clk *clk[clk_max]; ··· 347 341 clk[enet_ref] = clk_register_divider_table(NULL, "enet_ref", "pll6_enet", 0, 348 342 base + 0xe0, 0, 2, 0, clk_enet_ref_table, 349 343 &imx_ccm_lock); 344 + 345 + clk[lvds1_sel] = imx_clk_mux("lvds1_sel", base + 0x160, 0, 5, lvds_sels, ARRAY_SIZE(lvds_sels)); 346 + clk[lvds2_sel] = imx_clk_mux("lvds2_sel", base + 0x160, 5, 5, lvds_sels, ARRAY_SIZE(lvds_sels)); 347 + 348 + /* 349 + * lvds1_gate and lvds2_gate are pseudo-gates. Both can be 350 + * independently configured as clock inputs or outputs. We treat 351 + * the "output_enable" bit as a gate, even though it's really just 352 + * enabling clock output. 353 + */ 354 + clk[lvds1_gate] = imx_clk_gate("lvds1_gate", "dummy", base + 0x160, 10); 355 + clk[lvds2_gate] = imx_clk_gate("lvds2_gate", "dummy", base + 0x160, 11); 350 356 351 357 /* name parent_name reg idx */ 352 358 clk[pll2_pfd0_352m] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus", base + 0x100, 0);