clk-lpt.c 1.3 KB

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