From: Kim, Milo Date: Wed, 12 Sep 2012 12:16:00 +0000 (+0800) Subject: leds-lp5523: turn off the LED engines on unloading the driver X-Git-Tag: firefly_0821_release~3680^2~1864^2~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=23301b7f1b8910fb3ba84935edbf665808f53871;p=firefly-linux-kernel-4.4.55.git leds-lp5523: turn off the LED engines on unloading the driver The LP5523 has 3 engines which are used for running LED patterns. These engines should be off while unloading the driver. Obviously, LP5523 platform data are used for releasing the resource such like enable()/release_resource(), but these are not mandatory. Therefore this patch is required without the platform data dependency. Signed-off-by: Milo(Woogyom) Kim Signed-off-by: Bryan Wu --- diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index 3d60428df643..5ebdc9245d59 100644 --- a/drivers/leds/leds-lp5523.c +++ b/drivers/leds/leds-lp5523.c @@ -997,6 +997,9 @@ static int lp5523_remove(struct i2c_client *client) struct lp5523_chip *chip = i2c_get_clientdata(client); int i; + /* Disable engine mode */ + lp5523_write(client, LP5523_REG_OP_MODE, LP5523_CMD_DISABLED); + lp5523_unregister_sysfs(client); for (i = 0; i < chip->num_leds; i++) {