Lines Matching refs:err

181 	int err;  in mtk_pcie_check_cfg_cpld()  local
183 err = readl_poll_timeout(port->base + PCIE_APP_TLP_REQ, val, in mtk_pcie_check_cfg_cpld()
185 if (err) in mtk_pcie_check_cfg_cpld()
335 int err; in mtk_pcie_startup_port() local
343 err = readl_poll_timeout(port->base + PCIE_LINK_STATUS, val, in mtk_pcie_startup_port()
345 if (err) in mtk_pcie_startup_port()
379 int err; in mtk_pcie_startup_port_v2() local
417 err = readl_poll_timeout(port->base + PCIE_LINK_STATUS_V2, val, in mtk_pcie_startup_port_v2()
420 if (err) in mtk_pcie_startup_port_v2()
442 int err; in mtk_pcie_enable_port() local
444 err = clk_enable(&port->sys_ck); in mtk_pcie_enable_port()
445 if (err) in mtk_pcie_enable_port()
448 err = reset_assert(&port->reset); in mtk_pcie_enable_port()
449 if (err) in mtk_pcie_enable_port()
452 err = reset_deassert(&port->reset); in mtk_pcie_enable_port()
453 if (err) in mtk_pcie_enable_port()
456 err = generic_phy_init(&port->phy); in mtk_pcie_enable_port()
457 if (err) in mtk_pcie_enable_port()
460 err = generic_phy_power_on(&port->phy); in mtk_pcie_enable_port()
461 if (err) in mtk_pcie_enable_port()
481 int err = 0; in mtk_pcie_enable_port_v2() local
483 err = clk_enable(&port->sys_ck); in mtk_pcie_enable_port_v2()
484 if (err) { in mtk_pcie_enable_port_v2()
485 debug("clk_enable(sys_ck) failed: %d\n", err); in mtk_pcie_enable_port_v2()
489 err = clk_enable(&port->ahb_ck); in mtk_pcie_enable_port_v2()
490 if (err) { in mtk_pcie_enable_port_v2()
491 debug("clk_enable(ahb_ck) failed: %d\n", err); in mtk_pcie_enable_port_v2()
495 err = clk_enable(&port->aux_ck); in mtk_pcie_enable_port_v2()
496 if (err) { in mtk_pcie_enable_port_v2()
497 debug("clk_enable(aux_ck) failed: %d\n", err); in mtk_pcie_enable_port_v2()
501 err = clk_enable(&port->axi_ck); in mtk_pcie_enable_port_v2()
502 if (err) { in mtk_pcie_enable_port_v2()
503 debug("clk_enable(axi_ck) failed: %d\n", err); in mtk_pcie_enable_port_v2()
507 err = clk_enable(&port->obff_ck); in mtk_pcie_enable_port_v2()
508 if (err) { in mtk_pcie_enable_port_v2()
509 debug("clk_enable(obff_ck) failed: %d\n", err); in mtk_pcie_enable_port_v2()
513 err = clk_enable(&port->pipe_ck); in mtk_pcie_enable_port_v2()
514 if (err) { in mtk_pcie_enable_port_v2()
515 debug("clk_enable(pipe_ck) failed: %d\n", err); in mtk_pcie_enable_port_v2()
519 err = mtk_pcie_startup_port_v2(port); in mtk_pcie_enable_port_v2()
520 if (!err) in mtk_pcie_enable_port_v2()
533 int err; in mtk_pcie_parse_port() local
545 err = clk_get_by_name(dev, name, &port->sys_ck); in mtk_pcie_parse_port()
546 if (err) in mtk_pcie_parse_port()
547 return err; in mtk_pcie_parse_port()
549 err = reset_get_by_index(dev, slot, &port->reset); in mtk_pcie_parse_port()
550 if (err) in mtk_pcie_parse_port()
551 return err; in mtk_pcie_parse_port()
553 err = generic_phy_get_by_index(dev, slot, &port->phy); in mtk_pcie_parse_port()
554 if (err) in mtk_pcie_parse_port()
555 return err; in mtk_pcie_parse_port()
571 int err; in mtk_pcie_parse_port_v2() local
585 err = clk_get_by_name(dev, name, &port->sys_ck); in mtk_pcie_parse_port_v2()
586 if (err) { in mtk_pcie_parse_port_v2()
587 debug("clk_get_by_name(sys_ck) failed: %d\n", err); in mtk_pcie_parse_port_v2()
588 return err; in mtk_pcie_parse_port_v2()
592 err = clk_get_by_name(dev, name, &port->ahb_ck); in mtk_pcie_parse_port_v2()
593 if (err) { in mtk_pcie_parse_port_v2()
594 debug("clk_get_by_name(ahb_ck) failed: %d\n", err); in mtk_pcie_parse_port_v2()
595 return err; in mtk_pcie_parse_port_v2()
599 err = clk_get_by_name(dev, name, &port->aux_ck); in mtk_pcie_parse_port_v2()
600 if (err) { in mtk_pcie_parse_port_v2()
601 debug("clk_get_by_name(aux_ck) failed: %d\n", err); in mtk_pcie_parse_port_v2()
602 return err; in mtk_pcie_parse_port_v2()
606 err = clk_get_by_name(dev, name, &port->axi_ck); in mtk_pcie_parse_port_v2()
607 if (err) { in mtk_pcie_parse_port_v2()
608 debug("clk_get_by_name(axi_ck) failed: %d\n", err); in mtk_pcie_parse_port_v2()
609 return err; in mtk_pcie_parse_port_v2()
613 err = clk_get_by_name(dev, name, &port->obff_ck); in mtk_pcie_parse_port_v2()
614 if (err) { in mtk_pcie_parse_port_v2()
615 debug("clk_get_by_name(obff_ck) failed: %d\n", err); in mtk_pcie_parse_port_v2()
616 return err; in mtk_pcie_parse_port_v2()
620 err = clk_get_by_name(dev, name, &port->pipe_ck); in mtk_pcie_parse_port_v2()
621 if (err) { in mtk_pcie_parse_port_v2()
622 debug("clk_get_by_name(pipe_ck) failed: %d\n", err); in mtk_pcie_parse_port_v2()
623 return err; in mtk_pcie_parse_port_v2()
640 int err; in mtk_pcie_probe() local
648 err = clk_get_by_name(dev, "free_ck", &pcie->free_ck); in mtk_pcie_probe()
649 if (err) in mtk_pcie_probe()
650 return err; in mtk_pcie_probe()
653 err = clk_enable(&pcie->free_ck); in mtk_pcie_probe()
654 if (err) in mtk_pcie_probe()
655 return err; in mtk_pcie_probe()
664 err = ofnode_read_pci_addr(subnode, 0, "reg", &addr); in mtk_pcie_probe()
665 if (err) in mtk_pcie_probe()
666 return err; in mtk_pcie_probe()
670 err = mtk_pcie_parse_port(dev, slot); in mtk_pcie_probe()
671 if (err) in mtk_pcie_probe()
672 return err; in mtk_pcie_probe()
689 int err; in mtk_pcie_probe_v2() local
703 err = ofnode_read_pci_addr(subnode, 0, "reg", &addr); in mtk_pcie_probe_v2()
704 if (err) in mtk_pcie_probe_v2()
705 return err; in mtk_pcie_probe_v2()
708 err = mtk_pcie_parse_port_v2(dev, slot); in mtk_pcie_probe_v2()
709 if (err) in mtk_pcie_probe_v2()
710 return err; in mtk_pcie_probe_v2()