11802d0beSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2d8d7a08fSTuomas Tynkkynen /* 3d8d7a08fSTuomas Tynkkynen * clk-dfll.h - prototypes and macros for the Tegra DFLL clocksource driver 4b3cf8d06SJoseph Lo * Copyright (C) 2013-2019 NVIDIA Corporation. All rights reserved. 5d8d7a08fSTuomas Tynkkynen * 6d8d7a08fSTuomas Tynkkynen * Aleksandr Frid <afrid@nvidia.com> 7d8d7a08fSTuomas Tynkkynen * Paul Walmsley <pwalmsley@nvidia.com> 8d8d7a08fSTuomas Tynkkynen */ 9d8d7a08fSTuomas Tynkkynen 10d8d7a08fSTuomas Tynkkynen #ifndef __DRIVERS_CLK_TEGRA_CLK_DFLL_H 11d8d7a08fSTuomas Tynkkynen #define __DRIVERS_CLK_TEGRA_CLK_DFLL_H 12d8d7a08fSTuomas Tynkkynen 13d8d7a08fSTuomas Tynkkynen #include <linux/platform_device.h> 14d8d7a08fSTuomas Tynkkynen #include <linux/reset.h> 15d8d7a08fSTuomas Tynkkynen #include <linux/types.h> 16d8d7a08fSTuomas Tynkkynen 17b3cf8d06SJoseph Lo #include "cvb.h" 18b3cf8d06SJoseph Lo 19d8d7a08fSTuomas Tynkkynen /** 20d8d7a08fSTuomas Tynkkynen * struct tegra_dfll_soc_data - SoC-specific hooks/integration for the DFLL driver 218eaaae99SThierry Reding * @dev: struct device * that holds the OPP table for the DFLL 22f7c42d98SThierry Reding * @max_freq: maximum frequency supported on this SoC 2327ed2f7eSThierry Reding * @cvb: CPU frequency table for this SoC 24b3cf8d06SJoseph Lo * @alignment: parameters of the regulator step and offset 258eaaae99SThierry Reding * @init_clock_trimmers: callback to initialize clock trimmers 268eaaae99SThierry Reding * @set_clock_trimmers_high: callback to tune clock trimmers for high voltage 278eaaae99SThierry Reding * @set_clock_trimmers_low: callback to tune clock trimmers for low voltage 28d8d7a08fSTuomas Tynkkynen */ 29d8d7a08fSTuomas Tynkkynen struct tegra_dfll_soc_data { 3062a8a094STuomas Tynkkynen struct device *dev; 31f7c42d98SThierry Reding unsigned long max_freq; 3227ed2f7eSThierry Reding const struct cvb_table *cvb; 33b3cf8d06SJoseph Lo struct rail_alignment alignment; 348eaaae99SThierry Reding 35d8d7a08fSTuomas Tynkkynen void (*init_clock_trimmers)(void); 36d8d7a08fSTuomas Tynkkynen void (*set_clock_trimmers_high)(void); 37d8d7a08fSTuomas Tynkkynen void (*set_clock_trimmers_low)(void); 38d8d7a08fSTuomas Tynkkynen }; 39d8d7a08fSTuomas Tynkkynen 40d8d7a08fSTuomas Tynkkynen int tegra_dfll_register(struct platform_device *pdev, 41d8d7a08fSTuomas Tynkkynen struct tegra_dfll_soc_data *soc); 421752c9eeSNicolin Chen struct tegra_dfll_soc_data *tegra_dfll_unregister(struct platform_device *pdev); 43d8d7a08fSTuomas Tynkkynen int tegra_dfll_runtime_suspend(struct device *dev); 44d8d7a08fSTuomas Tynkkynen int tegra_dfll_runtime_resume(struct device *dev); 45*a99d744dSSowjanya Komatineni int tegra_dfll_suspend(struct device *dev); 46*a99d744dSSowjanya Komatineni int tegra_dfll_resume(struct device *dev); 47d8d7a08fSTuomas Tynkkynen 48d8d7a08fSTuomas Tynkkynen #endif /* __DRIVERS_CLK_TEGRA_CLK_DFLL_H */ 49