WIP FPC-III support
[linux/fpc-iii.git] / drivers / clk / x86 / clk-lpt.c
blobfbe9fd3ed9480d8b5efc056cc62e4061b28f5c4a
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Intel Low Power Subsystem clocks.
5 * Copyright (C) 2013, Intel Corporation
6 * Authors: Mika Westerberg <mika.westerberg@linux.intel.com>
7 * Heikki Krogerus <heikki.krogerus@linux.intel.com>
8 */
10 #include <linux/clk-provider.h>
11 #include <linux/err.h>
12 #include <linux/module.h>
13 #include <linux/platform_data/x86/clk-lpss.h>
14 #include <linux/platform_device.h>
16 static int lpt_clk_probe(struct platform_device *pdev)
18 struct lpss_clk_data *drvdata;
19 struct clk *clk;
21 drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
22 if (!drvdata)
23 return -ENOMEM;
25 /* LPSS free running clock */
26 drvdata->name = "lpss_clk";
27 clk = clk_register_fixed_rate(&pdev->dev, drvdata->name, NULL,
28 0, 100000000);
29 if (IS_ERR(clk))
30 return PTR_ERR(clk);
32 drvdata->clk = clk;
33 platform_set_drvdata(pdev, drvdata);
34 return 0;
37 static struct platform_driver lpt_clk_driver = {
38 .driver = {
39 .name = "clk-lpt",
41 .probe = lpt_clk_probe,
44 int __init lpt_clk_init(void)
46 return platform_driver_register(&lpt_clk_driver);