clk-lpt.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Intel Low Power Subsystem 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. #include <linux/clk-provider.h>
  13. #include <linux/err.h>
  14. #include <linux/module.h>
  15. #include <linux/platform_data/clk-lpss.h>
  16. #include <linux/platform_device.h>
  17. static int lpt_clk_probe(struct platform_device *pdev)
  18. {
  19. struct lpss_clk_data *drvdata;
  20. struct clk *clk;
  21. drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
  22. if (!drvdata)
  23. return -ENOMEM;
  24. /* LPSS free running clock */
  25. drvdata->name = "lpss_clk";
  26. clk = clk_register_fixed_rate(&pdev->dev, drvdata->name, NULL,
  27. 0, 100000000);
  28. if (IS_ERR(clk))
  29. return PTR_ERR(clk);
  30. drvdata->clk = clk;
  31. platform_set_drvdata(pdev, drvdata);
  32. return 0;
  33. }
  34. static struct platform_driver lpt_clk_driver = {
  35. .driver = {
  36. .name = "clk-lpt",
  37. },
  38. .probe = lpt_clk_probe,
  39. };
  40. int __init lpt_clk_init(void)
  41. {
  42. return platform_driver_register(&lpt_clk_driver);
  43. }