diff options
author | Vic Yang <victoryang@chromium.org> | 2013-08-05 11:17:35 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-08-27 23:20:33 +0000 |
commit | 5d014fd2dd5e92ad35a4f2dd1b58e0b1baebb65e (patch) | |
tree | 2078f9831177392f22ba202cbea4b09d69a9a710 /common/lightbar.c | |
parent | 99f06c39aabd262653c96c589c5cd26fc1fb8389 (diff) | |
download | chrome-ec-5d014fd2dd5e92ad35a4f2dd1b58e0b1baebb65e.tar.gz |
Refactor PWM module
This unifies the PWM module interface for LM4 and STM32. Now PWM
channels are defined in board.h/board.c. Instead of calling functions
named pwm_set_fan_duty(x), one can now use pwm_set_duty(PWM_CH_FAN, x),
which prevents additional functions added when we have a new PWM
channel.
BUG=chrome-os-partner:18343
TEST=Limit input current on Spring.
TEST=Check power LED in S0/S3/S5 on Snow.
TEST=Check keyboard backlight functionality on Link.
TEST=Check fan speed control/detecting on Link.
BRANCH=None
Change-Id: Ibac4d79f72e65c94776d503558a7592f7db859dc
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/64450
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/lightbar.c')
-rw-r--r-- | common/lightbar.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/lightbar.c b/common/lightbar.c index f729318c16..7471e523d7 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -295,8 +295,8 @@ static void get_battery_level(void) * when ambient is bright), use max brightness for lightbar. If * keyboard backlight is ON, use keyboard backlight brightness. */ - if (pwm_get_keyboard_backlight_enabled()) { - pct = pwm_get_keyboard_backlight(); + if (pwm_get_enabled(PWM_CH_KBLIGHT)) { + pct = pwm_get_duty(PWM_CH_KBLIGHT); pct = (255 * pct) / 100; /* 00 - FF */ if (pct > st.p.bright_bl_on_max[st.battery_is_charging]) pct = st.p.bright_bl_on_max[st.battery_is_charging]; |