Merge tag 'mxs-fixes-3.10' of git://git.linaro.org/people/shawnguo/linux-2.6 into...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / clk / x86 / clk-lpt.c
1 /*
2 * Intel Lynxpoint LPSS clocks.
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
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>
18 #include <linux/platform_data/clk-lpss.h>
19 #include <linux/platform_device.h>
20
21 #define PRV_CLOCK_PARAMS 0x800
22
23 static int lpt_clk_probe(struct platform_device *pdev)
24 {
25 struct lpss_clk_data *drvdata;
26 struct clk *clk;
27
28 drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
29 if (!drvdata)
30 return -ENOMEM;
31
32 /* LPSS free running clock */
33 drvdata->name = "lpss_clk";
34 clk = clk_register_fixed_rate(&pdev->dev, drvdata->name, NULL,
35 CLK_IS_ROOT, 100000000);
36 if (IS_ERR(clk))
37 return PTR_ERR(clk);
38
39 drvdata->clk = clk;
40 platform_set_drvdata(pdev, drvdata);
41 return 0;
42 }
43
44 static struct platform_driver lpt_clk_driver = {
45 .driver = {
46 .name = "clk-lpt",
47 .owner = THIS_MODULE,
48 },
49 .probe = lpt_clk_probe,
50 };
51
52 int __init lpt_clk_init(void)
53 {
54 return platform_driver_register(&lpt_clk_driver);
55 }