summaryrefslogtreecommitdiff
path: root/include/power_led.h
Commit message (Collapse)AuthorAgeFilesLines
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Replace generated CONFIG_TASK_ macros with HAS_TASK_Bill Richardson2013-04-241-1/+1
| | | | | | | | | | | | | | | CONFIG_ macros should be set directly. Expanding the task names in the same way made it difficult to tell what was a configuration choice and what was due to changes in ec.tasklist BUG=chrome-os-partner:18343 TEST=build all, run link BRANCH=none Change-Id: Ib82e34f974238ee2dd216f33b701b6f4c6a4f1f1 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49098 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Move power LED GPIO code from snow board.c into power_led.cRandall Spangler2013-04-081-9/+1
| | | | | | | | | | | | | | | And remove the daisy power button LED task for now. Since daisy didn't have a board.c implementation (or a power button LED), its power LED task did nothing. BUG=chrome-os-partner:18343 BRANCH=none TEST=build daisy, snow, spring Change-Id: I1eb3d0bd038d88685e7caad087eb1a1d1495ef9a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/47442 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Clean up power LED state machine on linkRandall Spangler2013-03-141-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The power LED now has its own tick-based handler which knows how to blink the LED and resend the desired LED state to work around the flaky 1-wire connection. Removes a bunch of LED state code from charge_state.c. No user-visible impact. Does not need to go into link branch. BUG=chromium-os:18256 BRANCH=none TEST=manual 1) Discharge battery to <97% 2) Plug in AC. LED=yellow 3) 'ectool chargeforceidle 1' from root shell. LED=blinking green/off. 4) 'ectool chargeforceidle 0' from root shell. LED=yellow. 5) Wait for battery >= 97% (or 'battfake 98' from EC console). LED=green. 6) Unplug battery. LED=red (may take 10 sec). 7) Replug battery. LED=green. Change-Id: I999ee3e1abe269bb3f737bbc75e0b872316605ce Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/45469 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Clean up LED and onewire modulesRandall Spangler2012-10-251-9/+33
| | | | | | | | | | | | | No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=powerled red, then powerled green Change-Id: I595b725c14d94133f7f151d0b92cabe0e0bcf4ca Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36577 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* stm32: make power led optionalVincent Palatin2012-10-111-0/+6
| | | | | | | | | | | | | | | | | | | | | The spring board doesn't have one and we doesn't want to mess up with that pin. When the POWERLED task is not present, let's de-activate cleanly that code. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:14324 TEST=make BOARD=spring (no power_led.o compiled) make BOARD=snow (power_led.o compiled) make BOARD=link && make BOARD=bds run on Snow and see the power LED working Change-Id: Ib44f5df54ec4fdee1863814e6c7052fd6620fee8 Reviewed-on: https://gerrit.chromium.org/gerrit/35272 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* snow/stm32: re-configure power LED on the fly (input vs. pwm)David Hendricks2012-08-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Usually the power LED is driven by the PWM mode so that its nominal brightness can be set to a "soft" on value. However, when the LED is to remain off the LED should be switched to floating input mode. This reduces voltage leakage. This CL updates the power_led_task to configure the LED however is appropriate and adds board functions to re-configure the GPIO. Signed-off-by: David Hendricks <dhendrix@chromium.org> BRANCH=snow BUG=chrome-os-partner:12381 TEST=LED responds as expected in suspend and on/off states, also tested that leakage is reduced with multimeter Change-Id: If90ac78aaffe7358cce80dd02ec1423c2cb4f664 Reviewed-on: https://gerrit.chromium.org/gerrit/29705 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: David Hendricks <dhendrix@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org>
* Daisy/Snow: Drive power LED with PWMDavid Hendricks2012-07-021-0/+10
| | | | | | | | | | | | | | | | | | | | This drives the power LED for Snow (PB3) using TIM2 in PWM mode. Since timer setup and manipulation is STM32-specific, the power LED logic moved to to chip/stm32/power_led.c. This also adds a "powerled" console command for testing. Signed-off-by: David Hendricks <dhendrix@chromium.org> BUG=chrome-os-partner:10647 TEST=Tested on Snow with powerled command, compiled for Daisy Change-Id: I5a7dc20d201ea058767e3e76d54e7c8567a3b83c Reviewed-on: https://gerrit.chromium.org/gerrit/26267 Commit-Ready: David Hendricks <dhendrix@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org>
* Add support for 1-wire protocol and power adapter LEDsRandall Spangler2012-03-161-0/+24
BUG=chrome-os-partner:7498 TEST=powerled {off, red, yellow, green} Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I48beaad94d75c0ec30a969ea4b0e35f54e052085