Skip to content

Commit

Permalink
add 'Off' setting for power LED
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntingEcho committed Mar 7, 2022
1 parent 8109392 commit 92a2f46
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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

0 comments on commit 92a2f46

Please sign in to comment.