Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'Off' setting for power LED #12

Open
wants to merge 1 commit into
base: hx20
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion board/hx20/host_command_customization.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ enum fp_led_brightness_level {
FP_LED_BRIGHTNESS_HIGH = 0,
FP_LED_BRIGHTNESS_MEDIUM = 1,
FP_LED_BRIGHTNESS_LOW = 2,
FP_LED_BRIGHTNESS_OFF = 3,
};

struct ec_response_fp_led_level {
Expand All @@ -197,4 +198,4 @@ struct ec_response_chassis_open_check {
uint8_t status;
} __ec_align1;

#endif /* __HOST_COMMAND_CUSTOMIZATION_H */
#endif /* __HOST_COMMAND_CUSTOMIZATION_H */
9 changes: 9 additions & 0 deletions board/hx20/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
#define FP_LED_HIGH 55
#define FP_LED_MEDIUM 40
#define FP_LED_LOW 15
#define FP_LED_OFF 0

#define FP_BREATH_LOW 20
#define FP_BREATH_OFF 0

const enum ec_led_id supported_led_ids[] = {
EC_LED_ID_LEFT_LED,
Expand Down Expand Up @@ -343,6 +345,9 @@ static void led_configure(void)
breath_led_level = FP_BREATH_LOW;
breath_led_length = BREATH_ON_LENGTH_LOW;
break;
case FP_LED_BRIGHTNESS_OFF:
breath_led_level = FP_BREATH_OFF;
break;
default:
break;
}
Expand Down Expand Up @@ -392,6 +397,10 @@ static enum ec_status fp_led_level_control(struct host_cmd_handler_args *args)
breath_led_level = FP_BREATH_LOW;
breath_led_length = BREATH_ON_LENGTH_LOW;
break;
case FP_LED_BRIGHTNESS_OFF:
led_level = FP_LED_OFF;
breath_led_level = FP_BREATH_OFF;
break;
default:
return EC_RES_INVALID_PARAM;
break;
Expand Down