hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/clk/x86/clk-cgu-pll.c
....@@ -1,8 +1,9 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /*
3
+ * Copyright (C) 2020-2022 MaxLinear, Inc.
34 * Copyright (C) 2020 Intel Corporation.
4
- * Zhu YiXin <yixin.zhu@intel.com>
5
- * Rahul Tanwar <rahul.tanwar@intel.com>
5
+ * Zhu Yixin <yzhu@maxlinear.com>
6
+ * Rahul Tanwar <rtanwar@maxlinear.com>
67 */
78
89 #include <linux/clk-provider.h>
....@@ -40,13 +41,10 @@
4041 {
4142 struct lgm_clk_pll *pll = to_lgm_clk_pll(hw);
4243 unsigned int div, mult, frac;
43
- unsigned long flags;
4444
45
- spin_lock_irqsave(&pll->lock, flags);
4645 mult = lgm_get_clk_val(pll->membase, PLL_REF_DIV(pll->reg), 0, 12);
4746 div = lgm_get_clk_val(pll->membase, PLL_REF_DIV(pll->reg), 18, 6);
4847 frac = lgm_get_clk_val(pll->membase, pll->reg, 2, 24);
49
- spin_unlock_irqrestore(&pll->lock, flags);
5048
5149 if (pll->type == TYPE_LJPLL)
5250 div *= 4;
....@@ -57,12 +55,9 @@
5755 static int lgm_pll_is_enabled(struct clk_hw *hw)
5856 {
5957 struct lgm_clk_pll *pll = to_lgm_clk_pll(hw);
60
- unsigned long flags;
6158 unsigned int ret;
6259
63
- spin_lock_irqsave(&pll->lock, flags);
6460 ret = lgm_get_clk_val(pll->membase, pll->reg, 0, 1);
65
- spin_unlock_irqrestore(&pll->lock, flags);
6661
6762 return ret;
6863 }
....@@ -70,15 +65,13 @@
7065 static int lgm_pll_enable(struct clk_hw *hw)
7166 {
7267 struct lgm_clk_pll *pll = to_lgm_clk_pll(hw);
73
- unsigned long flags;
7468 u32 val;
7569 int ret;
7670
77
- spin_lock_irqsave(&pll->lock, flags);
7871 lgm_set_clk_val(pll->membase, pll->reg, 0, 1, 1);
79
- ret = readl_poll_timeout_atomic(pll->membase + pll->reg,
80
- val, (val & 0x1), 1, 100);
81
- spin_unlock_irqrestore(&pll->lock, flags);
72
+ ret = regmap_read_poll_timeout_atomic(pll->membase, pll->reg,
73
+ val, (val & 0x1), 1, 100);
74
+
8275
8376 return ret;
8477 }
....@@ -86,11 +79,8 @@
8679 static void lgm_pll_disable(struct clk_hw *hw)
8780 {
8881 struct lgm_clk_pll *pll = to_lgm_clk_pll(hw);
89
- unsigned long flags;
9082
91
- spin_lock_irqsave(&pll->lock, flags);
9283 lgm_set_clk_val(pll->membase, pll->reg, 0, 1, 0);
93
- spin_unlock_irqrestore(&pll->lock, flags);
9484 }
9585
9686 static const struct clk_ops lgm_pll_ops = {
....@@ -121,7 +111,6 @@
121111 return ERR_PTR(-ENOMEM);
122112
123113 pll->membase = ctx->membase;
124
- pll->lock = ctx->lock;
125114 pll->reg = list->reg;
126115 pll->flags = list->flags;
127116 pll->type = list->type;