blob: 9f7400d74fa77d9a8ef1a7c3b6933544f5a22985 [file] [log] [blame]
Ulf Hansson45228ef2012-11-22 11:35:39 +01001/*
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 */
20static int ab8500_reg_clks(struct device *dev)
21{
22 return 0;
23}
24
25/* Clock definitions for ab8540 */
26static int ab8540_reg_clks(struct device *dev)
27{
28 return 0;
29}
30
31/* Clock definitions for ab9540 */
32static int ab9540_reg_clks(struct device *dev)
33{
34 return 0;
35}
36
Greg Kroah-Hartman0fe763c2012-12-21 15:14:44 -080037static int abx500_clk_probe(struct platform_device *pdev)
Ulf Hansson45228ef2012-11-22 11:35:39 +010038{
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
56static struct platform_driver abx500_clk_driver = {
57 .driver = {
58 .name = "abx500-clk",
59 .owner = THIS_MODULE,
60 },
61 .probe = abx500_clk_probe,
62};
63
64static int __init abx500_clk_init(void)
65{
66 return platform_driver_register(&abx500_clk_driver);
67}
68
69arch_initcall(abx500_clk_init);
70
71MODULE_AUTHOR("Ulf Hansson <ulf.hansson@linaro.org");
72MODULE_DESCRIPTION("ABX500 clk driver");
73MODULE_LICENSE("GPL v2");