forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/clk/mediatek/clk-gate.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2014 MediaTek Inc.
34 * Author: James Liao <jamesjj.liao@mediatek.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
135 */
146
157 #include <linux/of.h>
....@@ -157,7 +149,9 @@
157149 int clr_ofs,
158150 int sta_ofs,
159151 u8 bit,
160
- const struct clk_ops *ops)
152
+ const struct clk_ops *ops,
153
+ unsigned long flags,
154
+ struct device *dev)
161155 {
162156 struct mtk_clk_gate *cg;
163157 struct clk *clk;
....@@ -168,7 +162,7 @@
168162 return ERR_PTR(-ENOMEM);
169163
170164 init.name = name;
171
- init.flags = CLK_SET_RATE_PARENT;
165
+ init.flags = flags | CLK_SET_RATE_PARENT;
172166 init.parent_names = parent_name ? &parent_name : NULL;
173167 init.num_parents = parent_name ? 1 : 0;
174168 init.ops = ops;
....@@ -181,7 +175,7 @@
181175
182176 cg->hw.init = &init;
183177
184
- clk = clk_register(NULL, &cg->hw);
178
+ clk = clk_register(dev, &cg->hw);
185179 if (IS_ERR(clk))
186180 kfree(cg);
187181