| 83 | #define CLOCK_DISABLE 0 |
| 84 | |
| 85 | static int |
| 86 | mtk_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 | |
| 104 | static int |
| 105 | mtk_clock_enable(device_t dev, int index) |
no test coverage detected