Lines Matching +full:zynq +full:- +full:can +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0
3 * Zynq UltraScale+ MPSoC PLL driver
5 * Copyright (C) 2016-2018 Xilinx
9 #include <linux/clk-provider.h>
11 #include "clk-zynqmp.h"
14 * struct zynqmp_pll - PLL clock
15 * @hw: Handle between common and hardware-specific interfaces
35 PLL_MODE_FRAC = 1,
44 * zynqmp_pll_get_mode() - Get mode of PLL
45 * @hw: Handle between common and hardware-specific interfaces
52 u32 clk_id = clk->clk_id; in zynqmp_pll_get_mode()
64 return ret_payload[1]; in zynqmp_pll_get_mode()
68 * zynqmp_pll_set_mode() - Set the PLL mode
69 * @hw: Handle between common and hardware-specific interfaces
75 u32 clk_id = clk->clk_id; in zynqmp_pll_set_mode()
90 clk->set_pll_mode = true; in zynqmp_pll_set_mode()
94 * zynqmp_pll_round_rate() - Round a clock frequency
95 * @hw: Handle between common and hardware-specific interfaces
99 * Return: Frequency closest to @rate the hardware can generate
127 * zynqmp_pll_recalc_rate() - Recalculate clock frequency
128 * @hw: Handle between common and hardware-specific interfaces
137 u32 clk_id = clk->clk_id; in zynqmp_pll_recalc_rate()
159 data = ret_payload[1]; in zynqmp_pll_recalc_rate()
168 * zynqmp_pll_set_rate() - Set rate of PLL
169 * @hw: Handle between common and hardware-specific interfaces
181 u32 clk_id = clk->clk_id; in zynqmp_pll_set_rate()
198 if (ret == -EUSERS) in zynqmp_pll_set_rate()
199 WARN(1, "More than allowed devices are using the %s, which is forbidden\n", in zynqmp_pll_set_rate()
220 * zynqmp_pll_is_enabled() - Check if a clock is enabled
221 * @hw: Handle between common and hardware-specific interfaces
223 * Return: 1 if the clock is enabled, 0 otherwise
229 u32 clk_id = clk->clk_id; in zynqmp_pll_is_enabled()
237 return -EIO; in zynqmp_pll_is_enabled()
240 return state ? 1 : 0; in zynqmp_pll_is_enabled()
244 * zynqmp_pll_enable() - Enable clock
245 * @hw: Handle between common and hardware-specific interfaces
253 u32 clk_id = clk->clk_id; in zynqmp_pll_enable()
260 if (zynqmp_pll_is_enabled(hw) && (!clk->set_pll_mode)) in zynqmp_pll_enable()
263 clk->set_pll_mode = false; in zynqmp_pll_enable()
274 * zynqmp_pll_disable() - Disable clock
275 * @hw: Handle between common and hardware-specific interfaces
281 u32 clk_id = clk->clk_id; in zynqmp_pll_disable()
303 * zynqmp_clk_register_pll() - Register PLL with the clock framework
325 init.flags = zynqmp_clk_map_common_ccf_flags(nodes->flag); in zynqmp_clk_register_pll()
328 init.num_parents = 1; in zynqmp_clk_register_pll()
332 return ERR_PTR(-ENOMEM); in zynqmp_clk_register_pll()
334 pll->hw.init = &init; in zynqmp_clk_register_pll()
335 pll->clk_id = clk_id; in zynqmp_clk_register_pll()
337 hw = &pll->hw; in zynqmp_clk_register_pll()