Linux 4.16.11
[linux/fpc-iii.git] / drivers / clk / qcom / clk-regmap.h
blob90d95cd11ec6329048127d402a49911c31aa0c9b
1 /*
2 * Copyright (c) 2014, The Linux Foundation. All rights reserved.
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.
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.
14 #ifndef __QCOM_CLK_REGMAP_H__
15 #define __QCOM_CLK_REGMAP_H__
17 #include <linux/clk-provider.h>
19 struct regmap;
21 /**
22 * struct clk_regmap - regmap supporting clock
23 * @hw: handle between common and hardware-specific interfaces
24 * @regmap: regmap to use for regmap helpers and/or by providers
25 * @enable_reg: register when using regmap enable/disable ops
26 * @enable_mask: mask when using regmap enable/disable ops
27 * @enable_is_inverted: flag to indicate set enable_mask bits to disable
28 * when using clock_enable_regmap and friends APIs.
30 struct clk_regmap {
31 struct clk_hw hw;
32 struct regmap *regmap;
33 unsigned int enable_reg;
34 unsigned int enable_mask;
35 bool enable_is_inverted;
37 #define to_clk_regmap(_hw) container_of(_hw, struct clk_regmap, hw)
39 int clk_is_enabled_regmap(struct clk_hw *hw);
40 int clk_enable_regmap(struct clk_hw *hw);
41 void clk_disable_regmap(struct clk_hw *hw);
42 int devm_clk_register_regmap(struct device *dev, struct clk_regmap *rclk);
44 #endif