This source file includes following definitions.
- lpt_clk_probe
- lpt_clk_init
1
2
3
4
5
6
7
8
9
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>
15
16 static int lpt_clk_probe(struct platform_device *pdev)
17 {
18 struct lpss_clk_data *drvdata;
19 struct clk *clk;
20
21 drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
22 if (!drvdata)
23 return -ENOMEM;
24
25
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);
31
32 drvdata->clk = clk;
33 platform_set_drvdata(pdev, drvdata);
34 return 0;
35 }
36
37 static struct platform_driver lpt_clk_driver = {
38 .driver = {
39 .name = "clk-lpt",
40 },
41 .probe = lpt_clk_probe,
42 };
43
44 int __init lpt_clk_init(void)
45 {
46 return platform_driver_register(&lpt_clk_driver);
47 }