summaryrefslogtreecommitdiff
path: root/board/kukui/led.c
Commit message (Collapse)AuthorAgeFilesLines
* kukui: Do not sink LED power on initYilun Lin2019-12-051-1/+1
| | | | | | | | | | | | | | Enable LED color would start consuming power even if the led brightness is zero. TEST=make buildall BUG=b:137618886 BRANCH=kukui Change-Id: I06120f4fec0cc41e40463989649ac9a5061d9f6b Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1926187 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* krane: Use the PWM mode to adjust brightness as lowestLeo Zhou2019-11-221-4/+22
| | | | | | | | | | | | | | | | | | Adjust current=4ma, pwm=1/32, and change the state as: charging is blue charged full is green low battery is red BUG=b:137618886 BRANCH=kukui TEST=Do a full charging test, notice LED indicator status under different charge state Change-Id: Ic1b7a99ab3edaee5c92a5cae56bc6d9a321e9c23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1918995 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Kook Zhang <zhangbinbin@huaqin.corp-partner.google.com> Commit-Queue: Leo Zhou <zhoubo@huaqin.corp-partner.google.com>
* krane: Modify the charge indicatorLeo Zhou2019-10-261-2/+13
| | | | | | | | | | | | | | | | Based on the OD, the charge indicator should be red under low battery BUG=b:142835019 BRANCH=kukui TEST=1. Charge DUT to battery SOC > 20%, then plug out charger 2. Wait for battery SOC <= 10%, notice the charge indicator Change-Id: I2013bc6182067ddf64bb790f5cbf4bc0621b7899 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1871502 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Leo Zhou <zhoubo@huaqin.corp-partner.google.com> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
* krane: Modify the Charging and Fully charged LED colorLeo Zhou2019-10-181-5/+4
| | | | | | | | | | | | | | | Based on the Lenovo requirement,modify the Charging and Fully charged LED color as white BUG=b:137618886 BRANCH=kukui TEST=Do a charge test Change-Id: I75a3e9f24c98a67cb6b9dda8294c73926c20d4d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1706248 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Leo Zhou <zhoubo@huaqin.corp-partner.google.com> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* kukui/led: Support led blinking at sysrq debug mode.Yilun Lin2019-06-141-0/+21
| | | | | | | | | | | | | | | | | | | | According to chromium.googlesource.com/chromiumos/docs/+/master/debug_buttons.md, we should support debug mode to blink LED while holding Vol-Up + Vol-Down for ten seconds. TEST=hold vol-up + vol-down for ten seconds, and see green led blinking. BUG=b:134654616 BRANCH=master Change-Id: Ic6cc2f382412a89366a145c0c309e71d98cd8cb7 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1654763 Tested-by: Yilun Lin <yllin@chromium.org> Tested-by: Tony Lin <tonycwlin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Yilun Lin <yllin@chromium.org> Auto-Submit: Yilun Lin <yllin@chromium.org>
* kukui/led: Reset led prv_chstate once auto-controlled re-enabled.Yilun Lin2019-06-141-1/+13
| | | | | | | | | | | | | | | | | | | Reset LED prv_chstate so that the LED light can be updated immediately when the led controlled status goes from manual to auto. TEST=Plug charger; see blue led ectool led battery red=1; see red led ectool led battery auto; see blue led immediately. BUG=None BRANCH=master Change-Id: I4f5029d708df8f9c31c6c5ee8b51003648a4ff9e Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1654762 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Auto-Submit: Yilun Lin <yllin@chromium.org> Commit-Queue: Yilun Lin <yllin@chromium.org>
* kukui: Fix power leakage in LED.Yilun Lin2019-05-021-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Though setting the LED brighness to 0, LEDs are still sinking power. This causes power leakage (2mA) in G3 state. This CL turns off the LED current sinking if the LED brightness is set to 0. This also fixes LED not able to enter auto mode if it has been turned off previously. BRANCH=None BUG=b:131122365 b:131372801 TEST=see that the gap of the power of batt and sys are reduce from 2mA to 0.06mA. dut-control ppvar_batt_ma ppvar_sys_ma -t 3 |grep @@ @@ NAME COUNT AVERAGE STDDEV MAX MIN @@ sample_msecs 527 5.69 1.12 11.73 4.73 @@ ppvar_batt_ma 527 3.96 0.29 4.00 2.00 @@ ppvar_sys_ma 527 3.90 0.45 6.00 2.00 TEST=ectool led battery off; ectool led battery auto; and see the battery led can blink. Change-Id: I8422eb651781386caa0600448bde3a0825d65ec3 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1588302 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* kukui/led: Fix LED behaviours.Yilun Lin2019-04-181-31/+38
| | | | | | | | | | | | | | | | | | | | | Red for error state and discharge in low power. Blue for charging. Green for charged almost full. Also, fix the ectool led battery not working. TEST=See blue LED when charging, green LED when battery full. TEST=see ectool led battery red=x blue=y green=z works. xyz are the combinations from 0 to 7. BUG=b:128812582, b:129720983 BRANCH=None Change-Id: I45d2395197fd9f0713aae8a41ae69c5bc92548b9 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1568891 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* RT946x: Make mt6370_led_set_color accept composite colorsDaisuke Nojiri2019-02-091-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, mt6370_led_set_color can handle only simple colors. That is, if a green LED is turned on, other LEDs are forced to be off. To allow composite colors (e.g. red+green), this change makes mt6370_led_set_color control LEDs independently. For example, to mix green and red, it can be called as mt6370_led_set_color(LED_MASK_GREEN | LED_MASK_RED); This is consistent with other RT946x LED APIs in the sense that they also control each LED independently. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/123613083 BRANCH=none TEST=Verify LED behavior doesn't change on Kukui by console command Change-Id: Idb80a124462b30adca6af86621aed136be8caa99 Reviewed-on: https://chromium-review.googlesource.com/1452617 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* kukui: Add LED behavior.Yilun Lin2018-07-111-4/+62
| | | | | | | | | | | | | | | | | | | Add simple LED rules. Charge: red Discharge under 10 percent: blink red Full: green Idle: red or green breath. BUG=b:80160408 TEST=none BRANCH=none Change-Id: I1d3a75dadb92e0dbf617a132990e3a0c4da66461 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1126748 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* kukui: Initial setup for ec.Yilun Lin2018-06-301-0/+33
Setup initial files and GPIOs for kukui. TEST=make BOARD=kukui -j BUG=b:80159522 b:110243480 BRANCH=none Change-Id: I5c5f1f08d0a0c8e1336a27019ea01b2e0850d3c1 Signed-off-by: Yilun Lin <yllin@google.com> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1041505 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Yilun Lin <yllin@chromium.org>