Skip to content

Commit fe4ffdb

Browse files
mmindlag-linaro
authored andcommitted
leds: qnap-mcu: Fix state numbering for USB LED
The "@cx" commands span a number of different functions, from the status and USB LEDs to the buzzer and power button. So change the USB-LED enum to start at 0 and adapt the offset accordingly to not suggest @cd would relate to the USB-LED - while in fact "@cd" is a state of the status LED. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20250804114949.3127417-2-heiko@sntech.de Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 7d5c3ca commit fe4ffdb

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/leds/leds-qnap-mcu.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ static int qnap_mcu_register_err_led(struct device *dev, struct qnap_mcu *mcu, i
104104
}
105105

106106
enum qnap_mcu_usb_led_mode {
107-
QNAP_MCU_USB_LED_ON = 1,
108-
QNAP_MCU_USB_LED_OFF = 3,
109-
QNAP_MCU_USB_LED_BLINK = 2,
107+
QNAP_MCU_USB_LED_ON = 0,
108+
QNAP_MCU_USB_LED_OFF = 2,
109+
QNAP_MCU_USB_LED_BLINK = 1,
110110
};
111111

112112
struct qnap_mcu_usb_led {
@@ -137,7 +137,7 @@ static int qnap_mcu_usb_led_set(struct led_classdev *led_cdev,
137137
* Byte 3 is shared between the usb led target on/off/blink
138138
* and also the buzzer control (in the input driver)
139139
*/
140-
cmd[2] = 'D' + usb_led->mode;
140+
cmd[2] = 'E' + usb_led->mode;
141141

142142
return qnap_mcu_exec_with_ack(usb_led->mcu, cmd, sizeof(cmd));
143143
}
@@ -161,7 +161,7 @@ static int qnap_mcu_usb_led_blink_set(struct led_classdev *led_cdev,
161161
* Byte 3 is shared between the USB LED target on/off/blink
162162
* and also the buzzer control (in the input driver)
163163
*/
164-
cmd[2] = 'D' + usb_led->mode;
164+
cmd[2] = 'E' + usb_led->mode;
165165

166166
return qnap_mcu_exec_with_ack(usb_led->mcu, cmd, sizeof(cmd));
167167
}

0 commit comments

Comments
 (0)