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

Function mtk_clock_set

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

Source from the content-addressed store, hash-verified

83#define CLOCK_DISABLE 0
84
85static int
86mtk_clock_set(device_t dev, int index, int value)
87{
88 uint32_t mask;
89
90 /* Clock config register holds 32 clock gating bits */
91 if (index < 0 || index > 31)
92 return (EINVAL);
93
94 mask = (1u << index);
95
96 if (value == CLOCK_ENABLE)
97 mtk_sysctl_clr_set(SYSCTL_CLKCFG1, 0, mask);
98 else
99 mtk_sysctl_clr_set(SYSCTL_CLKCFG1, mask, 0);
100
101 return (0);
102}
103
104static int
105mtk_clock_enable(device_t dev, int index)

Callers 2

mtk_clock_enableFunction · 0.85
mtk_clock_disableFunction · 0.85

Calls 1

mtk_sysctl_clr_setFunction · 0.85

Tested by

no test coverage detected