• Home
  • Raw
  • Download

Lines Matching +full:fixed +full:- +full:clock

2  * Copyright (C) 2010-2011 Canonical Ltd <jeremy.kerr@canonical.com>
3 * Copyright (C) 2011-2012 Mike Turquette, Linaro Ltd <mturquette@linaro.org>
9 * Fixed rate clock implementation
12 #include <linux/clk-provider.h>
21 * DOC: basic fixed-rate clock that cannot gate
23 * Traits of this clock:
24 * prepare - clk_(un)prepare only ensures parents are prepared
25 * enable - clk_enable only ensures parents are enabled
26 * rate - rate is always a fixed value. No clk_set_rate support
27 * parent - fixed parent. No clk_set_parent support
33 return to_clk_fixed_rate(hw)->fixed_rate; in clk_fixed_rate_recalc_rate()
39 return to_clk_fixed_rate(hw)->fixed_accuracy; in clk_fixed_rate_recalc_accuracy()
49 * clk_hw_register_fixed_rate_with_accuracy - register fixed-rate clock with
50 * the clock framework
51 * @dev: device that is registering this clock
52 * @name: name of this clock
53 * @parent_name: name of clock's parent
54 * @flags: framework-specific flags
55 * @fixed_rate: non-adjustable clock rate
56 * @fixed_accuracy: non-adjustable clock rate
62 struct clk_fixed_rate *fixed; in clk_hw_register_fixed_rate_with_accuracy() local
67 /* allocate fixed-rate clock */ in clk_hw_register_fixed_rate_with_accuracy()
68 fixed = kzalloc(sizeof(*fixed), GFP_KERNEL); in clk_hw_register_fixed_rate_with_accuracy()
69 if (!fixed) in clk_hw_register_fixed_rate_with_accuracy()
70 return ERR_PTR(-ENOMEM); in clk_hw_register_fixed_rate_with_accuracy()
79 fixed->fixed_rate = fixed_rate; in clk_hw_register_fixed_rate_with_accuracy()
80 fixed->fixed_accuracy = fixed_accuracy; in clk_hw_register_fixed_rate_with_accuracy()
81 fixed->hw.init = &init; in clk_hw_register_fixed_rate_with_accuracy()
83 /* register the clock */ in clk_hw_register_fixed_rate_with_accuracy()
84 hw = &fixed->hw; in clk_hw_register_fixed_rate_with_accuracy()
87 kfree(fixed); in clk_hw_register_fixed_rate_with_accuracy()
105 return hw->clk; in clk_register_fixed_rate_with_accuracy()
110 * clk_hw_register_fixed_rate - register fixed-rate clock with the clock
112 * @dev: device that is registering this clock
113 * @name: name of this clock
114 * @parent_name: name of clock's parent
115 * @flags: framework-specific flags
116 * @fixed_rate: non-adjustable clock rate
151 struct clk_fixed_rate *fixed; in clk_hw_unregister_fixed_rate() local
153 fixed = to_clk_fixed_rate(hw); in clk_hw_unregister_fixed_rate()
156 kfree(fixed); in clk_hw_unregister_fixed_rate()
164 const char *clk_name = node->name; in _of_fixed_clk_setup()
169 if (of_property_read_u32(node, "clock-frequency", &rate)) in _of_fixed_clk_setup()
170 return ERR_PTR(-EIO); in _of_fixed_clk_setup()
172 of_property_read_u32(node, "clock-accuracy", &accuracy); in _of_fixed_clk_setup()
174 of_property_read_string(node, "clock-output-names", &clk_name); in _of_fixed_clk_setup()
191 * of_fixed_clk_setup() - Setup function for simple fixed rate clock
197 CLK_OF_DECLARE(fixed_clk, "fixed-clock", of_fixed_clk_setup);
203 of_clk_del_provider(pdev->dev.of_node); in of_fixed_clk_remove()
217 clk = _of_fixed_clk_setup(pdev->dev.of_node); in of_fixed_clk_probe()
227 { .compatible = "fixed-clock" },