Commit Graph

8 Commits

Author SHA1 Message Date
Bill Richardson
0bfb7ddd07 Replace generated CONFIG_TASK_ macros with HAS_TASK_
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>
2013-04-24 16:32:58 -07:00
Randall Spangler
fcb1e1c819 Move power LED GPIO code from snow board.c into power_led.c
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>
2013-04-08 10:00:35 -07:00
Randall Spangler
75acd4065a Clean up power LED state machine on link
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>
2013-03-14 15:44:14 -07:00
Randall Spangler
d4bd167c33 Clean up LED and onewire modules
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>
2012-10-25 14:12:11 -07:00
Vincent Palatin
fbc4c150d2 stm32: make power led optional
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>
2012-10-11 23:32:24 -07:00
David Hendricks
1f091487b2 snow/stm32: re-configure power LED on the fly (input vs. pwm)
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>
2012-08-17 16:55:26 -07:00
David Hendricks
1bedd55970 Daisy/Snow: Drive power LED with PWM
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>
2012-07-02 15:26:02 -07:00
Randall Spangler
a9f4794edb Add support for 1-wire protocol and power adapter LEDs
BUG=chrome-os-partner:7498
TEST=powerled {off, red, yellow, green}

Signed-off-by: Randall Spangler <rspangler@chromium.org>

Change-Id: I48beaad94d75c0ec30a969ea4b0e35f54e052085
2012-03-16 11:03:13 -07:00