clk-dfll.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * clk-dfll.h - prototypes and macros for the Tegra DFLL clocksource driver
  3. * Copyright (C) 2013 NVIDIA Corporation. All rights reserved.
  4. *
  5. * Aleksandr Frid <afrid@nvidia.com>
  6. * Paul Walmsley <pwalmsley@nvidia.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. * This program is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. */
  17. #ifndef __DRIVERS_CLK_TEGRA_CLK_DFLL_H
  18. #define __DRIVERS_CLK_TEGRA_CLK_DFLL_H
  19. #include <linux/platform_device.h>
  20. #include <linux/reset.h>
  21. #include <linux/types.h>
  22. /**
  23. * struct tegra_dfll_soc_data - SoC-specific hooks/integration for the DFLL driver
  24. * @opp_dev: struct device * that holds the OPP table for the DFLL
  25. * @min_millivolts: minimum voltage (in mV) that the DFLL can operate
  26. * @tune0_low: DFLL tuning register 0 (low voltage range)
  27. * @tune0_high: DFLL tuning register 0 (high voltage range)
  28. * @tune1: DFLL tuning register 1
  29. * @assert_dvco_reset: fn ptr to place the DVCO in reset
  30. * @deassert_dvco_reset: fn ptr to release the DVCO reset
  31. * @set_clock_trimmers_high: fn ptr to tune clock trimmers for high voltage
  32. * @set_clock_trimmers_low: fn ptr to tune clock trimmers for low voltage
  33. */
  34. struct tegra_dfll_soc_data {
  35. struct device *dev;
  36. unsigned int min_millivolts;
  37. u32 tune0_low;
  38. u32 tune0_high;
  39. u32 tune1;
  40. void (*init_clock_trimmers)(void);
  41. void (*set_clock_trimmers_high)(void);
  42. void (*set_clock_trimmers_low)(void);
  43. };
  44. int tegra_dfll_register(struct platform_device *pdev,
  45. struct tegra_dfll_soc_data *soc);
  46. int tegra_dfll_unregister(struct platform_device *pdev);
  47. int tegra_dfll_runtime_suspend(struct device *dev);
  48. int tegra_dfll_runtime_resume(struct device *dev);
  49. #endif /* __DRIVERS_CLK_TEGRA_CLK_DFLL_H */