mux.c (0898782247ae533d1f4e47a06bc5d4870931b284) | mux.c (ed06099c5d0b329082cc19c58eace0b20bf7fe70) |
---|---|
1/* 2 * TI Multiplexer Clock 3 * 4 * Copyright (C) 2013 Texas Instruments, Inc. 5 * 6 * Tero Kristo <t-kristo@ti.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 162 unchanged lines hidden (view full) --- 171 * Sets up a basic clock multiplexer. 172 */ 173static void of_mux_clk_setup(struct device_node *node) 174{ 175 struct clk *clk; 176 struct clk_omap_reg reg; 177 unsigned int num_parents; 178 const char **parent_names; | 1/* 2 * TI Multiplexer Clock 3 * 4 * Copyright (C) 2013 Texas Instruments, Inc. 5 * 6 * Tero Kristo <t-kristo@ti.com> 7 * 8 * This program is free software; you can redistribute it and/or modify --- 162 unchanged lines hidden (view full) --- 171 * Sets up a basic clock multiplexer. 172 */ 173static void of_mux_clk_setup(struct device_node *node) 174{ 175 struct clk *clk; 176 struct clk_omap_reg reg; 177 unsigned int num_parents; 178 const char **parent_names; |
179 const char *name; |
|
179 u8 clk_mux_flags = 0; 180 u32 mask = 0; 181 u32 shift = 0; 182 s32 latch = -EINVAL; 183 u32 flags = CLK_SET_RATE_NO_REPARENT; 184 185 num_parents = of_clk_get_parent_count(node); 186 if (num_parents < 2) { --- 21 unchanged lines hidden (view full) --- 208 209 /* Generate bit-mask based on parent info */ 210 mask = num_parents; 211 if (!(clk_mux_flags & CLK_MUX_INDEX_ONE)) 212 mask--; 213 214 mask = (1 << fls(mask)) - 1; 215 | 180 u8 clk_mux_flags = 0; 181 u32 mask = 0; 182 u32 shift = 0; 183 s32 latch = -EINVAL; 184 u32 flags = CLK_SET_RATE_NO_REPARENT; 185 186 num_parents = of_clk_get_parent_count(node); 187 if (num_parents < 2) { --- 21 unchanged lines hidden (view full) --- 209 210 /* Generate bit-mask based on parent info */ 211 mask = num_parents; 212 if (!(clk_mux_flags & CLK_MUX_INDEX_ONE)) 213 mask--; 214 215 mask = (1 << fls(mask)) - 1; 216 |
216 clk = _register_mux(NULL, node->name, parent_names, num_parents, | 217 name = ti_dt_clk_name(node); 218 clk = _register_mux(NULL, name, parent_names, num_parents, |
217 flags, ®, shift, mask, latch, clk_mux_flags, 218 NULL); 219 220 if (!IS_ERR(clk)) 221 of_clk_add_provider(node, of_clk_src_simple_get, clk); 222 223cleanup: 224 kfree(parent_names); --- 69 unchanged lines hidden --- | 219 flags, ®, shift, mask, latch, clk_mux_flags, 220 NULL); 221 222 if (!IS_ERR(clk)) 223 of_clk_add_provider(node, of_clk_src_simple_get, clk); 224 225cleanup: 226 kfree(parent_names); --- 69 unchanged lines hidden --- |