2 * Hisilicon Hi3620 clock gate driver
4 * Copyright (c) 2012-2013 Hisilicon Limited.
5 * Copyright (c) 2012-2013 Linaro Limited.
7 * Author: Haojian Zhuang <haojian.zhuang@linaro.org>
8 * Xin Li <li.xin@linaro.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #include <linux/clk-provider.h>
31 #include <linux/spinlock.h>
33 struct hisi_clock_data
{
34 struct clk_onecell_data clk_data
;
38 struct hisi_fixed_rate_clock
{
41 const char *parent_name
;
43 unsigned long fixed_rate
;
46 struct hisi_fixed_factor_clock
{
49 const char *parent_name
;
55 struct hisi_mux_clock
{
58 const char *const *parent_names
;
69 struct hisi_divider_clock
{
72 const char *parent_name
;
78 struct clk_div_table
*table
;
82 struct hi6220_divider_clock
{
85 const char *parent_name
;
94 struct hisi_gate_clock
{
97 const char *parent_name
;
105 struct clk
*hisi_register_clkgate_sep(struct device
*, const char *,
106 const char *, unsigned long,
109 struct clk
*hi6220_register_clkdiv(struct device
*dev
, const char *name
,
110 const char *parent_name
, unsigned long flags
, void __iomem
*reg
,
111 u8 shift
, u8 width
, u32 mask_bit
, spinlock_t
*lock
);
113 struct hisi_clock_data
*hisi_clk_init(struct device_node
*, int);
114 void hisi_clk_register_fixed_rate(const struct hisi_fixed_rate_clock
*,
115 int, struct hisi_clock_data
*);
116 void hisi_clk_register_fixed_factor(const struct hisi_fixed_factor_clock
*,
117 int, struct hisi_clock_data
*);
118 void hisi_clk_register_mux(const struct hisi_mux_clock
*, int,
119 struct hisi_clock_data
*);
120 void hisi_clk_register_divider(const struct hisi_divider_clock
*,
121 int, struct hisi_clock_data
*);
122 void hisi_clk_register_gate(const struct hisi_gate_clock
*,
123 int, struct hisi_clock_data
*);
124 void hisi_clk_register_gate_sep(const struct hisi_gate_clock
*,
125 int, struct hisi_clock_data
*);
126 void hi6220_clk_register_divider(const struct hi6220_divider_clock
*,
127 int, struct hisi_clock_data
*);
128 #endif /* __HISI_CLK_H */