blob: 45e9f93f62359027c43368ec3d4e9471a36fd9c7 [file] [log] [blame]
Stephen Boyd085d7a42014-01-15 10:47:23 -08001/*
Taniya Das4b006ad2016-11-07 10:01:38 +05302 * Copyright (c) 2014, 2016, The Linux Foundation. All rights reserved.
Stephen Boyd085d7a42014-01-15 10:47:23 -08003 *
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
14#ifndef __QCOM_CLK_REGMAP_H__
15#define __QCOM_CLK_REGMAP_H__
16
17#include <linux/clk-provider.h>
Taniya Das4b006ad2016-11-07 10:01:38 +053018#include <linux/debugfs.h>
Stephen Boyd085d7a42014-01-15 10:47:23 -080019
20struct regmap;
21
22/**
23 * struct clk_regmap - regmap supporting clock
24 * @hw: handle between common and hardware-specific interfaces
25 * @regmap: regmap to use for regmap helpers and/or by providers
26 * @enable_reg: register when using regmap enable/disable ops
27 * @enable_mask: mask when using regmap enable/disable ops
28 * @enable_is_inverted: flag to indicate set enable_mask bits to disable
29 * when using clock_enable_regmap and friends APIs.
30 */
31struct clk_regmap {
32 struct clk_hw hw;
33 struct regmap *regmap;
34 unsigned int enable_reg;
35 unsigned int enable_mask;
36 bool enable_is_inverted;
37};
38#define to_clk_regmap(_hw) container_of(_hw, struct clk_regmap, hw)
39
40int clk_is_enabled_regmap(struct clk_hw *hw);
41int clk_enable_regmap(struct clk_hw *hw);
42void clk_disable_regmap(struct clk_hw *hw);
Stephen Boyd120c1552016-08-16 15:38:27 -070043int devm_clk_register_regmap(struct device *dev, struct clk_regmap *rclk);
Stephen Boyd085d7a42014-01-15 10:47:23 -080044
Taniya Das4b006ad2016-11-07 10:01:38 +053045struct clk_register_data {
46 char *name;
47 u32 offset;
48};
49
Stephen Boyd085d7a42014-01-15 10:47:23 -080050#endif