summaryrefslogtreecommitdiff
path: root/common/pwm.c
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2016-09-06 13:56:57 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-08 17:57:51 -0700
commitdf80ec22ca2aa67e3e70eeb987e20fcd870341fe (patch)
tree3adcddc7dea1014784a517cee4a22931a04166d7 /common/pwm.c
parent64d6f5781becdf43b8de29a242277bc98b3b4b1e (diff)
downloadchrome-ec-df80ec22ca2aa67e3e70eeb987e20fcd870341fe.tar.gz
pwm: PWM is disabled when duty is set to max value
The CTR was set to 1 less than the max PWM value, so when the DCR is set to max PWM value, duty goes to zero. The bug is fixed by setting CTR to PWM max vlaue. BUG=chrome-os-partner:57052 BRANCH=None TEST=Manual on terminal. > pwmduty 1 raw 0 Setting channel 1 to raw 0 1: disabled > pwmduty 1 raw 65535 Setting channel 1 to raw 65535 verified that screen didn't blank Change-Id: I10885d382f1bd252a5e7355da99dc00bd876e29f Reviewed-on: https://chromium-review.googlesource.com/381632 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common/pwm.c')
-rw-r--r--common/pwm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/common/pwm.c b/common/pwm.c
index 761d1dad25..18651d8358 100644
--- a/common/pwm.c
+++ b/common/pwm.c
@@ -144,8 +144,7 @@ static int cc_pwm_duty(int argc, char **argv)
/* Negative = disable */
pwm_enable(ch, 0);
} else {
- ccprintf("Setting channel %d to%s%d%%\n",
- ch, (max_duty == 100) ? " " : " raw ", value);
+ ccprintf("Setting channel %d to %d\n", ch, value);
pwm_enable(ch, 1);
(max_duty == 100) ? pwm_set_duty(ch, value) :
pwm_set_raw_duty(ch, value);