diff options
author | Thomas Abraham <thomas.abraham@linaro.org> | 2011-10-24 06:08:42 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-12-22 20:06:58 -0500 |
commit | 0cfb26e1fb9d7afe9c79a40a257808eafb2aff34 (patch) | |
tree | f79fb4267e4b0814b4cb3bfda69acda6bc3bd579 /arch/arm/mach-s5pv210/clock.c | |
parent | c3310fbbeb9db6967900ed22eb3d0bd0bb0e892c (diff) |
ARM: SAMSUNG: register uart clocks to clock lookup list
Samsung uart driver lookups the clock using the connection id 'clk_uart_baud'.
The uart clocks for all Samsung platforms are reorganized to register them
with the lookup name as required by the uart driver.
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pv210/clock.c')
-rw-r--r-- | arch/arm/mach-s5pv210/clock.c | 107 |
1 files changed, 67 insertions, 40 deletions
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c index 4c5ac7a69e9e..43a045d354ec 100644 --- a/arch/arm/mach-s5pv210/clock.c +++ b/arch/arm/mach-s5pv210/clock.c | |||
@@ -809,46 +809,6 @@ static struct clksrc_clk clksrcs[] = { | |||
809 | .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 }, | 809 | .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 }, |
810 | }, { | 810 | }, { |
811 | .clk = { | 811 | .clk = { |
812 | .name = "uclk1", | ||
813 | .devname = "s5pv210-uart.0", | ||
814 | .enable = s5pv210_clk_mask0_ctrl, | ||
815 | .ctrlbit = (1 << 12), | ||
816 | }, | ||
817 | .sources = &clkset_uart, | ||
818 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 }, | ||
819 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 }, | ||
820 | }, { | ||
821 | .clk = { | ||
822 | .name = "uclk1", | ||
823 | .devname = "s5pv210-uart.1", | ||
824 | .enable = s5pv210_clk_mask0_ctrl, | ||
825 | .ctrlbit = (1 << 13), | ||
826 | }, | ||
827 | .sources = &clkset_uart, | ||
828 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 }, | ||
829 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 }, | ||
830 | }, { | ||
831 | .clk = { | ||
832 | .name = "uclk1", | ||
833 | .devname = "s5pv210-uart.2", | ||
834 | .enable = s5pv210_clk_mask0_ctrl, | ||
835 | .ctrlbit = (1 << 14), | ||
836 | }, | ||
837 | .sources = &clkset_uart, | ||
838 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 }, | ||
839 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 }, | ||
840 | }, { | ||
841 | .clk = { | ||
842 | .name = "uclk1", | ||
843 | .devname = "s5pv210-uart.3", | ||
844 | .enable = s5pv210_clk_mask0_ctrl, | ||
845 | .ctrlbit = (1 << 15), | ||
846 | }, | ||
847 | .sources = &clkset_uart, | ||
848 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 }, | ||
849 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, | ||
850 | }, { | ||
851 | .clk = { | ||
852 | .name = "sclk_fimc", | 812 | .name = "sclk_fimc", |
853 | .devname = "s5pv210-fimc.0", | 813 | .devname = "s5pv210-fimc.0", |
854 | .enable = s5pv210_clk_mask1_ctrl, | 814 | .enable = s5pv210_clk_mask1_ctrl, |
@@ -1022,6 +982,61 @@ static struct clksrc_clk clksrcs[] = { | |||
1022 | }, | 982 | }, |
1023 | }; | 983 | }; |
1024 | 984 | ||
985 | static struct clksrc_clk clk_sclk_uart0 = { | ||
986 | .clk = { | ||
987 | .name = "uclk1", | ||
988 | .devname = "s5pv210-uart.0", | ||
989 | .enable = s5pv210_clk_mask0_ctrl, | ||
990 | .ctrlbit = (1 << 12), | ||
991 | }, | ||
992 | .sources = &clkset_uart, | ||
993 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 }, | ||
994 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 }, | ||
995 | }; | ||
996 | |||
997 | static struct clksrc_clk clk_sclk_uart1 = { | ||
998 | .clk = { | ||
999 | .name = "uclk1", | ||
1000 | .devname = "s5pv210-uart.1", | ||
1001 | .enable = s5pv210_clk_mask0_ctrl, | ||
1002 | .ctrlbit = (1 << 13), | ||
1003 | }, | ||
1004 | .sources = &clkset_uart, | ||
1005 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 }, | ||
1006 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 }, | ||
1007 | }; | ||
1008 | |||
1009 | static struct clksrc_clk clk_sclk_uart2 = { | ||
1010 | .clk = { | ||
1011 | .name = "uclk1", | ||
1012 | .devname = "s5pv210-uart.2", | ||
1013 | .enable = s5pv210_clk_mask0_ctrl, | ||
1014 | .ctrlbit = (1 << 14), | ||
1015 | }, | ||
1016 | .sources = &clkset_uart, | ||
1017 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 }, | ||
1018 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 }, | ||
1019 | }; | ||
1020 | |||
1021 | static struct clksrc_clk clk_sclk_uart3 = { | ||
1022 | .clk = { | ||
1023 | .name = "uclk1", | ||
1024 | .devname = "s5pv210-uart.3", | ||
1025 | .enable = s5pv210_clk_mask0_ctrl, | ||
1026 | .ctrlbit = (1 << 15), | ||
1027 | }, | ||
1028 | .sources = &clkset_uart, | ||
1029 | .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 }, | ||
1030 | .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, | ||
1031 | }; | ||
1032 | |||
1033 | static struct clksrc_clk *clksrc_cdev[] = { | ||
1034 | &clk_sclk_uart0, | ||
1035 | &clk_sclk_uart1, | ||
1036 | &clk_sclk_uart2, | ||
1037 | &clk_sclk_uart3, | ||
1038 | }; | ||
1039 | |||
1025 | /* Clock initialisation code */ | 1040 | /* Clock initialisation code */ |
1026 | static struct clksrc_clk *sysclks[] = { | 1041 | static struct clksrc_clk *sysclks[] = { |
1027 | &clk_mout_apll, | 1042 | &clk_mout_apll, |
@@ -1261,6 +1276,14 @@ static struct clk *clks[] __initdata = { | |||
1261 | &clk_pcmcdclk2, | 1276 | &clk_pcmcdclk2, |
1262 | }; | 1277 | }; |
1263 | 1278 | ||
1279 | static struct clk_lookup s5pv210_clk_lookup[] = { | ||
1280 | CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p), | ||
1281 | CLKDEV_INIT("s5pv210-uart.0", "clk_uart_baud1", &clk_sclk_uart0.clk), | ||
1282 | CLKDEV_INIT("s5pv210-uart.1", "clk_uart_baud1", &clk_sclk_uart1.clk), | ||
1283 | CLKDEV_INIT("s5pv210-uart.2", "clk_uart_baud1", &clk_sclk_uart2.clk), | ||
1284 | CLKDEV_INIT("s5pv210-uart.3", "clk_uart_baud1", &clk_sclk_uart3.clk), | ||
1285 | }; | ||
1286 | |||
1264 | void __init s5pv210_register_clocks(void) | 1287 | void __init s5pv210_register_clocks(void) |
1265 | { | 1288 | { |
1266 | int ptr; | 1289 | int ptr; |
@@ -1273,11 +1296,15 @@ void __init s5pv210_register_clocks(void) | |||
1273 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) | 1296 | for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) |
1274 | s3c_register_clksrc(sclk_tv[ptr], 1); | 1297 | s3c_register_clksrc(sclk_tv[ptr], 1); |
1275 | 1298 | ||
1299 | for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) | ||
1300 | s3c_register_clksrc(clksrc_cdev[ptr], 1); | ||
1301 | |||
1276 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 1302 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
1277 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 1303 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
1278 | 1304 | ||
1279 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1305 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1280 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 1306 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
1307 | clkdev_add_table(s5pv210_clk_lookup, ARRAY_SIZE(s5pv210_clk_lookup)); | ||
1281 | 1308 | ||
1282 | s3c24xx_register_clock(&dummy_apb_pclk); | 1309 | s3c24xx_register_clock(&dummy_apb_pclk); |
1283 | s3c_pwmclk_init(); | 1310 | s3c_pwmclk_init(); |