diff options
author | Juergen Beisert <jbe@pengutronix.de> | 2009-10-02 05:24:49 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-11-14 04:30:18 -0500 |
commit | 9e0afdf8f32f34f7e67db4d4622cb13e39a0e5db (patch) | |
tree | 73a1d4dec14f69c0c35780d94bf53776155c07ef /arch/arm/mach-mx3 | |
parent | 060d20d32ae7c6a20a8eac465795ed5bc9b37f7c (diff) |
MXC NFC: Add the clock resource to support NFC in i.MX35
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r-- | arch/arm/mach-mx3/clock-imx35.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c index c595260ec1f9..33a23e7c7e92 100644 --- a/arch/arm/mach-mx3/clock-imx35.c +++ b/arch/arm/mach-mx3/clock-imx35.c | |||
@@ -387,6 +387,35 @@ DEFINE_CLOCK(csi_clk, 0, CCM_CGR3, 0, get_rate_csi, NULL); | |||
387 | DEFINE_CLOCK(iim_clk, 0, CCM_CGR3, 2, NULL, NULL); | 387 | DEFINE_CLOCK(iim_clk, 0, CCM_CGR3, 2, NULL, NULL); |
388 | DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL); | 388 | DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL); |
389 | 389 | ||
390 | static int clk_dummy_enable(struct clk *clk) | ||
391 | { | ||
392 | return 0; | ||
393 | } | ||
394 | |||
395 | static void clk_dummy_disable(struct clk *clk) | ||
396 | { | ||
397 | } | ||
398 | |||
399 | static unsigned long get_rate_nfc(struct clk *clk) | ||
400 | { | ||
401 | unsigned long div1; | ||
402 | |||
403 | div1 = (__raw_readl(CCM_BASE + CCM_PDR4) >> 28) + 1; | ||
404 | |||
405 | return get_rate_ahb(NULL) / div1; | ||
406 | } | ||
407 | |||
408 | /* NAND Controller: It seems it can't be disabled */ | ||
409 | static struct clk nfc_clk = { | ||
410 | .id = 0, | ||
411 | .enable_reg = 0, | ||
412 | .enable_shift = 0, | ||
413 | .get_rate = get_rate_nfc, | ||
414 | .set_rate = NULL, /* set_rate_nfc, */ | ||
415 | .enable = clk_dummy_enable, | ||
416 | .disable = clk_dummy_disable | ||
417 | }; | ||
418 | |||
390 | #define _REGISTER_CLOCK(d, n, c) \ | 419 | #define _REGISTER_CLOCK(d, n, c) \ |
391 | { \ | 420 | { \ |
392 | .dev_id = d, \ | 421 | .dev_id = d, \ |
@@ -449,6 +478,7 @@ static struct clk_lookup lookups[] = { | |||
449 | _REGISTER_CLOCK(NULL, "csi", csi_clk) | 478 | _REGISTER_CLOCK(NULL, "csi", csi_clk) |
450 | _REGISTER_CLOCK(NULL, "iim", iim_clk) | 479 | _REGISTER_CLOCK(NULL, "iim", iim_clk) |
451 | _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk) | 480 | _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk) |
481 | _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) | ||
452 | }; | 482 | }; |
453 | 483 | ||
454 | int __init mx35_clocks_init() | 484 | int __init mx35_clocks_init() |