diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2012-11-22 05:35:39 -0500 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2012-11-26 11:14:12 -0500 |
commit | 45228ef32240957b1536fbba1ca12377cb2e587c (patch) | |
tree | 3543f8c8a13ac70c81b2ea84820ba6bf8b33c5be /drivers/clk | |
parent | b70e6d009a88e09805152597e02f3d97a1d6ee99 (diff) |
clk: ux500: Initial support for abx500 clock driver
The abx500 clock driver is a platform driver which will be initialized
during arch init. The platform device shall be added from the ab-core
driver as a mfd child device to maintain correct boot sequence.
Depending on what ab version we use, different clock definitions will
be added.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/ux500/Makefile | 3 | ||||
-rw-r--r-- | drivers/clk/ux500/abx500-clk.c | 73 |
2 files changed, 76 insertions, 0 deletions
diff --git a/drivers/clk/ux500/Makefile b/drivers/clk/ux500/Makefile index 858fbfe66281..bcc0c11a507c 100644 --- a/drivers/clk/ux500/Makefile +++ b/drivers/clk/ux500/Makefile | |||
@@ -10,3 +10,6 @@ obj-y += clk-prcmu.o | |||
10 | obj-y += u8500_clk.o | 10 | obj-y += u8500_clk.o |
11 | obj-y += u9540_clk.o | 11 | obj-y += u9540_clk.o |
12 | obj-y += u8540_clk.o | 12 | obj-y += u8540_clk.o |
13 | |||
14 | # ABX500 clock driver | ||
15 | obj-y += abx500-clk.o | ||
diff --git a/drivers/clk/ux500/abx500-clk.c b/drivers/clk/ux500/abx500-clk.c new file mode 100644 index 000000000000..e27c52317ffe --- /dev/null +++ b/drivers/clk/ux500/abx500-clk.c | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * abx500 clock implementation for ux500 platform. | ||
3 | * | ||
4 | * Copyright (C) 2012 ST-Ericsson SA | ||
5 | * Author: Ulf Hansson <ulf.hansson@linaro.org> | ||
6 | * | ||
7 | * License terms: GNU General Public License (GPL) version 2 | ||
8 | */ | ||
9 | |||
10 | #include <linux/err.h> | ||
11 | #include <linux/module.h> | ||
12 | #include <linux/device.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/mfd/abx500/ab8500.h> | ||
15 | |||
16 | /* TODO: Add clock implementations here */ | ||
17 | |||
18 | |||
19 | /* Clock definitions for ab8500 */ | ||
20 | static int ab8500_reg_clks(struct device *dev) | ||
21 | { | ||
22 | return 0; | ||
23 | } | ||
24 | |||
25 | /* Clock definitions for ab8540 */ | ||
26 | static int ab8540_reg_clks(struct device *dev) | ||
27 | { | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | /* Clock definitions for ab9540 */ | ||
32 | static int ab9540_reg_clks(struct device *dev) | ||
33 | { | ||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | static int __devinit abx500_clk_probe(struct platform_device *pdev) | ||
38 | { | ||
39 | struct ab8500 *parent = dev_get_drvdata(pdev->dev.parent); | ||
40 | int ret; | ||
41 | |||
42 | if (is_ab8500(parent) || is_ab8505(parent)) { | ||
43 | ret = ab8500_reg_clks(&pdev->dev); | ||
44 | } else if (is_ab8540(parent)) { | ||
45 | ret = ab8540_reg_clks(&pdev->dev); | ||
46 | } else if (is_ab9540(parent)) { | ||
47 | ret = ab9540_reg_clks(&pdev->dev); | ||
48 | } else { | ||
49 | dev_err(&pdev->dev, "non supported plf id\n"); | ||
50 | return -ENODEV; | ||
51 | } | ||
52 | |||
53 | return ret; | ||
54 | } | ||
55 | |||
56 | static struct platform_driver abx500_clk_driver = { | ||
57 | .driver = { | ||
58 | .name = "abx500-clk", | ||
59 | .owner = THIS_MODULE, | ||
60 | }, | ||
61 | .probe = abx500_clk_probe, | ||
62 | }; | ||
63 | |||
64 | static int __init abx500_clk_init(void) | ||
65 | { | ||
66 | return platform_driver_register(&abx500_clk_driver); | ||
67 | } | ||
68 | |||
69 | arch_initcall(abx500_clk_init); | ||
70 | |||
71 | MODULE_AUTHOR("Ulf Hansson <ulf.hansson@linaro.org"); | ||
72 | MODULE_DESCRIPTION("ABX500 clk driver"); | ||
73 | MODULE_LICENSE("GPL v2"); | ||