2013-01-18 21:46:00 +08:00
|
|
|
/*
|
2013-05-13 20:42:44 +08:00
|
|
|
* Intel Low Power Subsystem clocks.
|
2013-01-18 21:46:00 +08:00
|
|
|
*
|
|
|
|
* Copyright (C) 2013, Intel Corporation
|
|
|
|
* Authors: Mika Westerberg <mika.westerberg@linux.intel.com>
|
|
|
|
* Heikki Krogerus <heikki.krogerus@linux.intel.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/clk-provider.h>
|
|
|
|
#include <linux/err.h>
|
|
|
|
#include <linux/module.h>
|
2019-02-19 03:34:15 +08:00
|
|
|
#include <linux/platform_data/x86/clk-lpss.h>
|
2013-01-18 21:46:00 +08:00
|
|
|
#include <linux/platform_device.h>
|
|
|
|
|
|
|
|
static int lpt_clk_probe(struct platform_device *pdev)
|
|
|
|
{
|
2013-05-08 16:55:49 +08:00
|
|
|
struct lpss_clk_data *drvdata;
|
2013-01-18 21:46:00 +08:00
|
|
|
struct clk *clk;
|
|
|
|
|
2013-05-08 16:55:49 +08:00
|
|
|
drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
|
|
|
|
if (!drvdata)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2013-01-18 21:46:00 +08:00
|
|
|
/* LPSS free running clock */
|
2013-05-08 16:55:49 +08:00
|
|
|
drvdata->name = "lpss_clk";
|
|
|
|
clk = clk_register_fixed_rate(&pdev->dev, drvdata->name, NULL,
|
2016-03-02 03:00:06 +08:00
|
|
|
0, 100000000);
|
2013-01-18 21:46:00 +08:00
|
|
|
if (IS_ERR(clk))
|
|
|
|
return PTR_ERR(clk);
|
|
|
|
|
2013-05-08 16:55:49 +08:00
|
|
|
drvdata->clk = clk;
|
|
|
|
platform_set_drvdata(pdev, drvdata);
|
2013-01-18 21:46:00 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct platform_driver lpt_clk_driver = {
|
|
|
|
.driver = {
|
|
|
|
.name = "clk-lpt",
|
|
|
|
},
|
|
|
|
.probe = lpt_clk_probe,
|
|
|
|
};
|
|
|
|
|
2013-03-07 06:46:20 +08:00
|
|
|
int __init lpt_clk_init(void)
|
2013-01-18 21:46:00 +08:00
|
|
|
{
|
|
|
|
return platform_driver_register(&lpt_clk_driver);
|
|
|
|
}
|