Jeremy Soller 357fae86fc
System76 common board directory (#53)
* Move configuration for battery into board.mk

* lemp9: remove tcpm code

* Move touchpad to its own module

* Add kbled_reset to all platforms, move items to run on CPU reset to a function

* Add defines for battery and charger address

* Add I2C_0 export to it5570e

* Move common system76 board functions into src/board/system76/common
2020-04-14 17:23:29 -06:00

25 lines
438 B
C

#include <board/pwm.h>
void pwm_init(void) {
// Set T0CHSEL to TACH0A and T1CHSEL to TACH1A
TSWCTLR = 0;
// Disable PWM
ZTIER = 0;
// Set prescalar clock frequency to EC clock
PCFSR = 0b01;
// Set clock prescaler to 0 + 1
C0CPRS = 0;
// Set cycle time to 255 + 1
CTR0 = 255;
// Turn off CPU fan (temperature control in peci_event)
DCR2 = 0;
// Enable PWM
ZTIER = (1 << 1);
}