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

Function mtk_reset_set

freebsd/mips/mediatek/mtk_reset.c:85–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83#define RESET_DEASSERT 0
84
85static int
86mtk_reset_set(device_t dev, int index, int value)
87{
88 uint32_t mask;
89
90 /* index 0 is SoC reset, indices 1 - 31 are valid peripheral resets */
91 if (index < 1 || index > 31)
92 return (EINVAL);
93
94 mask = (1u << index);
95
96 if (value == RESET_ASSERT)
97 mtk_sysctl_clr_set(SYSCTL_RSTCTRL, 0, mask);
98 else
99 mtk_sysctl_clr_set(SYSCTL_RSTCTRL, mask, 0);
100
101 return (0);
102}
103
104static int
105mtk_reset_assert(device_t dev, int index)

Callers 2

mtk_reset_assertFunction · 0.85
mtk_reset_deassertFunction · 0.85

Calls 1

mtk_sysctl_clr_setFunction · 0.85

Tested by

no test coverage detected