blob: eface1885011b35ea6fc41a2015704989d9631d0 [file] [log] [blame]
Stephen Boyd49fc8252014-03-21 17:59:37 -07001/*
Taniya Das5d121182016-06-06 15:52:09 +05302 * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
Stephen Boyd49fc8252014-03-21 17:59:37 -07003 *
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 Katragadda88c266f2016-11-02 14:46:56 -070016#include <linux/reset-controller.h>
17
Stephen Boyd49fc8252014-03-21 17:59:37 -070018struct platform_device;
19struct regmap_config;
20struct clk_regmap;
21struct qcom_reset_map;
Stephen Boyd5b6b7492014-07-15 14:59:21 -070022struct regmap;
Stephen Boyd50c6a502014-09-04 13:21:50 -070023struct freq_tbl;
Georgi Djakov293d2e972015-03-20 18:30:26 +020024struct clk_hw;
25struct parent_map;
Stephen Boyd49fc8252014-03-21 17:59:37 -070026
27struct 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 Nayak5e5cc242015-08-06 16:07:43 +053033 struct gdsc **gdscs;
34 size_t num_gdscs;
Stephen Boyd49fc8252014-03-21 17:59:37 -070035};
36
Deepak Katragadda88c266f2016-11-02 14:46:56 -070037struct clk_dummy {
38 struct clk_hw hw;
39 struct reset_controller_dev reset;
40 unsigned long rrate;
41};
42
Stephen Boyd50c6a502014-09-04 13:21:50 -070043extern const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f,
44 unsigned long rate);
Georgi Djakov293d2e972015-03-20 18:30:26 +020045extern int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map,
46 u8 src);
Stephen Boyd50c6a502014-09-04 13:21:50 -070047
Stephen Boydee15faf2015-10-26 17:11:32 -070048extern int qcom_cc_register_board_clk(struct device *dev, const char *path,
49 const char *name, unsigned long rate);
50extern int qcom_cc_register_sleep_clk(struct device *dev);
51
Stephen Boyd5b6b7492014-07-15 14:59:21 -070052extern struct regmap *qcom_cc_map(struct platform_device *pdev,
53 const struct qcom_cc_desc *desc);
54extern int qcom_cc_really_probe(struct platform_device *pdev,
55 const struct qcom_cc_desc *desc,
56 struct regmap *regmap);
Stephen Boyd49fc8252014-03-21 17:59:37 -070057extern int qcom_cc_probe(struct platform_device *pdev,
58 const struct qcom_cc_desc *desc);
Taniya Das5d121182016-06-06 15:52:09 +053059extern struct clk_ops clk_dummy_ops;
Stephen Boyd49fc8252014-03-21 17:59:37 -070060#endif