MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mtk_pcie_phy_stop

Function mtk_pcie_phy_stop

freebsd/mips/mediatek/mtk_pcie.c:844–863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842}
843
844static int
845mtk_pcie_phy_stop(device_t dev)
846{
847 struct mtk_pci_softc *sc = device_get_softc(dev);
848
849 if (sc->socid == MTK_SOC_MT7621 &&
850 (mtk_sysctl_get(SYSCTL_REVID) & SYSCTL_REVID_MASK) !=
851 SYSCTL_MT7621_REV_E) {
852 if (fdt_reset_deassert_all(dev))
853 return (ENXIO);
854 } else {
855 if (fdt_reset_assert_all(dev))
856 return (ENXIO);
857 }
858
859 if (fdt_clock_disable_all(dev))
860 return (ENXIO);
861
862 return (0);
863}
864
865#define mtk_pcie_phy_set(_sc, _reg, _s, _n, _v) \
866 MT_WRITE32((_sc), (_reg), ((MT_READ32((_sc), (_reg)) & \

Callers 3

mtk_pci_attachFunction · 0.85
mtk_pcie_phy_mt7621_initFunction · 0.85
mtk_pcie_phy_mt7620_initFunction · 0.85

Calls 4

device_get_softcFunction · 0.85
mtk_sysctl_getFunction · 0.85
fdt_reset_deassert_allFunction · 0.85
fdt_reset_assert_allFunction · 0.85

Tested by

no test coverage detected