Skip to content

Commit a993be3

Browse files
committed
Merge branches 'clk-debugfs', 'clk-unused', 'clk-refactor' and 'clk-qoriq' into clk-next
- Add a 'clk_parent' file in clk debugfs - Remove dead code in various clk drivers * clk-debugfs: clk: Add clk_parent entry in debugfs * clk-unused: clk: qcom: Fix -Wunused-const-variable clk: mmp: frac: Remove set but not used variable 'prev_rate' clk: ti: Remove unused functions clk: mediatek: mt8516: Remove unused variable * clk-refactor: clk: clk-cdce706: simplify getting the adapter of a client clk: Simplify clk_core_can_round() * clk-qoriq: clk: qoriq: add support for lx2160a
5 parents dfe1d3a + e5e8924 + da64242 + df095f9 + 78a5ba8 commit a993be3

9 files changed

Lines changed: 30 additions & 194 deletions

File tree

‎drivers/clk/clk-cdce706.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ of_clk_cdce_get(struct of_phandle_args *clkspec, void *data)
633633
static int cdce706_probe(struct i2c_client *client,
634634
const struct i2c_device_id *id)
635635
{
636-
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
636+
struct i2c_adapter *adapter = client->adapter;
637637
struct cdce706_dev_data *cdce;
638638
int ret;
639639

‎drivers/clk/clk-qoriq.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,17 @@ static const struct clockgen_chipinfo chipinfo[] = {
637637
.pll_mask = 0x37,
638638
.flags = CG_VER3 | CG_LITTLE_ENDIAN,
639639
},
640+
{
641+
.compat = "fsl,lx2160a-clockgen",
642+
.cmux_groups = {
643+
&clockgen2_cmux_cga12, &clockgen2_cmux_cgb
644+
},
645+
.cmux_to_group = {
646+
0, 0, 0, 0, 1, 1, 1, 1, -1
647+
},
648+
.pll_mask = 0x37,
649+
.flags = CG_VER3 | CG_LITTLE_ENDIAN,
650+
},
640651
{
641652
.compat = "fsl,p2041-clockgen",
642653
.guts_compat = "fsl,qoriq-device-config-1.0",
@@ -1496,6 +1507,7 @@ CLK_OF_DECLARE(qoriq_clockgen_ls1043a, "fsl,ls1043a-clockgen", clockgen_init);
14961507
CLK_OF_DECLARE(qoriq_clockgen_ls1046a, "fsl,ls1046a-clockgen", clockgen_init);
14971508
CLK_OF_DECLARE(qoriq_clockgen_ls1088a, "fsl,ls1088a-clockgen", clockgen_init);
14981509
CLK_OF_DECLARE(qoriq_clockgen_ls2080a, "fsl,ls2080a-clockgen", clockgen_init);
1510+
CLK_OF_DECLARE(qoriq_clockgen_lx2160a, "fsl,lx2160a-clockgen", clockgen_init);
14991511
CLK_OF_DECLARE(qoriq_clockgen_p2041, "fsl,p2041-clockgen", clockgen_init);
15001512
CLK_OF_DECLARE(qoriq_clockgen_p3041, "fsl,p3041-clockgen", clockgen_init);
15011513
CLK_OF_DECLARE(qoriq_clockgen_p4080, "fsl,p4080-clockgen", clockgen_init);

‎drivers/clk/clk.c‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,10 +1324,7 @@ static void clk_core_init_rate_req(struct clk_core * const core,
13241324

13251325
static bool clk_core_can_round(struct clk_core * const core)
13261326
{
1327-
if (core->ops->determine_rate || core->ops->round_rate)
1328-
return true;
1329-
1330-
return false;
1327+
return core->ops->determine_rate || core->ops->round_rate;
13311328
}
13321329

13331330
static int clk_core_round_rate_nolock(struct clk_core *core,
@@ -3045,6 +3042,17 @@ static int possible_parents_show(struct seq_file *s, void *data)
30453042
}
30463043
DEFINE_SHOW_ATTRIBUTE(possible_parents);
30473044

3045+
static int current_parent_show(struct seq_file *s, void *data)
3046+
{
3047+
struct clk_core *core = s->private;
3048+
3049+
if (core->parent)
3050+
seq_printf(s, "%s\n", core->parent->name);
3051+
3052+
return 0;
3053+
}
3054+
DEFINE_SHOW_ATTRIBUTE(current_parent);
3055+
30483056
static int clk_duty_cycle_show(struct seq_file *s, void *data)
30493057
{
30503058
struct clk_core *core = s->private;
@@ -3077,6 +3085,10 @@ static void clk_debug_create_one(struct clk_core *core, struct dentry *pdentry)
30773085
debugfs_create_file("clk_duty_cycle", 0444, root, core,
30783086
&clk_duty_cycle_fops);
30793087

3088+
if (core->num_parents > 0)
3089+
debugfs_create_file("clk_parent", 0444, root, core,
3090+
&current_parent_fops);
3091+
30803092
if (core->num_parents > 1)
30813093
debugfs_create_file("clk_possible_parents", 0444, root, core,
30823094
&possible_parents_fops);

‎drivers/clk/mediatek/clk-mt8516.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,6 @@ static const char * const nfi1x_pad_parents[] __initconst = {
231231
"nfi1x_ck"
232232
};
233233

234-
static const char * const ddrphycfg_parents[] __initconst = {
235-
"clk26m_ck",
236-
"mainpll_d16"
237-
};
238-
239234
static const char * const usb_78m_parents[] __initconst = {
240235
"clk_null",
241236
"clk26m_ck",

‎drivers/clk/mmp/clk-frac.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ static int clk_factor_set_rate(struct clk_hw *hw, unsigned long drate,
7878
struct mmp_clk_factor_masks *masks = factor->masks;
7979
int i;
8080
unsigned long val;
81-
unsigned long prev_rate, rate = 0;
81+
unsigned long rate = 0;
8282
unsigned long flags = 0;
8383

8484
for (i = 0; i < factor->ftbl_cnt; i++) {
85-
prev_rate = rate;
8685
rate = (((prate / 10000) * factor->ftbl[i].den) /
8786
(factor->ftbl[i].num * factor->masks->factor)) * 10000;
8887
if (rate > drate)

‎drivers/clk/qcom/gcc-msm8996.c‎

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,6 @@ static const char * const gcc_xo_gpll0_gpll4_gpll0_early_div[] = {
138138
"gpll0_early_div"
139139
};
140140

141-
static const struct parent_map gcc_xo_gpll0_gpll2_gpll3_gpll0_early_div_map[] = {
142-
{ P_XO, 0 },
143-
{ P_GPLL0, 1 },
144-
{ P_GPLL2, 2 },
145-
{ P_GPLL3, 3 },
146-
{ P_GPLL0_EARLY_DIV, 6 }
147-
};
148-
149-
static const char * const gcc_xo_gpll0_gpll2_gpll3_gpll0_early_div[] = {
150-
"xo",
151-
"gpll0",
152-
"gpll2",
153-
"gpll3",
154-
"gpll0_early_div"
155-
};
156-
157141
static const struct parent_map gcc_xo_gpll0_gpll1_early_div_gpll1_gpll4_gpll0_early_div_map[] = {
158142
{ P_XO, 0 },
159143
{ P_GPLL0, 1 },
@@ -192,26 +176,6 @@ static const char * const gcc_xo_gpll0_gpll2_gpll3_gpll1_gpll2_early_gpll0_early
192176
"gpll0_early_div"
193177
};
194178

195-
static const struct parent_map gcc_xo_gpll0_gpll2_gpll3_gpll1_gpll4_gpll0_early_div_map[] = {
196-
{ P_XO, 0 },
197-
{ P_GPLL0, 1 },
198-
{ P_GPLL2, 2 },
199-
{ P_GPLL3, 3 },
200-
{ P_GPLL1, 4 },
201-
{ P_GPLL4, 5 },
202-
{ P_GPLL0_EARLY_DIV, 6 }
203-
};
204-
205-
static const char * const gcc_xo_gpll0_gpll2_gpll3_gpll1_gpll4_gpll0_early_div[] = {
206-
"xo",
207-
"gpll0",
208-
"gpll2",
209-
"gpll3",
210-
"gpll1",
211-
"gpll4",
212-
"gpll0_early_div"
213-
};
214-
215179
static struct clk_fixed_factor xo = {
216180
.mult = 1,
217181
.div = 1,

‎drivers/clk/ti/divider.c‎

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -425,91 +425,6 @@ int ti_clk_parse_divider_data(int *div_table, int num_dividers, int max_div,
425425
return 0;
426426
}
427427

428-
static const struct clk_div_table *
429-
_get_div_table_from_setup(struct ti_clk_divider *setup, u8 *width)
430-
{
431-
const struct clk_div_table *table = NULL;
432-
433-
ti_clk_parse_divider_data(setup->dividers, setup->num_dividers,
434-
setup->max_div, setup->flags, width,
435-
&table);
436-
437-
return table;
438-
}
439-
440-
struct clk_hw *ti_clk_build_component_div(struct ti_clk_divider *setup)
441-
{
442-
struct clk_omap_divider *div;
443-
struct clk_omap_reg *reg;
444-
int ret;
445-
446-
if (!setup)
447-
return NULL;
448-
449-
div = kzalloc(sizeof(*div), GFP_KERNEL);
450-
if (!div)
451-
return ERR_PTR(-ENOMEM);
452-
453-
reg = (struct clk_omap_reg *)&div->reg;
454-
reg->index = setup->module;
455-
reg->offset = setup->reg;
456-
457-
if (setup->flags & CLKF_INDEX_STARTS_AT_ONE)
458-
div->flags |= CLK_DIVIDER_ONE_BASED;
459-
460-
if (setup->flags & CLKF_INDEX_POWER_OF_TWO)
461-
div->flags |= CLK_DIVIDER_POWER_OF_TWO;
462-
463-
div->table = _get_div_table_from_setup(setup, &div->width);
464-
if (IS_ERR(div->table)) {
465-
ret = PTR_ERR(div->table);
466-
kfree(div);
467-
return ERR_PTR(ret);
468-
}
469-
470-
471-
div->shift = setup->bit_shift;
472-
div->latch = -EINVAL;
473-
474-
return &div->hw;
475-
}
476-
477-
struct clk *ti_clk_register_divider(struct ti_clk *setup)
478-
{
479-
struct ti_clk_divider *div = setup->data;
480-
struct clk_omap_reg reg = {
481-
.index = div->module,
482-
.offset = div->reg,
483-
};
484-
u8 width;
485-
u32 flags = 0;
486-
u8 div_flags = 0;
487-
const struct clk_div_table *table;
488-
struct clk *clk;
489-
490-
if (div->flags & CLKF_INDEX_STARTS_AT_ONE)
491-
div_flags |= CLK_DIVIDER_ONE_BASED;
492-
493-
if (div->flags & CLKF_INDEX_POWER_OF_TWO)
494-
div_flags |= CLK_DIVIDER_POWER_OF_TWO;
495-
496-
if (div->flags & CLKF_SET_RATE_PARENT)
497-
flags |= CLK_SET_RATE_PARENT;
498-
499-
table = _get_div_table_from_setup(div, &width);
500-
if (IS_ERR(table))
501-
return (struct clk *)table;
502-
503-
clk = _register_divider(NULL, setup->name, div->parent,
504-
flags, &reg, div->bit_shift,
505-
width, -EINVAL, div_flags, table);
506-
507-
if (IS_ERR(clk))
508-
kfree(table);
509-
510-
return clk;
511-
}
512-
513428
static struct clk_div_table *
514429
__init ti_clk_get_div_table(struct device_node *node)
515430
{

‎drivers/clk/ti/gate.c‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -131,36 +131,6 @@ static struct clk *_register_gate(struct device *dev, const char *name,
131131
return clk;
132132
}
133133

134-
struct clk_hw *ti_clk_build_component_gate(struct ti_clk_gate *setup)
135-
{
136-
struct clk_hw_omap *gate;
137-
struct clk_omap_reg *reg;
138-
const struct clk_hw_omap_ops *ops = &clkhwops_wait;
139-
140-
if (!setup)
141-
return NULL;
142-
143-
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
144-
if (!gate)
145-
return ERR_PTR(-ENOMEM);
146-
147-
reg = (struct clk_omap_reg *)&gate->enable_reg;
148-
reg->index = setup->module;
149-
reg->offset = setup->reg;
150-
151-
gate->enable_bit = setup->bit_shift;
152-
153-
if (setup->flags & CLKF_NO_WAIT)
154-
ops = NULL;
155-
156-
if (setup->flags & CLKF_INTERFACE)
157-
ops = &clkhwops_iclk_wait;
158-
159-
gate->ops = ops;
160-
161-
return &gate->hw;
162-
}
163-
164134
static void __init _of_ti_gate_clk_setup(struct device_node *node,
165135
const struct clk_ops *ops,
166136
const struct clk_hw_omap_ops *hw_ops)

‎drivers/clk/ti/mux.c‎

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -164,37 +164,6 @@ static struct clk *_register_mux(struct device *dev, const char *name,
164164
return clk;
165165
}
166166

167-
struct clk *ti_clk_register_mux(struct ti_clk *setup)
168-
{
169-
struct ti_clk_mux *mux;
170-
u32 flags;
171-
u8 mux_flags = 0;
172-
struct clk_omap_reg reg;
173-
u32 mask;
174-
175-
mux = setup->data;
176-
flags = CLK_SET_RATE_NO_REPARENT;
177-
178-
mask = mux->num_parents;
179-
if (!(mux->flags & CLKF_INDEX_STARTS_AT_ONE))
180-
mask--;
181-
182-
mask = (1 << fls(mask)) - 1;
183-
reg.index = mux->module;
184-
reg.offset = mux->reg;
185-
reg.ptr = NULL;
186-
187-
if (mux->flags & CLKF_INDEX_STARTS_AT_ONE)
188-
mux_flags |= CLK_MUX_INDEX_ONE;
189-
190-
if (mux->flags & CLKF_SET_RATE_PARENT)
191-
flags |= CLK_SET_RATE_PARENT;
192-
193-
return _register_mux(NULL, setup->name, mux->parents, mux->num_parents,
194-
flags, &reg, mux->bit_shift, mask, -EINVAL,
195-
mux_flags, NULL);
196-
}
197-
198167
/**
199168
* of_mux_clk_setup - Setup function for simple mux rate clock
200169
* @node: DT node for the clock

0 commit comments

Comments
 (0)