| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Zynq PLL driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2013 Xilinx |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Sören Brinkmann <soren.brinkmann@xilinx.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software: you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License v2 as published by |
|---|
| 10 | | - * the Free Software Foundation. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | | - * GNU General Public License for more details. |
|---|
| 16 | | - * |
|---|
| 17 | | - * You should have received a copy of the GNU General Public License |
|---|
| 18 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 19 | | - * |
|---|
| 20 | 8 | */ |
|---|
| 21 | 9 | #include <linux/clk/zynq.h> |
|---|
| 22 | 10 | #include <linux/clk-provider.h> |
|---|
| .. | .. |
|---|
| 90 | 78 | * makes probably sense to redundantly save fbdiv in the struct |
|---|
| 91 | 79 | * zynq_pll to save the IO access. |
|---|
| 92 | 80 | */ |
|---|
| 93 | | - fbdiv = (clk_readl(clk->pll_ctrl) & PLLCTRL_FBDIV_MASK) >> |
|---|
| 81 | + fbdiv = (readl(clk->pll_ctrl) & PLLCTRL_FBDIV_MASK) >> |
|---|
| 94 | 82 | PLLCTRL_FBDIV_SHIFT; |
|---|
| 95 | 83 | |
|---|
| 96 | 84 | return parent_rate * fbdiv; |
|---|
| .. | .. |
|---|
| 112 | 100 | |
|---|
| 113 | 101 | spin_lock_irqsave(clk->lock, flags); |
|---|
| 114 | 102 | |
|---|
| 115 | | - reg = clk_readl(clk->pll_ctrl); |
|---|
| 103 | + reg = readl(clk->pll_ctrl); |
|---|
| 116 | 104 | |
|---|
| 117 | 105 | spin_unlock_irqrestore(clk->lock, flags); |
|---|
| 118 | 106 | |
|---|
| .. | .. |
|---|
| 138 | 126 | /* Power up PLL and wait for lock */ |
|---|
| 139 | 127 | spin_lock_irqsave(clk->lock, flags); |
|---|
| 140 | 128 | |
|---|
| 141 | | - reg = clk_readl(clk->pll_ctrl); |
|---|
| 129 | + reg = readl(clk->pll_ctrl); |
|---|
| 142 | 130 | reg &= ~(PLLCTRL_RESET_MASK | PLLCTRL_PWRDWN_MASK); |
|---|
| 143 | | - clk_writel(reg, clk->pll_ctrl); |
|---|
| 144 | | - while (!(clk_readl(clk->pll_status) & (1 << clk->lockbit))) |
|---|
| 131 | + writel(reg, clk->pll_ctrl); |
|---|
| 132 | + while (!(readl(clk->pll_status) & (1 << clk->lockbit))) |
|---|
| 145 | 133 | ; |
|---|
| 146 | 134 | |
|---|
| 147 | 135 | spin_unlock_irqrestore(clk->lock, flags); |
|---|
| .. | .. |
|---|
| 168 | 156 | /* shut down PLL */ |
|---|
| 169 | 157 | spin_lock_irqsave(clk->lock, flags); |
|---|
| 170 | 158 | |
|---|
| 171 | | - reg = clk_readl(clk->pll_ctrl); |
|---|
| 159 | + reg = readl(clk->pll_ctrl); |
|---|
| 172 | 160 | reg |= PLLCTRL_RESET_MASK | PLLCTRL_PWRDWN_MASK; |
|---|
| 173 | | - clk_writel(reg, clk->pll_ctrl); |
|---|
| 161 | + writel(reg, clk->pll_ctrl); |
|---|
| 174 | 162 | |
|---|
| 175 | 163 | spin_unlock_irqrestore(clk->lock, flags); |
|---|
| 176 | 164 | } |
|---|
| .. | .. |
|---|
| 223 | 211 | |
|---|
| 224 | 212 | spin_lock_irqsave(pll->lock, flags); |
|---|
| 225 | 213 | |
|---|
| 226 | | - reg = clk_readl(pll->pll_ctrl); |
|---|
| 214 | + reg = readl(pll->pll_ctrl); |
|---|
| 227 | 215 | reg &= ~PLLCTRL_BPQUAL_MASK; |
|---|
| 228 | | - clk_writel(reg, pll->pll_ctrl); |
|---|
| 216 | + writel(reg, pll->pll_ctrl); |
|---|
| 229 | 217 | |
|---|
| 230 | 218 | spin_unlock_irqrestore(pll->lock, flags); |
|---|
| 231 | 219 | |
|---|