.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * 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/>. |
---|
15 | 4 | */ |
---|
16 | 5 | |
---|
17 | 6 | #include <linux/kernel.h> |
---|
.. | .. |
---|
80 | 69 | spin_unlock_irqrestore(pll_out->lock, flags); |
---|
81 | 70 | } |
---|
82 | 71 | |
---|
| 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 | + |
---|
83 | 80 | const struct clk_ops tegra_clk_pll_out_ops = { |
---|
84 | 81 | .is_enabled = clk_pll_out_is_enabled, |
---|
85 | 82 | .enable = clk_pll_out_enable, |
---|
86 | 83 | .disable = clk_pll_out_disable, |
---|
| 84 | + .restore_context = tegra_clk_pll_out_restore_context, |
---|
87 | 85 | }; |
---|
88 | 86 | |
---|
89 | 87 | struct clk *tegra_clk_register_pll_out(const char *name, |
---|
.. | .. |
---|
93 | 91 | { |
---|
94 | 92 | struct tegra_clk_pll_out *pll_out; |
---|
95 | 93 | struct clk *clk; |
---|
96 | | - struct clk_init_data init = {}; |
---|
| 94 | + struct clk_init_data init; |
---|
97 | 95 | |
---|
98 | 96 | pll_out = kzalloc(sizeof(*pll_out), GFP_KERNEL); |
---|
99 | 97 | if (!pll_out) |
---|