Lines Matching +full:conf +full:- +full:clk
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
29 #include <sys/conf.h>
41 #include <dev/clk/clk_mux.h>
54 read_clock_cells(device_t dev, struct clock_cell_info *clk) { in read_clock_cells() argument
63 clk->num_clock_cells = numbytes_clocks / sizeof(cell_t); in read_clock_cells()
69 clk->clock_cells = malloc(numbytes_clocks, M_DEVBUF, M_WAITOK|M_ZERO); in read_clock_cells()
70 clk->clock_cells_ncells = malloc(clk->num_clock_cells*sizeof(uint8_t), in read_clock_cells()
72 OF_getencprop(node, "clocks", clk->clock_cells, numbytes_clocks); in read_clock_cells()
75 clk->num_real_clocks = 0; in read_clock_cells()
76 for (index = 0; index < clk->num_clock_cells; index++) { in read_clock_cells()
77 rv = ofw_bus_parse_xref_list_alloc(node, "clocks", "#clock-cells", in read_clock_cells()
78 clk->num_real_clocks, &parent, &ncells, &cells); in read_clock_cells()
85 clk->clock_cells_ncells[index] = ncells; in read_clock_cells()
87 clk->num_real_clocks++; in read_clock_cells()
92 find_parent_clock_names(device_t dev, struct clock_cell_info *clk, struct clknode_init_def *def) { in find_parent_clock_names() argument
98 for (index = 0, clock_index = 0; index < clk->num_clock_cells; index++) { in find_parent_clock_names()
105 index, clk->clock_cells[index]); in find_parent_clock_names()
107 index += clk->clock_cells_ncells[index]; in find_parent_clock_names()
111 def->parent_names[clock_index] = clk_get_name(parent); in find_parent_clock_names()
115 clock_index, clk->num_real_clocks, in find_parent_clock_names()
116 def->parent_names[clock_index]); in find_parent_clock_names()
119 index += clk->clock_cells_ncells[index]; in find_parent_clock_names()
126 free(clk->clock_cells, M_DEVBUF); in find_parent_clock_names()
127 free(clk->clock_cells_ncells, M_DEVBUF); in find_parent_clock_names()
132 create_clkdef(device_t dev, struct clock_cell_info *clk, struct clknode_init_def *def) { in create_clkdef() argument
133 def->id = 1; in create_clkdef()
135 clk_parse_ofw_clk_name(dev, ofw_bus_get_node(dev), &def->name); in create_clkdef()
137 DPRINTF(dev, "node name: %s\n", def->name); in create_clkdef()
139 def->parent_cnt = clk->num_real_clocks; in create_clkdef()
140 def->parent_names = malloc(clk->num_real_clocks*sizeof(char *), in create_clkdef()
145 OF_prop_free(__DECONST(char *, def->name)); in free_clkdef()
146 OF_prop_free(def->parent_names); in free_clkdef()