Lines Matching refs:ctx

25 	struct clk_dummy_context *ctx =
28 return ctx->rate;
68 struct clk_dummy_context *ctx =
71 ctx->rate = rate;
136 struct clk_multiple_parent_ctx *ctx =
142 ctx->current_parent = index;
149 struct clk_multiple_parent_ctx *ctx =
152 return ctx->current_parent;
169 struct clk_dummy_context *ctx;
173 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
174 if (!ctx)
176 ctx->rate = DUMMY_CLOCK_INIT_RATE;
177 test->priv = ctx;
181 ctx->hw.init = &init;
183 ret = clk_hw_register(NULL, &ctx->hw);
207 struct clk_dummy_context *ctx = test->priv;
209 clk_hw_unregister(&ctx->hw);
217 struct clk_dummy_context *ctx = test->priv;
218 struct clk_hw *hw = &ctx->hw;
224 KUNIT_EXPECT_EQ(test, rate, ctx->rate);
238 struct clk_dummy_context *ctx = test->priv;
239 struct clk_hw *hw = &ctx->hw;
263 struct clk_dummy_context *ctx = test->priv;
264 struct clk_hw *hw = &ctx->hw;
289 struct clk_dummy_context *ctx = test->priv;
290 struct clk_hw *hw = &ctx->hw;
332 struct clk_dummy_context *ctx;
335 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
336 if (!ctx)
338 test->priv = ctx;
340 ctx->rate = DUMMY_CLOCK_INIT_RATE;
341 ctx->hw.init = CLK_HW_INIT_NO_PARENT("test-clk",
345 ret = clk_hw_register(NULL, &ctx->hw);
359 struct clk_dummy_context *ctx = test->priv;
360 struct clk_hw *hw = &ctx->hw;
369 ctx->rate = DUMMY_CLOCK_RATE_1;
383 struct clk_dummy_context *ctx = test->priv;
384 struct clk_hw *hw = &ctx->hw;
412 struct clk_dummy_context *ctx = test->priv;
413 struct clk_hw *hw = &ctx->hw;
418 ctx->rate = DUMMY_CLOCK_RATE_1 + 1000;
454 struct clk_multiple_parent_ctx *ctx;
458 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
459 if (!ctx)
461 test->priv = ctx;
463 ctx->parents_ctx[0].hw.init = CLK_HW_INIT_NO_PARENT("parent-0",
466 ctx->parents_ctx[0].rate = DUMMY_CLOCK_RATE_1;
467 ret = clk_hw_register(NULL, &ctx->parents_ctx[0].hw);
471 ctx->parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("parent-1",
474 ctx->parents_ctx[1].rate = DUMMY_CLOCK_RATE_2;
475 ret = clk_hw_register(NULL, &ctx->parents_ctx[1].hw);
479 ctx->current_parent = 0;
480 ctx->hw.init = CLK_HW_INIT_PARENTS("test-mux", parents,
483 ret = clk_hw_register(NULL, &ctx->hw);
493 struct clk_multiple_parent_ctx *ctx = test->priv;
495 clk_hw_unregister(&ctx->hw);
496 clk_hw_unregister(&ctx->parents_ctx[0].hw);
497 clk_hw_unregister(&ctx->parents_ctx[1].hw);
507 struct clk_multiple_parent_ctx *ctx = test->priv;
508 struct clk_hw *hw = &ctx->hw;
510 struct clk *parent = clk_hw_get_clk(&ctx->parents_ctx[0].hw, NULL);
525 struct clk_multiple_parent_ctx *ctx = test->priv;
526 struct clk_hw *hw = &ctx->hw;
530 parent = clk_hw_get_clk(&ctx->parents_ctx[0].hw, NULL);
534 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
553 struct clk_multiple_parent_ctx *ctx = test->priv;
554 struct clk_hw *hw = &ctx->hw;
562 parent1 = clk_hw_get_clk(&ctx->parents_ctx[0].hw, NULL);
566 parent2 = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
618 struct clk_multiple_parent_ctx *ctx;
622 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
623 if (!ctx)
625 test->priv = ctx;
627 ctx->parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("proper-parent",
630 ctx->parents_ctx[1].rate = DUMMY_CLOCK_INIT_RATE;
631 ret = clk_hw_register(NULL, &ctx->parents_ctx[1].hw);
635 ctx->hw.init = CLK_HW_INIT_PARENTS("test-orphan-mux", parents,
638 ret = clk_hw_register(NULL, &ctx->hw);
648 struct clk_multiple_parent_ctx *ctx = test->priv;
650 clk_hw_unregister(&ctx->hw);
651 clk_hw_unregister(&ctx->parents_ctx[1].hw);
661 struct clk_multiple_parent_ctx *ctx = test->priv;
662 struct clk_hw *hw = &ctx->hw;
678 struct clk_multiple_parent_ctx *ctx = test->priv;
679 struct clk_hw *hw = &ctx->hw;
684 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
706 struct clk_multiple_parent_ctx *ctx = test->priv;
707 struct clk_hw *hw = &ctx->hw;
713 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
740 struct clk_multiple_parent_ctx *ctx = test->priv;
741 struct clk_hw *hw = &ctx->hw;
747 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
771 struct clk_multiple_parent_ctx *ctx = test->priv;
776 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
779 clk = clk_hw_get_clk(&ctx->hw, NULL);
805 struct clk_multiple_parent_ctx *ctx = test->priv;
806 struct clk_hw *hw = &ctx->hw;
812 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
838 struct clk_multiple_parent_ctx *ctx = test->priv;
839 struct clk_hw *hw = &ctx->hw;
845 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
875 struct clk_multiple_parent_ctx *ctx = test->priv;
876 struct clk_hw *hw = &ctx->hw;
904 struct clk_multiple_parent_ctx *ctx = test->priv;
905 struct clk_hw *hw = &ctx->hw;
915 parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
966 struct clk_single_parent_ctx *ctx;
969 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
970 if (!ctx)
972 test->priv = ctx;
974 ctx->parent_ctx.rate = DUMMY_CLOCK_INIT_RATE;
975 ctx->parent_ctx.hw.init =
980 ret = clk_hw_register(NULL, &ctx->parent_ctx.hw);
984 ctx->hw.init = CLK_HW_INIT("test-clk", "parent-clk",
988 ret = clk_hw_register(NULL, &ctx->hw);
998 struct clk_single_parent_ctx *ctx = test->priv;
1000 clk_hw_unregister(&ctx->hw);
1001 clk_hw_unregister(&ctx->parent_ctx.hw);
1011 struct clk_single_parent_ctx *ctx = test->priv;
1012 struct clk_hw *hw = &ctx->hw;
1014 struct clk *parent = clk_hw_get_clk(&ctx->parent_ctx.hw, NULL);
1029 struct clk_single_parent_ctx *ctx = test->priv;
1030 struct clk_hw *hw = &ctx->hw;
1032 struct clk *parent = clk_hw_get_clk(&ctx->parent_ctx.hw, NULL);
1052 struct clk_single_parent_ctx *ctx = test->priv;
1053 struct clk_hw *hw = &ctx->hw;
1084 struct clk_single_parent_ctx *ctx = test->priv;
1085 struct clk_hw *hw = &ctx->hw;
1113 struct clk_single_parent_ctx *ctx = test->priv;
1114 struct clk_hw *hw = &ctx->hw;
1143 struct clk_single_parent_ctx *ctx = test->priv;
1144 struct clk_hw *hw = &ctx->hw;
1181 struct clk_single_parent_ctx *ctx = test->priv;
1182 struct clk_hw *hw = &ctx->hw;
1238 struct clk_single_parent_ctx *ctx;
1243 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
1244 if (!ctx)
1246 test->priv = ctx;
1253 ctx->hw.init = &init;
1255 ret = clk_hw_register(NULL, &ctx->hw);
1262 ctx->parent_ctx.hw.init = &init;
1263 ctx->parent_ctx.rate = DUMMY_CLOCK_INIT_RATE;
1265 ret = clk_hw_register(NULL, &ctx->parent_ctx.hw);
1281 struct clk_single_parent_ctx *ctx = test->priv;
1282 struct clk_hw *hw = &ctx->hw;
1291 ctx->parent_ctx.rate - 1000,
1292 ctx->parent_ctx.rate + 1000),
1331 struct clk_single_parent_two_lvl_ctx *ctx;
1334 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
1335 if (!ctx)
1337 test->priv = ctx;
1339 ctx->parent_ctx.hw.init =
1344 ret = clk_hw_register(NULL, &ctx->parent_ctx.hw);
1348 ctx->hw.init =
1352 ret = clk_hw_register(NULL, &ctx->hw);
1356 ctx->parent_parent_ctx.rate = DUMMY_CLOCK_INIT_RATE;
1357 ctx->parent_parent_ctx.hw.init =
1361 ret = clk_hw_register(NULL, &ctx->parent_parent_ctx.hw);
1371 struct clk_single_parent_two_lvl_ctx *ctx = test->priv;
1373 clk_hw_unregister(&ctx->hw);
1374 clk_hw_unregister(&ctx->parent_ctx.hw);
1375 clk_hw_unregister(&ctx->parent_parent_ctx.hw);
1385 struct clk_single_parent_two_lvl_ctx *ctx = test->priv;
1386 struct clk_hw *hw = &ctx->hw;
1407 struct clk_single_parent_two_lvl_ctx *ctx = test->priv;
1408 struct clk_hw *hw = &ctx->hw;
1459 struct clk_dummy_context *ctx = test->priv;
1460 struct clk_hw *hw = &ctx->hw;
1484 struct clk_dummy_context *ctx = test->priv;
1485 struct clk_hw *hw = &ctx->hw;
1503 struct clk_dummy_context *ctx = test->priv;
1504 struct clk_hw *hw = &ctx->hw;
1531 struct clk_dummy_context *ctx = test->priv;
1532 struct clk_hw *hw = &ctx->hw;
1556 struct clk_dummy_context *ctx = test->priv;
1557 struct clk_hw *hw = &ctx->hw;
1587 struct clk_dummy_context *ctx = test->priv;
1588 struct clk_hw *hw = &ctx->hw;
1616 struct clk_dummy_context *ctx = test->priv;
1617 struct clk_hw *hw = &ctx->hw;
1641 struct clk_dummy_context *ctx = test->priv;
1642 struct clk_hw *hw = &ctx->hw;
1672 struct clk_dummy_context *ctx = test->priv;
1673 struct clk_hw *hw = &ctx->hw;
1705 struct clk_dummy_context *ctx = test->priv;
1706 struct clk_hw *hw = &ctx->hw;
1737 struct clk_dummy_context *ctx = test->priv;
1738 struct clk_hw *hw = &ctx->hw;
1797 struct clk_dummy_context *ctx = test->priv;
1798 struct clk_hw *hw = &ctx->hw;
1849 struct clk_dummy_context *ctx = test->priv;
1850 struct clk_hw *hw = &ctx->hw;
1908 struct clk_dummy_context *ctx = test->priv;
1909 struct clk_hw *hw = &ctx->hw;
1985 struct clk_dummy_context *ctx = test->priv;
1986 struct clk_hw *hw = &ctx->hw;
2037 struct clk_dummy_context *ctx = test->priv;
2038 struct clk_hw *hw = &ctx->hw;
2092 struct clk_dummy_context *ctx = test->priv;
2093 struct clk_hw *hw = &ctx->hw;
2163 struct clk_leaf_mux_ctx *ctx;
2167 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
2168 if (!ctx)
2170 test->priv = ctx;
2172 ctx->mux_ctx.parents_ctx[0].hw.init = CLK_HW_INIT_NO_PARENT("parent-0",
2175 ctx->mux_ctx.parents_ctx[0].rate = DUMMY_CLOCK_RATE_1;
2176 ret = clk_hw_register(NULL, &ctx->mux_ctx.parents_ctx[0].hw);
2180 ctx->mux_ctx.parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("parent-1",
2183 ctx->mux_ctx.parents_ctx[1].rate = DUMMY_CLOCK_RATE_2;
2184 ret = clk_hw_register(NULL, &ctx->mux_ctx.parents_ctx[1].hw);
2188 ctx->mux_ctx.current_parent = 0;
2189 ctx->mux_ctx.hw.init = CLK_HW_INIT_PARENTS("test-mux", top_parents,
2192 ret = clk_hw_register(NULL, &ctx->mux_ctx.hw);
2196 ctx->hw.init = CLK_HW_INIT_HW("test-clock", &ctx->mux_ctx.hw,
2199 ret = clk_hw_register(NULL, &ctx->hw);
2208 struct clk_leaf_mux_ctx *ctx = test->priv;
2210 clk_hw_unregister(&ctx->hw);
2211 clk_hw_unregister(&ctx->mux_ctx.hw);
2212 clk_hw_unregister(&ctx->mux_ctx.parents_ctx[0].hw);
2213 clk_hw_unregister(&ctx->mux_ctx.parents_ctx[1].hw);
2223 struct clk_leaf_mux_ctx *ctx = test->priv;
2224 struct clk_hw *hw = &ctx->hw;
2240 KUNIT_EXPECT_PTR_EQ(test, req.best_parent_hw, &ctx->mux_ctx.hw);
2287 struct clk_mux_notifier_ctx *ctx = container_of(nb,
2292 ctx->pre_rate_change.old_rate = clk_data->old_rate;
2293 ctx->pre_rate_change.new_rate = clk_data->new_rate;
2294 ctx->pre_rate_change.done = true;
2295 wake_up_interruptible(&ctx->pre_rate_change.wq);
2299 ctx->post_rate_change.old_rate = clk_data->old_rate;
2300 ctx->post_rate_change.new_rate = clk_data->new_rate;
2301 ctx->post_rate_change.done = true;
2302 wake_up_interruptible(&ctx->post_rate_change.wq);
2310 struct clk_mux_notifier_ctx *ctx;
2314 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
2315 if (!ctx)
2317 test->priv = ctx;
2318 ctx->clk_nb.notifier_call = clk_mux_notifier_callback;
2319 init_waitqueue_head(&ctx->pre_rate_change.wq);
2320 init_waitqueue_head(&ctx->post_rate_change.wq);
2322 ctx->mux_ctx.parents_ctx[0].hw.init = CLK_HW_INIT_NO_PARENT("parent-0",
2325 ctx->mux_ctx.parents_ctx[0].rate = DUMMY_CLOCK_RATE_1;
2326 ret = clk_hw_register(NULL, &ctx->mux_ctx.parents_ctx[0].hw);
2330 ctx->mux_ctx.parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("parent-1",
2333 ctx->mux_ctx.parents_ctx[1].rate = DUMMY_CLOCK_RATE_2;
2334 ret = clk_hw_register(NULL, &ctx->mux_ctx.parents_ctx[1].hw);
2338 ctx->mux_ctx.current_parent = 0;
2339 ctx->mux_ctx.hw.init = CLK_HW_INIT_PARENTS("test-mux", top_parents,
2342 ret = clk_hw_register(NULL, &ctx->mux_ctx.hw);
2346 ctx->clk = clk_hw_get_clk(&ctx->mux_ctx.hw, NULL);
2347 ret = clk_notifier_register(ctx->clk, &ctx->clk_nb);
2356 struct clk_mux_notifier_ctx *ctx = test->priv;
2357 struct clk *clk = ctx->clk;
2359 clk_notifier_unregister(clk, &ctx->clk_nb);
2362 clk_hw_unregister(&ctx->mux_ctx.hw);
2363 clk_hw_unregister(&ctx->mux_ctx.parents_ctx[0].hw);
2364 clk_hw_unregister(&ctx->mux_ctx.parents_ctx[1].hw);
2374 struct clk_mux_notifier_ctx *ctx = test->priv;
2375 struct clk_hw *hw = &ctx->mux_ctx.hw;
2377 struct clk *new_parent = clk_hw_get_clk(&ctx->mux_ctx.parents_ctx[1].hw, NULL);
2383 ret = wait_event_interruptible_timeout(ctx->pre_rate_change.wq,
2384 ctx->pre_rate_change.done,
2388 KUNIT_EXPECT_EQ(test, ctx->pre_rate_change.old_rate, DUMMY_CLOCK_RATE_1);
2389 KUNIT_EXPECT_EQ(test, ctx->pre_rate_change.new_rate, DUMMY_CLOCK_RATE_2);
2391 ret = wait_event_interruptible_timeout(ctx->post_rate_change.wq,
2392 ctx->post_rate_change.done,
2396 KUNIT_EXPECT_EQ(test, ctx->post_rate_change.old_rate, DUMMY_CLOCK_RATE_1);
2397 KUNIT_EXPECT_EQ(test, ctx->post_rate_change.new_rate, DUMMY_CLOCK_RATE_2);
2424 struct clk_multiple_parent_ctx *ctx;
2428 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL);
2429 if (!ctx)
2431 test->priv = ctx;
2433 ctx->parents_ctx[0].hw.init = CLK_HW_INIT_NO_PARENT("parent-0",
2436 ctx->parents_ctx[0].rate = DUMMY_CLOCK_RATE_1;
2437 ret = clk_hw_register(NULL, &ctx->parents_ctx[0].hw);
2441 ctx->parents_ctx[1].hw.init = CLK_HW_INIT_NO_PARENT("parent-1",
2444 ctx->parents_ctx[1].rate = DUMMY_CLOCK_RATE_2;
2445 ret = clk_hw_register(NULL, &ctx->parents_ctx[1].hw);
2449 ctx->current_parent = 0;
2450 ctx->hw.init = CLK_HW_INIT_PARENTS("test-mux", parents,
2453 ret = clk_hw_register(NULL, &ctx->hw);
2463 struct clk_multiple_parent_ctx *ctx = test->priv;
2465 clk_hw_unregister(&ctx->hw);
2466 clk_hw_unregister(&ctx->parents_ctx[0].hw);
2467 clk_hw_unregister(&ctx->parents_ctx[1].hw);
2477 struct clk_multiple_parent_ctx *ctx = test->priv;
2478 struct clk_hw *hw = &ctx->hw;
2491 other_parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);
2513 struct clk_multiple_parent_ctx *ctx = test->priv;
2514 struct clk_hw *hw = &ctx->hw;
2528 other_parent = clk_hw_get_clk(&ctx->parents_ctx[1].hw, NULL);