Commit | Line | Data |
---|---|---|
701190fd | 1 | /* |
f6272170 | 2 | * Intel Low Power Subsystem clocks. |
701190fd MW |
3 | * |
4 | * Copyright (C) 2013, Intel Corporation | |
5 | * Authors: Mika Westerberg <mika.westerberg@linux.intel.com> | |
6 | * Heikki Krogerus <heikki.krogerus@linux.intel.com> | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License version 2 as | |
10 | * published by the Free Software Foundation. | |
11 | */ | |
12 | ||
701190fd MW |
13 | #include <linux/clk.h> |
14 | #include <linux/clkdev.h> | |
15 | #include <linux/clk-provider.h> | |
16 | #include <linux/err.h> | |
17 | #include <linux/module.h> | |
b59cc200 | 18 | #include <linux/platform_data/clk-lpss.h> |
701190fd MW |
19 | #include <linux/platform_device.h> |
20 | ||
701190fd MW |
21 | static int lpt_clk_probe(struct platform_device *pdev) |
22 | { | |
b59cc200 | 23 | struct lpss_clk_data *drvdata; |
701190fd MW |
24 | struct clk *clk; |
25 | ||
b59cc200 RW |
26 | drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); |
27 | if (!drvdata) | |
28 | return -ENOMEM; | |
29 | ||
701190fd | 30 | /* LPSS free running clock */ |
b59cc200 RW |
31 | drvdata->name = "lpss_clk"; |
32 | clk = clk_register_fixed_rate(&pdev->dev, drvdata->name, NULL, | |
33 | CLK_IS_ROOT, 100000000); | |
701190fd MW |
34 | if (IS_ERR(clk)) |
35 | return PTR_ERR(clk); | |
36 | ||
b59cc200 RW |
37 | drvdata->clk = clk; |
38 | platform_set_drvdata(pdev, drvdata); | |
701190fd MW |
39 | return 0; |
40 | } | |
41 | ||
42 | static struct platform_driver lpt_clk_driver = { | |
43 | .driver = { | |
44 | .name = "clk-lpt", | |
701190fd MW |
45 | }, |
46 | .probe = lpt_clk_probe, | |
47 | }; | |
48 | ||
f58b082a | 49 | int __init lpt_clk_init(void) |
701190fd MW |
50 | { |
51 | return platform_driver_register(&lpt_clk_driver); | |
52 | } |