Lines Matching refs:mcd
409 const struct mtk_clk_divider *mcd = &mcds[i]; in mtk_clk_register_dividers() local
411 if (!IS_ERR_OR_NULL(clk_data->hws[mcd->id])) { in mtk_clk_register_dividers()
413 mcd->id); in mtk_clk_register_dividers()
417 hw = clk_hw_register_divider(dev, mcd->name, mcd->parent_name, in mtk_clk_register_dividers()
418 mcd->flags, base + mcd->div_reg, mcd->div_shift, in mtk_clk_register_dividers()
419 mcd->div_width, mcd->clk_divider_flags, lock); in mtk_clk_register_dividers()
422 pr_err("Failed to register clk %s: %pe\n", mcd->name, in mtk_clk_register_dividers()
427 clk_data->hws[mcd->id] = hw; in mtk_clk_register_dividers()
434 const struct mtk_clk_divider *mcd = &mcds[i]; in mtk_clk_register_dividers() local
436 if (IS_ERR_OR_NULL(clk_data->hws[mcd->id])) in mtk_clk_register_dividers()
439 clk_hw_unregister_divider(clk_data->hws[mcd->id]); in mtk_clk_register_dividers()
440 clk_data->hws[mcd->id] = ERR_PTR(-ENOENT); in mtk_clk_register_dividers()
456 const struct mtk_clk_divider *mcd = &mcds[i - 1]; in mtk_clk_unregister_dividers() local
458 if (IS_ERR_OR_NULL(clk_data->hws[mcd->id])) in mtk_clk_unregister_dividers()
461 clk_hw_unregister_divider(clk_data->hws[mcd->id]); in mtk_clk_unregister_dividers()
462 clk_data->hws[mcd->id] = ERR_PTR(-ENOENT); in mtk_clk_unregister_dividers()
471 const struct mtk_clk_desc *mcd; in __mtk_clk_simple_probe() local
476 mcd = device_get_match_data(&pdev->dev); in __mtk_clk_simple_probe()
477 if (!mcd) { in __mtk_clk_simple_probe()
481 mcd = (const struct mtk_clk_desc *)id->driver_data; in __mtk_clk_simple_probe()
483 if (!mcd) in __mtk_clk_simple_probe()
488 if (mcd->composite_clks || mcd->divider_clks) { in __mtk_clk_simple_probe()
489 if (!mcd->shared_io) in __mtk_clk_simple_probe()
499 if (mcd->need_runtime_pm) { in __mtk_clk_simple_probe()
511 num_clks = mcd->num_clks + mcd->num_composite_clks; in __mtk_clk_simple_probe()
512 num_clks += mcd->num_fixed_clks + mcd->num_factor_clks; in __mtk_clk_simple_probe()
513 num_clks += mcd->num_mux_clks + mcd->num_divider_clks; in __mtk_clk_simple_probe()
521 if (mcd->fixed_clks) { in __mtk_clk_simple_probe()
522 r = mtk_clk_register_fixed_clks(mcd->fixed_clks, in __mtk_clk_simple_probe()
523 mcd->num_fixed_clks, clk_data); in __mtk_clk_simple_probe()
528 if (mcd->factor_clks) { in __mtk_clk_simple_probe()
529 r = mtk_clk_register_factors(mcd->factor_clks, in __mtk_clk_simple_probe()
530 mcd->num_factor_clks, clk_data); in __mtk_clk_simple_probe()
535 if (mcd->mux_clks) { in __mtk_clk_simple_probe()
536 r = mtk_clk_register_muxes(&pdev->dev, mcd->mux_clks, in __mtk_clk_simple_probe()
537 mcd->num_mux_clks, node, in __mtk_clk_simple_probe()
538 mcd->clk_lock, clk_data); in __mtk_clk_simple_probe()
543 if (mcd->composite_clks) { in __mtk_clk_simple_probe()
546 mcd->composite_clks, in __mtk_clk_simple_probe()
547 mcd->num_composite_clks, in __mtk_clk_simple_probe()
548 base, mcd->clk_lock, clk_data); in __mtk_clk_simple_probe()
553 if (mcd->divider_clks) { in __mtk_clk_simple_probe()
555 mcd->divider_clks, in __mtk_clk_simple_probe()
556 mcd->num_divider_clks, in __mtk_clk_simple_probe()
557 base, mcd->clk_lock, clk_data); in __mtk_clk_simple_probe()
562 if (mcd->clks) { in __mtk_clk_simple_probe()
563 r = mtk_clk_register_gates(&pdev->dev, node, mcd->clks, in __mtk_clk_simple_probe()
564 mcd->num_clks, clk_data); in __mtk_clk_simple_probe()
569 if (mcd->clk_notifier_func) { in __mtk_clk_simple_probe()
570 struct clk *mfg_mux = clk_data->hws[mcd->mfg_clk_idx]->clk; in __mtk_clk_simple_probe()
572 r = mcd->clk_notifier_func(&pdev->dev, mfg_mux); in __mtk_clk_simple_probe()
583 if (mcd->rst_desc) { in __mtk_clk_simple_probe()
585 mcd->rst_desc); in __mtk_clk_simple_probe()
590 if (mcd->need_runtime_pm) in __mtk_clk_simple_probe()
596 if (mcd->clks) in __mtk_clk_simple_probe()
597 mtk_clk_unregister_gates(mcd->clks, mcd->num_clks, clk_data); in __mtk_clk_simple_probe()
599 if (mcd->divider_clks) in __mtk_clk_simple_probe()
600 mtk_clk_unregister_dividers(mcd->divider_clks, in __mtk_clk_simple_probe()
601 mcd->num_divider_clks, clk_data); in __mtk_clk_simple_probe()
603 if (mcd->composite_clks) in __mtk_clk_simple_probe()
604 mtk_clk_unregister_composites(mcd->composite_clks, in __mtk_clk_simple_probe()
605 mcd->num_composite_clks, clk_data); in __mtk_clk_simple_probe()
607 if (mcd->mux_clks) in __mtk_clk_simple_probe()
608 mtk_clk_unregister_muxes(mcd->mux_clks, in __mtk_clk_simple_probe()
609 mcd->num_mux_clks, clk_data); in __mtk_clk_simple_probe()
611 if (mcd->factor_clks) in __mtk_clk_simple_probe()
612 mtk_clk_unregister_factors(mcd->factor_clks, in __mtk_clk_simple_probe()
613 mcd->num_factor_clks, clk_data); in __mtk_clk_simple_probe()
615 if (mcd->fixed_clks) in __mtk_clk_simple_probe()
616 mtk_clk_unregister_fixed_clks(mcd->fixed_clks, in __mtk_clk_simple_probe()
617 mcd->num_fixed_clks, clk_data); in __mtk_clk_simple_probe()
621 if (mcd->shared_io && base) in __mtk_clk_simple_probe()
624 if (mcd->need_runtime_pm) in __mtk_clk_simple_probe()
633 const struct mtk_clk_desc *mcd = device_get_match_data(&pdev->dev); in __mtk_clk_simple_remove() local
636 if (mcd->clks) in __mtk_clk_simple_remove()
637 mtk_clk_unregister_gates(mcd->clks, mcd->num_clks, clk_data); in __mtk_clk_simple_remove()
638 if (mcd->divider_clks) in __mtk_clk_simple_remove()
639 mtk_clk_unregister_dividers(mcd->divider_clks, in __mtk_clk_simple_remove()
640 mcd->num_divider_clks, clk_data); in __mtk_clk_simple_remove()
641 if (mcd->composite_clks) in __mtk_clk_simple_remove()
642 mtk_clk_unregister_composites(mcd->composite_clks, in __mtk_clk_simple_remove()
643 mcd->num_composite_clks, clk_data); in __mtk_clk_simple_remove()
644 if (mcd->mux_clks) in __mtk_clk_simple_remove()
645 mtk_clk_unregister_muxes(mcd->mux_clks, in __mtk_clk_simple_remove()
646 mcd->num_mux_clks, clk_data); in __mtk_clk_simple_remove()
647 if (mcd->factor_clks) in __mtk_clk_simple_remove()
648 mtk_clk_unregister_factors(mcd->factor_clks, in __mtk_clk_simple_remove()
649 mcd->num_factor_clks, clk_data); in __mtk_clk_simple_remove()
650 if (mcd->fixed_clks) in __mtk_clk_simple_remove()
651 mtk_clk_unregister_fixed_clks(mcd->fixed_clks, in __mtk_clk_simple_remove()
652 mcd->num_fixed_clks, clk_data); in __mtk_clk_simple_remove()