hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/clk/ti/gate.c
....@@ -33,6 +33,7 @@
3333 .init = &omap2_init_clk_clkdm,
3434 .enable = &omap2_clkops_enable_clkdm,
3535 .disable = &omap2_clkops_disable_clkdm,
36
+ .restore_context = clk_gate_restore_context,
3637 };
3738
3839 const struct clk_ops omap_gate_clk_ops = {
....@@ -40,6 +41,7 @@
4041 .enable = &omap2_dflt_clk_enable,
4142 .disable = &omap2_dflt_clk_disable,
4243 .is_enabled = &omap2_dflt_clk_is_enabled,
44
+ .restore_context = clk_gate_restore_context,
4345 };
4446
4547 static const struct clk_ops omap_gate_clk_hsdiv_restore_ops = {
....@@ -47,6 +49,7 @@
4749 .enable = &omap36xx_gate_clk_enable_with_hsdiv_restore,
4850 .disable = &omap2_dflt_clk_disable,
4951 .is_enabled = &omap2_dflt_clk_is_enabled,
52
+ .restore_context = clk_gate_restore_context,
5053 };
5154
5255 /**
....@@ -120,42 +123,12 @@
120123
121124 init.flags = flags;
122125
123
- clk = ti_clk_register(NULL, &clk_hw->hw, name);
126
+ clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name);
124127
125128 if (IS_ERR(clk))
126129 kfree(clk_hw);
127130
128131 return clk;
129
-}
130
-
131
-struct clk_hw *ti_clk_build_component_gate(struct ti_clk_gate *setup)
132
-{
133
- struct clk_hw_omap *gate;
134
- struct clk_omap_reg *reg;
135
- const struct clk_hw_omap_ops *ops = &clkhwops_wait;
136
-
137
- if (!setup)
138
- return NULL;
139
-
140
- gate = kzalloc(sizeof(*gate), GFP_KERNEL);
141
- if (!gate)
142
- return ERR_PTR(-ENOMEM);
143
-
144
- reg = (struct clk_omap_reg *)&gate->enable_reg;
145
- reg->index = setup->module;
146
- reg->offset = setup->reg;
147
-
148
- gate->enable_bit = setup->bit_shift;
149
-
150
- if (setup->flags & CLKF_NO_WAIT)
151
- ops = NULL;
152
-
153
- if (setup->flags & CLKF_INTERFACE)
154
- ops = &clkhwops_iclk_wait;
155
-
156
- gate->ops = ops;
157
-
158
- return &gate->hw;
159132 }
160133
161134 static void __init _of_ti_gate_clk_setup(struct device_node *node,
....@@ -179,7 +152,7 @@
179152 }
180153
181154 if (of_clk_get_parent_count(node) != 1) {
182
- pr_err("%s must have 1 parent\n", node->name);
155
+ pr_err("%pOFn must have 1 parent\n", node);
183156 return;
184157 }
185158