Taniya Das | f941978 | 2018-07-16 11:24:32 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* Copyright (c) 2014, The Linux Foundation. All rights reserved. */ |
Stephen Boyd | 085d7a4 | 2014-01-15 10:47:23 -0800 | [diff] [blame] | 3 | |
| 4 | #ifndef __QCOM_CLK_REGMAP_H__ |
| 5 | #define __QCOM_CLK_REGMAP_H__ |
| 6 | |
| 7 | #include <linux/clk-provider.h> |
| 8 | |
| 9 | struct regmap; |
| 10 | |
| 11 | /** |
| 12 | * struct clk_regmap - regmap supporting clock |
| 13 | * @hw: handle between common and hardware-specific interfaces |
| 14 | * @regmap: regmap to use for regmap helpers and/or by providers |
| 15 | * @enable_reg: register when using regmap enable/disable ops |
| 16 | * @enable_mask: mask when using regmap enable/disable ops |
| 17 | * @enable_is_inverted: flag to indicate set enable_mask bits to disable |
| 18 | * when using clock_enable_regmap and friends APIs. |
| 19 | */ |
| 20 | struct clk_regmap { |
| 21 | struct clk_hw hw; |
| 22 | struct regmap *regmap; |
| 23 | unsigned int enable_reg; |
| 24 | unsigned int enable_mask; |
| 25 | bool enable_is_inverted; |
| 26 | }; |
| 27 | #define to_clk_regmap(_hw) container_of(_hw, struct clk_regmap, hw) |
| 28 | |
| 29 | int clk_is_enabled_regmap(struct clk_hw *hw); |
| 30 | int clk_enable_regmap(struct clk_hw *hw); |
| 31 | void clk_disable_regmap(struct clk_hw *hw); |
Stephen Boyd | 120c155 | 2016-08-16 15:38:27 -0700 | [diff] [blame] | 32 | int devm_clk_register_regmap(struct device *dev, struct clk_regmap *rclk); |
Stephen Boyd | 085d7a4 | 2014-01-15 10:47:23 -0800 | [diff] [blame] | 33 | |
| 34 | #endif |