forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/clk/tegra/clk-pll-out.c
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
12
- *
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
154 */
165
176 #include <linux/kernel.h>
....@@ -80,10 +69,19 @@
8069 spin_unlock_irqrestore(pll_out->lock, flags);
8170 }
8271
72
+static void tegra_clk_pll_out_restore_context(struct clk_hw *hw)
73
+{
74
+ if (!__clk_get_enable_count(hw->clk))
75
+ clk_pll_out_disable(hw);
76
+ else
77
+ clk_pll_out_enable(hw);
78
+}
79
+
8380 const struct clk_ops tegra_clk_pll_out_ops = {
8481 .is_enabled = clk_pll_out_is_enabled,
8582 .enable = clk_pll_out_enable,
8683 .disable = clk_pll_out_disable,
84
+ .restore_context = tegra_clk_pll_out_restore_context,
8785 };
8886
8987 struct clk *tegra_clk_register_pll_out(const char *name,
....@@ -93,7 +91,7 @@
9391 {
9492 struct tegra_clk_pll_out *pll_out;
9593 struct clk *clk;
96
- struct clk_init_data init = {};
94
+ struct clk_init_data init;
9795
9896 pll_out = kzalloc(sizeof(*pll_out), GFP_KERNEL);
9997 if (!pll_out)