Lines Matching +full:rclk +full:-
1 // SPDX-License-Identifier: GPL-2.0
7 #include <linux/clk-provider.h>
11 #include "clk-regmap.h"
14 * clk_is_enabled_regmap - standard is_enabled() for regmap users
24 struct clk_regmap *rclk = to_clk_regmap(hw); in clk_is_enabled_regmap() local
28 ret = regmap_read(rclk->regmap, rclk->enable_reg, &val); in clk_is_enabled_regmap()
32 if (rclk->enable_is_inverted) in clk_is_enabled_regmap()
33 return (val & rclk->enable_mask) == 0; in clk_is_enabled_regmap()
35 return (val & rclk->enable_mask) != 0; in clk_is_enabled_regmap()
40 * clk_enable_regmap - standard enable() for regmap users
50 struct clk_regmap *rclk = to_clk_regmap(hw); in clk_enable_regmap() local
53 if (rclk->enable_is_inverted) in clk_enable_regmap()
56 val = rclk->enable_mask; in clk_enable_regmap()
58 return regmap_update_bits(rclk->regmap, rclk->enable_reg, in clk_enable_regmap()
59 rclk->enable_mask, val); in clk_enable_regmap()
64 * clk_disable_regmap - standard disable() for regmap users
74 struct clk_regmap *rclk = to_clk_regmap(hw); in clk_disable_regmap() local
77 if (rclk->enable_is_inverted) in clk_disable_regmap()
78 val = rclk->enable_mask; in clk_disable_regmap()
82 regmap_update_bits(rclk->regmap, rclk->enable_reg, rclk->enable_mask, in clk_disable_regmap()
88 * devm_clk_register_regmap - register a clk_regmap clock
91 * @rclk: clk to operate on
97 int devm_clk_register_regmap(struct device *dev, struct clk_regmap *rclk) in devm_clk_register_regmap() argument
100 rclk->regmap = dev_get_regmap(dev, NULL); in devm_clk_register_regmap()
101 else if (dev && dev->parent) in devm_clk_register_regmap()
102 rclk->regmap = dev_get_regmap(dev->parent, NULL); in devm_clk_register_regmap()
104 return devm_clk_hw_register(dev, &rclk->hw); in devm_clk_register_regmap()