diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-10-31 12:14:36 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-12-15 18:36:29 -0500 |
commit | 3627379fc6b3e2b531b371af97d8ce0040fc3646 (patch) | |
tree | 7c48c02e4973fa6c1e521c62343fa397ff6c2824 /arch/arm/plat-s3c64xx | |
parent | 1451325ced5f9b1a3e5da07521deb049e32cb15a (diff) |
[ARM] S3C6XX: Add enable for clk_48
Add apropriate enable call for clk_48m.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c64xx')
-rw-r--r-- | arch/arm/plat-s3c64xx/clock.c | 22 | ||||
-rw-r--r-- | arch/arm/plat-s3c64xx/include/plat/regs-sys.h | 24 |
2 files changed, 46 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c64xx/clock.c b/arch/arm/plat-s3c64xx/clock.c index 2d2e83a036c4..523da0cb55c5 100644 --- a/arch/arm/plat-s3c64xx/clock.c +++ b/arch/arm/plat-s3c64xx/clock.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
23 | #include <mach/map.h> | 23 | #include <mach/map.h> |
24 | 24 | ||
25 | #include <plat/regs-sys.h> | ||
25 | #include <plat/regs-clock.h> | 26 | #include <plat/regs-clock.h> |
26 | #include <plat/cpu.h> | 27 | #include <plat/cpu.h> |
27 | #include <plat/devs.h> | 28 | #include <plat/devs.h> |
@@ -33,10 +34,31 @@ struct clk clk_27m = { | |||
33 | .rate = 27000000, | 34 | .rate = 27000000, |
34 | }; | 35 | }; |
35 | 36 | ||
37 | static int clk_48m_ctrl(struct clk *clk, int enable) | ||
38 | { | ||
39 | unsigned long flags; | ||
40 | u32 val; | ||
41 | |||
42 | /* can't rely on clock lock, this register has other usages */ | ||
43 | local_irq_save(flags); | ||
44 | |||
45 | val = __raw_readl(S3C64XX_OTHERS); | ||
46 | if (enable) | ||
47 | val |= S3C64XX_OTHERS_USBMASK; | ||
48 | else | ||
49 | val &= ~S3C64XX_OTHERS_USBMASK; | ||
50 | |||
51 | __raw_writel(val, S3C64XX_OTHERS); | ||
52 | local_irq_restore(flags); | ||
53 | |||
54 | return 0; | ||
55 | } | ||
56 | |||
36 | struct clk clk_48m = { | 57 | struct clk clk_48m = { |
37 | .name = "clk_48m", | 58 | .name = "clk_48m", |
38 | .id = -1, | 59 | .id = -1, |
39 | .rate = 48000000, | 60 | .rate = 48000000, |
61 | .enable = clk_48m_ctrl, | ||
40 | }; | 62 | }; |
41 | 63 | ||
42 | static int inline s3c64xx_gate(void __iomem *reg, | 64 | static int inline s3c64xx_gate(void __iomem *reg, |
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-sys.h b/arch/arm/plat-s3c64xx/include/plat/regs-sys.h new file mode 100644 index 000000000000..d8ed82917096 --- /dev/null +++ b/arch/arm/plat-s3c64xx/include/plat/regs-sys.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* arch/arm/plat-s3c64xx/include/plat/regs-sys.h | ||
2 | * | ||
3 | * Copyright 2008 Openmoko, Inc. | ||
4 | * Copyright 2008 Simtec Electronics | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * http://armlinux.simtec.co.uk/ | ||
7 | * | ||
8 | * S3C64XX system register definitions | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #ifndef __PLAT_REGS_SYS_H | ||
16 | #define __PLAT_REGS_SYS_H __FILE__ | ||
17 | |||
18 | #define S3C_SYSREG(x) (S3C_VA_SYS + (x)) | ||
19 | |||
20 | #define S3C64XX_OTHERS S3C_SYSREG(0x900) | ||
21 | |||
22 | #define S3C64XX_OTHERS_USBMASK (1 << 16) | ||
23 | |||
24 | #endif /* _PLAT_REGS_SYS_H */ | ||