brintos

brintos / linux-shallow public Read only

0
0
Text · 1.1 KiB · 14ec659 Raw
39 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/* Copyright (c) 2014, The Linux Foundation. All rights reserved. */3 4#ifndef __QCOM_CLK_REGMAP_H__5#define __QCOM_CLK_REGMAP_H__6 7#include <linux/clk-provider.h>8 9struct regmap;10 11/**12 * struct clk_regmap - regmap supporting clock13 * @hw:		handle between common and hardware-specific interfaces14 * @regmap:	regmap to use for regmap helpers and/or by providers15 * @enable_reg: register when using regmap enable/disable ops16 * @enable_mask: mask when using regmap enable/disable ops17 * @enable_is_inverted: flag to indicate set enable_mask bits to disable18 *                      when using clock_enable_regmap and friends APIs.19 */20struct 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 28static inline struct clk_regmap *to_clk_regmap(struct clk_hw *hw)29{30	return container_of(hw, struct clk_regmap, hw);31}32 33int clk_is_enabled_regmap(struct clk_hw *hw);34int clk_enable_regmap(struct clk_hw *hw);35void clk_disable_regmap(struct clk_hw *hw);36int devm_clk_register_regmap(struct device *dev, struct clk_regmap *rclk);37 38#endif39