diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c index 54df5b09eea8..7214ae55d3f9 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c @@ -44,7 +44,7 @@ struct accton_as7326_56x_led_data { struct mutex update_lock; char valid; /* != 0 if registers are valid */ unsigned long last_updated; /* In jiffies */ - u8 reg_val[1]; /* only 1 register*/ + u8 reg_val[2]; }; static struct accton_as7326_56x_led_data *ledctl = NULL; @@ -54,16 +54,24 @@ static struct accton_as7326_56x_led_data *ledctl = NULL; #define LED_CNTRLER_I2C_ADDRESS (0x60) -#define LED_TYPE_DIAG_REG_MASK (0x3) -#define LED_MODE_DIAG_GREEN_VALUE (0x02) -#define LED_MODE_DIAG_RED_VALUE (0x01) -#define LED_MODE_DIAG_AMBER_VALUE (0x00) /*It's yellow actually. Green+Red=Yellow*/ -#define LED_MODE_DIAG_OFF_VALUE (0x03) - - -#define LED_TYPE_LOC_REG_MASK (0x80) -#define LED_MODE_LOC_ON_VALUE (0) -#define LED_MODE_LOC_OFF_VALUE (0x80) +#define LED_TYPE_DIAG_REG_MASK (0x3f) +#define LED_MODE_DIAG_GREEN_VALUE (0x05) +#define LED_MODE_DIAG_RED_VALUE (0x06) +#define LED_MODE_DIAG_BLUE_VALUE (0x03) +#define LED_MODE_DIAG_GREEN_BLINK_VALUE (0x17) +#define LED_MODE_DIAG_RED_BLINK_VALUE (0x0d) +#define LED_MODE_DIAG_BLUE_BLINK_VALUE (0x27) + +#define LED_MODE_DIAG_OFF_VALUE (0x07) + +#define LED_TYPE_LOC_REG_MASK (0x3f) +#define LED_MODE_LOC_GREEN_VALUE (0x05) +#define LED_MODE_LOC_RED_VALUE (0x06) +#define LED_MODE_LOC_BLUE_VALUE (0x03) +#define LED_MODE_LOC_GREEN_BLINK_VALUE (0x17) +#define LED_MODE_LOC_RED_BLINK_VALUE (0x0d) +#define LED_MODE_LOC_BLUE_BLINK_VALUE (0x27) +#define LED_MODE_LOC_OFF_VALUE (0x07) enum led_type { LED_TYPE_DIAG, @@ -79,7 +87,8 @@ struct led_reg { }; static const struct led_reg led_reg_map[] = { - {(1<reg_val[0]); + return led_reg_val_to_light_mode(LED_TYPE_LOC, ledctl->reg_val[1]); } static void accton_as7326_56x_led_auto_set(struct led_classdev *led_cdev, @@ -287,7 +307,7 @@ static struct led_classdev accton_as7326_56x_leds[] = { .brightness_set = accton_as7326_56x_led_diag_set, .brightness_get = accton_as7326_56x_led_diag_get, .flags = LED_CORE_SUSPENDRESUME, - .max_brightness = LED_MODE_RED, + .max_brightness = LED_MODE_BLUE_BLINK, }, [LED_TYPE_LOC] = { .name = "accton_as7326_56x_led::loc", @@ -295,7 +315,7 @@ static struct led_classdev accton_as7326_56x_leds[] = { .brightness_set = accton_as7326_56x_led_loc_set, .brightness_get = accton_as7326_56x_led_loc_get, .flags = LED_CORE_SUSPENDRESUME, - .max_brightness = LED_MODE_BLUE, + .max_brightness = LED_MODE_BLUE_BLINK, }, [LED_TYPE_FAN] = { .name = "accton_as7326_56x_led::fan",