Lines Matching refs:xvcu

524 static int xvcu_register_clock_provider(struct xvcu_device *xvcu)
526 struct device *dev = xvcu->dev;
531 void __iomem *reg_base = xvcu->vcu_slcr_ba;
539 xvcu->clk_data = data;
542 "vcu_pll", __clk_get_name(xvcu->pll_ref),
546 xvcu->pll = hw;
548 hw = xvcu_register_pll_post(dev, "vcu_pll_post", xvcu->pll, reg_base);
551 xvcu->pll_post = hw;
554 parent_data[1].hw = xvcu->pll_post;
580 static void xvcu_unregister_clock_provider(struct xvcu_device *xvcu)
582 struct clk_hw_onecell_data *data = xvcu->clk_data;
593 if (!IS_ERR_OR_NULL(xvcu->pll_post))
594 clk_hw_unregister_fixed_factor(xvcu->pll_post);
609 struct xvcu_device *xvcu;
613 xvcu = devm_kzalloc(&pdev->dev, sizeof(*xvcu), GFP_KERNEL);
614 if (!xvcu)
617 xvcu->dev = &pdev->dev;
624 xvcu->vcu_slcr_ba = devm_ioremap(&pdev->dev, res->start,
626 if (!xvcu->vcu_slcr_ba) {
631 xvcu->logicore_reg_ba =
633 if (IS_ERR(xvcu->logicore_reg_ba)) {
650 xvcu->logicore_reg_ba =
653 if (IS_ERR(xvcu->logicore_reg_ba)) {
655 return PTR_ERR(xvcu->logicore_reg_ba);
659 xvcu->aclk = devm_clk_get(&pdev->dev, "aclk");
660 if (IS_ERR(xvcu->aclk)) {
662 return PTR_ERR(xvcu->aclk);
665 xvcu->pll_ref = devm_clk_get(&pdev->dev, "pll_ref");
666 if (IS_ERR(xvcu->pll_ref)) {
668 return PTR_ERR(xvcu->pll_ref);
671 ret = clk_prepare_enable(xvcu->aclk);
682 xvcu->reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset",
684 if (IS_ERR(xvcu->reset_gpio)) {
685 ret = PTR_ERR(xvcu->reset_gpio);
690 if (xvcu->reset_gpio) {
691 gpiod_set_value(xvcu->reset_gpio, 0);
694 gpiod_set_value(xvcu->reset_gpio, 1);
700 regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, VCU_GASKET_VALUE);
702 ret = xvcu_register_clock_provider(xvcu);
708 dev_set_drvdata(&pdev->dev, xvcu);
713 xvcu_unregister_clock_provider(xvcu);
715 clk_disable_unprepare(xvcu->aclk);
729 struct xvcu_device *xvcu;
731 xvcu = platform_get_drvdata(pdev);
733 xvcu_unregister_clock_provider(xvcu);
736 if (xvcu->reset_gpio) {
737 gpiod_set_value(xvcu->reset_gpio, 0);
740 gpiod_set_value(xvcu->reset_gpio, 1);
743 regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, 0);
745 clk_disable_unprepare(xvcu->aclk);