← Back to team overview

ac100 team mailing list archive

[PATCH 2/2] Minor changes to side LEDs

 

 When setting a led effect, setting a null effect. EC behaves randomly otherwise.
 Keep led effect enabled on suspend.

---
 drivers/staging/nvec/nvec_leds.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/nvec/nvec_leds.c b/drivers/staging/nvec/nvec_leds.c
index f4cbcd6..f446573 100644
--- a/drivers/staging/nvec/nvec_leds.c
+++ b/drivers/staging/nvec/nvec_leds.c
@@ -35,8 +35,14 @@ static void nvec_led_brightness_set(struct led_classdev *led_cdev,
 {
 	struct nvec_led *led = to_nvec_led(led_cdev);
 	unsigned char buf[] = NVEC_LED_REQ;
-	buf[4] = value;
+	struct nvec_msg *msg;
+	
+	//First write effect 0
+	msg = nvec_write_sync(led->nvec, buf, sizeof(buf));
+	nvec_msg_free(led->nvec, msg);
 
+	//Then write the effect we want
+	buf[4] = value;
 	nvec_write_async(led->nvec, buf, sizeof(buf));
 
 	led->cdev.brightness = value;
@@ -57,7 +63,6 @@ static int __devinit nvec_led_probe(struct platform_device *pdev)
 
 	led->cdev.brightness_set = nvec_led_brightness_set;
 	led->cdev.name = "nvec-led";
-	led->cdev.flags |= LED_CORE_SUSPENDRESUME;
 	led->nvec = nvec;
 
 	platform_set_drvdata(pdev, led);
-- 
1.7.3.4



Follow ups

References