Lines Matching +full:clock +full:- +full:indices
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Based on clk-simple-gates.c, which is:
8 * Maxime Ripard <maxime.ripard@free-electrons.com>
11 #include <linux/clk-provider.h>
39 int idx = of_property_match_string(node, "clock-names", in sun8i_h3_bus_gates_init()
51 number = of_property_count_u32_elems(node, "clock-indices"); in sun8i_h3_bus_gates_init()
52 of_property_read_u32_index(node, "clock-indices", number - 1, &number); in sun8i_h3_bus_gates_init()
54 clk_data->clks = kcalloc(number + 1, sizeof(struct clk *), GFP_KERNEL); in sun8i_h3_bus_gates_init()
55 if (!clk_data->clks) in sun8i_h3_bus_gates_init()
59 of_property_for_each_u32(node, "clock-indices", index) { in sun8i_h3_bus_gates_init()
60 of_property_read_string_index(node, "clock-output-names", in sun8i_h3_bus_gates_init()
79 clk_data->clks[index] = clk_register_gate(NULL, clk_name, in sun8i_h3_bus_gates_init()
85 if (IS_ERR(clk_data->clks[index])) { in sun8i_h3_bus_gates_init()
91 clk_data->clk_num = number + 1; in sun8i_h3_bus_gates_init()
104 CLK_OF_DECLARE(sun8i_h3_bus_gates, "allwinner,sun8i-h3-bus-gates-clk",
106 CLK_OF_DECLARE(sun8i_a83t_bus_gates, "allwinner,sun8i-a83t-bus-gates-clk",