aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Cross <xobs@kosagi.com>2013-09-16 04:20:52 -0400
committerShawn Guo <shawn.guo@linaro.org>2013-10-20 21:15:07 -0400
commitbf22172158cd6dcc5be6dc286ff5c33794dd0ae8 (patch)
tree002f49c762bb106e8dc0b6d7e2d582b258c48e81
parent7655fe53f4d39379d3f619e1ed49c79aba4d319b (diff)
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>
-rw-r--r--Documentation/devicetree/bindings/clock/imx6q-clock.txt4
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c20
2 files changed, 23 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/clock/imx6q-clock.txt b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
index e8b1baae9ae4..6aab72bf67ea 100644
--- a/Documentation/devicetree/bindings/clock/imx6q-clock.txt
+++ b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
@@ -216,6 +216,10 @@ clocks and IDs.
216 cko 201 216 cko 201
217 vdoa 202 217 vdoa 202
218 pll4_audio_div 203 218 pll4_audio_div 203
219 lvds1_sel 204
220 lvds2_sel 205
221 lvds1_gate 206
222 lvds2_gate 207
219 223
220Examples: 224Examples:
221 225
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index c68156621cc8..e8e5bad82b30 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -217,6 +217,11 @@ static const char *cko2_sels[] = {
217 "uart_serial", "spdif", "asrc", "hsi_tx", 217 "uart_serial", "spdif", "asrc", "hsi_tx",
218}; 218};
219static const char *cko_sels[] = { "cko1", "cko2", }; 219static const char *cko_sels[] = { "cko1", "cko2", };
220static 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
221enum mx6q_clks { 226enum mx6q_clks {
222 dummy, ckil, ckih, osc, pll2_pfd0_352m, pll2_pfd1_594m, pll2_pfd2_396m, 227 dummy, ckil, ckih, osc, pll2_pfd0_352m, pll2_pfd1_594m, pll2_pfd2_396m,
@@ -251,7 +256,8 @@ enum mx6q_clks {
251 ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5, 256 ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5,
252 sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref, usbphy1_gate, 257 sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref, usbphy1_gate,
253 usbphy2_gate, pll4_post_div, pll5_post_div, pll5_video_div, eim_slow, 258 usbphy2_gate, pll4_post_div, pll5_post_div, pll5_video_div, eim_slow,
254 spdif, cko2_sel, cko2_podf, cko2, cko, vdoa, pll4_audio_div, clk_max 259 spdif, cko2_sel, cko2_podf, cko2, cko, vdoa, pll4_audio_div,
260 lvds1_sel, lvds2_sel, lvds1_gate, lvds2_gate, clk_max
255}; 261};
256 262
257static struct clk *clk[clk_max]; 263static struct clk *clk[clk_max];
@@ -342,6 +348,18 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
342 base + 0xe0, 0, 2, 0, clk_enet_ref_table, 348 base + 0xe0, 0, 2, 0, clk_enet_ref_table,
343 &imx_ccm_lock); 349 &imx_ccm_lock);
344 350
351 clk[lvds1_sel] = imx_clk_mux("lvds1_sel", base + 0x160, 0, 5, lvds_sels, ARRAY_SIZE(lvds_sels));
352 clk[lvds2_sel] = imx_clk_mux("lvds2_sel", base + 0x160, 5, 5, lvds_sels, ARRAY_SIZE(lvds_sels));
353
354 /*
355 * lvds1_gate and lvds2_gate are pseudo-gates. Both can be
356 * independently configured as clock inputs or outputs. We treat
357 * the "output_enable" bit as a gate, even though it's really just
358 * enabling clock output.
359 */
360 clk[lvds1_gate] = imx_clk_gate("lvds1_gate", "dummy", base + 0x160, 10);
361 clk[lvds2_gate] = imx_clk_gate("lvds2_gate", "dummy", base + 0x160, 11);
362
345 /* name parent_name reg idx */ 363 /* name parent_name reg idx */
346 clk[pll2_pfd0_352m] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus", base + 0x100, 0); 364 clk[pll2_pfd0_352m] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus", base + 0x100, 0);
347 clk[pll2_pfd1_594m] = imx_clk_pfd("pll2_pfd1_594m", "pll2_bus", base + 0x100, 1); 365 clk[pll2_pfd1_594m] = imx_clk_pfd("pll2_pfd1_594m", "pll2_bus", base + 0x100, 1);