Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pwm: Reload counters when they reach 0 #304

Merged
merged 1 commit into from Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/board/system76/common/pwm.c
Expand Up @@ -26,6 +26,11 @@ void pwm_init(void) {
// Turn off CPU fan (temperature control in peci_get_fan_duty)
DCR2 = 0;

#ifdef it5570e
// Reload counters when they reach 0 instead of immediately
PWMLCCR = 0xFF;
#endif

// Enable PWM
ZTIER = BIT(1);
}
5 changes: 5 additions & 0 deletions src/ec/ite/include/ec/pwm.h
Expand Up @@ -62,4 +62,9 @@ volatile uint8_t __xdata __at(0x1823) ZTIER;
// Tachometer switch control register
volatile uint8_t __xdata __at(0x1848) TSWCTLR;

#ifdef it5570e
// PWM Load Counter Control Register
volatile uint8_t __xdata __at(0x185A) PWMLCCR;
#endif

#endif // _EC_PWM_H