diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2021-07-21 16:30:39 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-21 12:00:12 +0000 |
commit | 877ac2c151a7858836196a526fdc522c406ac30e (patch) | |
tree | 97f550650c36229da7aa3cad941a45ff6a371c97 | |
parent | ded45773ac36081677016598b318f99f4c8402cb (diff) | |
download | chrome-ec-877ac2c151a7858836196a526fdc522c406ac30e.tar.gz |
it83xx: pwm: fix wrong index of pwm_channels
BRANCH=none
BUG=b:194047863
TEST=On spherion, no keyboard backlight blinking.
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Change-Id: I847291268720bf12ca98b3e38e29a556ec038cd0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3043075
Tested-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Eric Yilun Lin <yllin@google.com>
-rw-r--r-- | chip/it83xx/pwm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chip/it83xx/pwm.c b/chip/it83xx/pwm.c index 6328c69b46..fda8dd23d6 100644 --- a/chip/it83xx/pwm.c +++ b/chip/it83xx/pwm.c @@ -67,16 +67,16 @@ static int pwm_get_cycle_time(enum pwm_channel ch) void pwm_enable(enum pwm_channel ch, int enabled) { /* pwm channel mapping */ - ch = pwm_channels[ch].channel; + int pwm_reg_index = pwm_channels[ch].channel; /* * enabled : pin to PWM function. * disabled : pin to GPIO input function. */ if (enabled) - *pwm_ctrl_regs[ch].pwm_pin = 0x00; + *pwm_ctrl_regs[pwm_reg_index].pwm_pin = 0x00; else - *pwm_ctrl_regs[ch].pwm_pin = 0x80 | + *pwm_ctrl_regs[pwm_reg_index].pwm_pin = 0x80 | ((pwm_channels[ch].flags & PWM_CONFIG_ACTIVE_LOW) ? 4 : 2); } |