diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-10-07 10:59:45 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-08 20:41:32 +0000 |
commit | ff8c8fee79e148567c0f2128db69563acb29ee54 (patch) | |
tree | 0d3daa52c091a36c997c0cd42be8267678a13f7f /include | |
parent | 99157c265c8353e166059e17d250d9991d4e7ae0 (diff) | |
download | chrome-ec-ff8c8fee79e148567c0f2128db69563acb29ee54.tar.gz |
rambi: Control LEDs using PWM
Rambi has a pair of LEDs which are attached to the PWM fan controller.
Add support for them. Also add a generic 'pwmduty' command which can
be used to get/set the duty cycle for any PWM channel.
Also fix rounding errors in pwm module, so that set/get duty doesn't
keep rounding down.
BUG=chrome-os-partner:22895
BRANCH=none
TEST=Boot rambi. LEDs are off.
pwmduty -> both are 0%
pwmduty 0 10 -> green LED on dimly
pwmduty 1 10 -> red LED on dimly
pwmduty 0 99 -> green LED on brightly
pwmduty 1 100 -> red LED on brightly
pwmduty 1 0 -> red LED off
pwmduty 1 -1 -> red LED turns back on because fan controller is disabled
pwmduty -> channel 0 at 99%, channel 1 disabled
Build all platforms. Pass all unit tests.
Change-Id: Ib0a6289a757554e696a9a0153a85bdc34e2ee2ae
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/172094
Diffstat (limited to 'include')
-rw-r--r-- | include/hooks.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hooks.h b/include/hooks.h index da46610505..fb3e6c236b 100644 --- a/include/hooks.h +++ b/include/hooks.h @@ -27,6 +27,8 @@ enum hook_priority { HOOK_PRIO_INIT_LID = HOOK_PRIO_FIRST + 3, /* Power button inits before chipset and switch */ HOOK_PRIO_INIT_POWER_BUTTON = HOOK_PRIO_FIRST + 4, + /* PWM inits before modules which might use it (fans, LEDs) */ + HOOK_PRIO_INIT_PWM = HOOK_PRIO_FIRST + 5, /* Specific values to lump temperature-related hooks together */ HOOK_PRIO_TEMP_SENSOR = 6000, |