xref: /openbmc/linux/drivers/clk/tegra/clk-dfll.h (revision 1752c9ee)
1d8d7a08fSTuomas Tynkkynen /*
2d8d7a08fSTuomas Tynkkynen  * clk-dfll.h - prototypes and macros for the Tegra DFLL clocksource driver
3d8d7a08fSTuomas Tynkkynen  * Copyright (C) 2013 NVIDIA Corporation.  All rights reserved.
4d8d7a08fSTuomas Tynkkynen  *
5d8d7a08fSTuomas Tynkkynen  * Aleksandr Frid <afrid@nvidia.com>
6d8d7a08fSTuomas Tynkkynen  * Paul Walmsley <pwalmsley@nvidia.com>
7d8d7a08fSTuomas Tynkkynen  *
8d8d7a08fSTuomas Tynkkynen  * This program is free software; you can redistribute it and/or modify
9d8d7a08fSTuomas Tynkkynen  * it under the terms of the GNU General Public License version 2 as
10d8d7a08fSTuomas Tynkkynen  * published by the Free Software Foundation.
11d8d7a08fSTuomas Tynkkynen  *
12d8d7a08fSTuomas Tynkkynen  * This program is distributed in the hope that it will be useful, but WITHOUT
13d8d7a08fSTuomas Tynkkynen  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14d8d7a08fSTuomas Tynkkynen  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15d8d7a08fSTuomas Tynkkynen  * more details.
16d8d7a08fSTuomas Tynkkynen  */
17d8d7a08fSTuomas Tynkkynen 
18d8d7a08fSTuomas Tynkkynen #ifndef __DRIVERS_CLK_TEGRA_CLK_DFLL_H
19d8d7a08fSTuomas Tynkkynen #define __DRIVERS_CLK_TEGRA_CLK_DFLL_H
20d8d7a08fSTuomas Tynkkynen 
21d8d7a08fSTuomas Tynkkynen #include <linux/platform_device.h>
22d8d7a08fSTuomas Tynkkynen #include <linux/reset.h>
23d8d7a08fSTuomas Tynkkynen #include <linux/types.h>
24d8d7a08fSTuomas Tynkkynen 
25d8d7a08fSTuomas Tynkkynen /**
26d8d7a08fSTuomas Tynkkynen  * struct tegra_dfll_soc_data - SoC-specific hooks/integration for the DFLL driver
278eaaae99SThierry Reding  * @dev: struct device * that holds the OPP table for the DFLL
28f7c42d98SThierry Reding  * @max_freq: maximum frequency supported on this SoC
2927ed2f7eSThierry Reding  * @cvb: CPU frequency table for this SoC
308eaaae99SThierry Reding  * @init_clock_trimmers: callback to initialize clock trimmers
318eaaae99SThierry Reding  * @set_clock_trimmers_high: callback to tune clock trimmers for high voltage
328eaaae99SThierry Reding  * @set_clock_trimmers_low: callback to tune clock trimmers for low voltage
33d8d7a08fSTuomas Tynkkynen  */
34d8d7a08fSTuomas Tynkkynen struct tegra_dfll_soc_data {
3562a8a094STuomas Tynkkynen 	struct device *dev;
36f7c42d98SThierry Reding 	unsigned long max_freq;
3727ed2f7eSThierry Reding 	const struct cvb_table *cvb;
388eaaae99SThierry Reding 
39d8d7a08fSTuomas Tynkkynen 	void (*init_clock_trimmers)(void);
40d8d7a08fSTuomas Tynkkynen 	void (*set_clock_trimmers_high)(void);
41d8d7a08fSTuomas Tynkkynen 	void (*set_clock_trimmers_low)(void);
42d8d7a08fSTuomas Tynkkynen };
43d8d7a08fSTuomas Tynkkynen 
44d8d7a08fSTuomas Tynkkynen int tegra_dfll_register(struct platform_device *pdev,
45d8d7a08fSTuomas Tynkkynen 			struct tegra_dfll_soc_data *soc);
461752c9eeSNicolin Chen struct tegra_dfll_soc_data *tegra_dfll_unregister(struct platform_device *pdev);
47d8d7a08fSTuomas Tynkkynen int tegra_dfll_runtime_suspend(struct device *dev);
48d8d7a08fSTuomas Tynkkynen int tegra_dfll_runtime_resume(struct device *dev);
49d8d7a08fSTuomas Tynkkynen 
50d8d7a08fSTuomas Tynkkynen #endif /* __DRIVERS_CLK_TEGRA_CLK_DFLL_H */
51