diff options
author | Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> | 2018-03-26 20:38:57 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2018-04-07 00:15:23 +0300 |
commit | 3495e29565986aac23efa5d5153e424e15ed2a3c (patch) | |
tree | 18b8f56aa4208baa8844f6f355ca34d3d6416794 /drivers/clk/actions/owl-common.h | |
parent | 06d42212e69bfa953aec5887c75a1781f27c2a2e (diff) | |
download | linux-3495e29565986aac23efa5d5153e424e15ed2a3c.tar.xz |
clk: actions: Add common clock driver support
Add support for Actions Semi common clock driver with generic structures
and interface functions.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/actions/owl-common.h')
-rw-r--r-- | drivers/clk/actions/owl-common.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/clk/actions/owl-common.h b/drivers/clk/actions/owl-common.h new file mode 100644 index 000000000000..4fd726ec54a6 --- /dev/null +++ b/drivers/clk/actions/owl-common.h @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// OWL common clock driver +// +// Copyright (c) 2014 Actions Semi Inc. +// Author: David Liu <liuwei@actions-semi.com> +// +// Copyright (c) 2018 Linaro Ltd. +// Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> + +#ifndef _OWL_COMMON_H_ +#define _OWL_COMMON_H_ + +#include <linux/clk-provider.h> +#include <linux/of_platform.h> +#include <linux/regmap.h> + +struct device_node; + +struct owl_clk_common { + struct regmap *regmap; + struct clk_hw hw; +}; + +struct owl_clk_desc { + struct owl_clk_common **clks; + unsigned long num_clks; + struct clk_hw_onecell_data *hw_clks; +}; + +static inline struct owl_clk_common * + hw_to_owl_clk_common(const struct clk_hw *hw) +{ + return container_of(hw, struct owl_clk_common, hw); +} + +int owl_clk_regmap_init(struct platform_device *pdev, + const struct owl_clk_desc *desc); +int owl_clk_probe(struct device *dev, struct clk_hw_onecell_data *hw_clks); + +#endif /* _OWL_COMMON_H_ */ |