Stephen Boyd | 49fc825 | 2014-03-21 17:59:37 -0700 | [diff] [blame] | 1 | /* |
Taniya Das | 5d12118 | 2016-06-06 15:52:09 +0530 | [diff] [blame] | 2 | * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. |
Stephen Boyd | 49fc825 | 2014-03-21 17:59:37 -0700 | [diff] [blame] | 3 | * |
| 4 | * This software is licensed under the terms of the GNU General Public |
| 5 | * License version 2, as published by the Free Software Foundation, and |
| 6 | * may be copied, distributed, and modified under those terms. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | #ifndef __QCOM_CLK_COMMON_H__ |
| 14 | #define __QCOM_CLK_COMMON_H__ |
| 15 | |
Deepak Katragadda | 88c266f | 2016-11-02 14:46:56 -0700 | [diff] [blame] | 16 | #include <linux/reset-controller.h> |
| 17 | |
Stephen Boyd | 49fc825 | 2014-03-21 17:59:37 -0700 | [diff] [blame] | 18 | struct platform_device; |
| 19 | struct regmap_config; |
| 20 | struct clk_regmap; |
| 21 | struct qcom_reset_map; |
Stephen Boyd | 5b6b749 | 2014-07-15 14:59:21 -0700 | [diff] [blame] | 22 | struct regmap; |
Stephen Boyd | 50c6a50 | 2014-09-04 13:21:50 -0700 | [diff] [blame] | 23 | struct freq_tbl; |
Georgi Djakov | 293d2e97 | 2015-03-20 18:30:26 +0200 | [diff] [blame] | 24 | struct clk_hw; |
| 25 | struct parent_map; |
Stephen Boyd | 49fc825 | 2014-03-21 17:59:37 -0700 | [diff] [blame] | 26 | |
| 27 | struct qcom_cc_desc { |
| 28 | const struct regmap_config *config; |
| 29 | struct clk_regmap **clks; |
| 30 | size_t num_clks; |
| 31 | const struct qcom_reset_map *resets; |
| 32 | size_t num_resets; |
Rajendra Nayak | 5e5cc24 | 2015-08-06 16:07:43 +0530 | [diff] [blame] | 33 | struct gdsc **gdscs; |
| 34 | size_t num_gdscs; |
Stephen Boyd | 49fc825 | 2014-03-21 17:59:37 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
Deepak Katragadda | 88c266f | 2016-11-02 14:46:56 -0700 | [diff] [blame] | 37 | struct clk_dummy { |
| 38 | struct clk_hw hw; |
| 39 | struct reset_controller_dev reset; |
| 40 | unsigned long rrate; |
| 41 | }; |
| 42 | |
Stephen Boyd | 50c6a50 | 2014-09-04 13:21:50 -0700 | [diff] [blame] | 43 | extern const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f, |
| 44 | unsigned long rate); |
Georgi Djakov | 293d2e97 | 2015-03-20 18:30:26 +0200 | [diff] [blame] | 45 | extern int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map, |
| 46 | u8 src); |
Stephen Boyd | 50c6a50 | 2014-09-04 13:21:50 -0700 | [diff] [blame] | 47 | |
Stephen Boyd | ee15faf | 2015-10-26 17:11:32 -0700 | [diff] [blame] | 48 | extern int qcom_cc_register_board_clk(struct device *dev, const char *path, |
| 49 | const char *name, unsigned long rate); |
| 50 | extern int qcom_cc_register_sleep_clk(struct device *dev); |
| 51 | |
Stephen Boyd | 5b6b749 | 2014-07-15 14:59:21 -0700 | [diff] [blame] | 52 | extern struct regmap *qcom_cc_map(struct platform_device *pdev, |
| 53 | const struct qcom_cc_desc *desc); |
| 54 | extern int qcom_cc_really_probe(struct platform_device *pdev, |
| 55 | const struct qcom_cc_desc *desc, |
| 56 | struct regmap *regmap); |
Stephen Boyd | 49fc825 | 2014-03-21 17:59:37 -0700 | [diff] [blame] | 57 | extern int qcom_cc_probe(struct platform_device *pdev, |
| 58 | const struct qcom_cc_desc *desc); |
Taniya Das | 5d12118 | 2016-06-06 15:52:09 +0530 | [diff] [blame] | 59 | extern struct clk_ops clk_dummy_ops; |
Stephen Boyd | 49fc825 | 2014-03-21 17:59:37 -0700 | [diff] [blame] | 60 | #endif |