xref: /openbmc/linux/drivers/clk/tegra/clk-dfll.h (revision d8d7a08f)
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
27d8d7a08fSTuomas Tynkkynen  * @opp_dev: struct device * that holds the OPP table for the DFLL
28d8d7a08fSTuomas Tynkkynen  * @min_millivolts: minimum voltage (in mV) that the DFLL can operate
29d8d7a08fSTuomas Tynkkynen  * @tune0_low: DFLL tuning register 0 (low voltage range)
30d8d7a08fSTuomas Tynkkynen  * @tune0_high: DFLL tuning register 0 (high voltage range)
31d8d7a08fSTuomas Tynkkynen  * @tune1: DFLL tuning register 1
32d8d7a08fSTuomas Tynkkynen  * @assert_dvco_reset: fn ptr to place the DVCO in reset
33d8d7a08fSTuomas Tynkkynen  * @deassert_dvco_reset: fn ptr to release the DVCO reset
34d8d7a08fSTuomas Tynkkynen  * @set_clock_trimmers_high: fn ptr to tune clock trimmers for high voltage
35d8d7a08fSTuomas Tynkkynen  * @set_clock_trimmers_low: fn ptr to tune clock trimmers for low voltage
36d8d7a08fSTuomas Tynkkynen  */
37d8d7a08fSTuomas Tynkkynen struct tegra_dfll_soc_data {
38d8d7a08fSTuomas Tynkkynen 	struct device *opp_dev;
39d8d7a08fSTuomas Tynkkynen 	unsigned int min_millivolts;
40d8d7a08fSTuomas Tynkkynen 	u32 tune0_low;
41d8d7a08fSTuomas Tynkkynen 	u32 tune0_high;
42d8d7a08fSTuomas Tynkkynen 	u32 tune1;
43d8d7a08fSTuomas Tynkkynen 	void (*init_clock_trimmers)(void);
44d8d7a08fSTuomas Tynkkynen 	void (*set_clock_trimmers_high)(void);
45d8d7a08fSTuomas Tynkkynen 	void (*set_clock_trimmers_low)(void);
46d8d7a08fSTuomas Tynkkynen };
47d8d7a08fSTuomas Tynkkynen 
48d8d7a08fSTuomas Tynkkynen int tegra_dfll_register(struct platform_device *pdev,
49d8d7a08fSTuomas Tynkkynen 			struct tegra_dfll_soc_data *soc);
50d8d7a08fSTuomas Tynkkynen int tegra_dfll_unregister(struct platform_device *pdev);
51d8d7a08fSTuomas Tynkkynen int tegra_dfll_runtime_suspend(struct device *dev);
52d8d7a08fSTuomas Tynkkynen int tegra_dfll_runtime_resume(struct device *dev);
53d8d7a08fSTuomas Tynkkynen 
54d8d7a08fSTuomas Tynkkynen #endif /* __DRIVERS_CLK_TEGRA_CLK_DFLL_H */
55