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
This commit is contained in:
24
src/board/system76/common/pwm.c
Normal file
24
src/board/system76/common/pwm.c
Normal file
@ -0,0 +1,24 @@
|
||||
#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);
|
||||
}
|
Reference in New Issue
Block a user