Lines Matching +full:clk +full:- +full:div

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2014 Chen-Yu Tsai
5 * Chen-Yu Tsai <wens@csie.org>
8 #include <linux/clk.h>
9 #include <linux/clk-provider.h>
28 const char *clk_name = node->name; in sun8i_a23_mbus_setup()
30 struct clk_divider *div; in sun8i_a23_mbus_setup() local
33 struct clk *clk; in sun8i_a23_mbus_setup() local
43 pr_err("Could not get registers for sun8i-mbus-clk\n"); in sun8i_a23_mbus_setup()
47 div = kzalloc(sizeof(*div), GFP_KERNEL); in sun8i_a23_mbus_setup()
48 if (!div) in sun8i_a23_mbus_setup()
59 of_property_read_string(node, "clock-output-names", &clk_name); in sun8i_a23_mbus_setup()
62 gate->reg = reg; in sun8i_a23_mbus_setup()
63 gate->bit_idx = SUN8I_MBUS_ENABLE; in sun8i_a23_mbus_setup()
64 gate->lock = &sun8i_a23_mbus_lock; in sun8i_a23_mbus_setup()
66 div->reg = reg; in sun8i_a23_mbus_setup()
67 div->shift = SUN8I_MBUS_DIV_SHIFT; in sun8i_a23_mbus_setup()
68 div->width = SUN8I_MBUS_DIV_WIDTH; in sun8i_a23_mbus_setup()
69 div->lock = &sun8i_a23_mbus_lock; in sun8i_a23_mbus_setup()
71 mux->reg = reg; in sun8i_a23_mbus_setup()
72 mux->shift = SUN8I_MBUS_MUX_SHIFT; in sun8i_a23_mbus_setup()
73 mux->mask = SUN8I_MBUS_MUX_MASK; in sun8i_a23_mbus_setup()
74 mux->lock = &sun8i_a23_mbus_lock; in sun8i_a23_mbus_setup()
77 clk = clk_register_composite(NULL, clk_name, parents, num_parents, in sun8i_a23_mbus_setup()
78 &mux->hw, &clk_mux_ops, in sun8i_a23_mbus_setup()
79 &div->hw, &clk_divider_ops, in sun8i_a23_mbus_setup()
80 &gate->hw, &clk_gate_ops, in sun8i_a23_mbus_setup()
82 if (IS_ERR(clk)) in sun8i_a23_mbus_setup()
85 err = of_clk_add_provider(node, of_clk_src_simple_get, clk); in sun8i_a23_mbus_setup()
95 clk_unregister(clk); in sun8i_a23_mbus_setup()
101 kfree(div); in sun8i_a23_mbus_setup()
109 CLK_OF_DECLARE(sun8i_a23_mbus, "allwinner,sun8i-a23-mbus-clk", sun8i_a23_mbus_setup);