diff options
| author | Subbaraman Narayanamurthy <subbaram@codeaurora.org> | 2017-01-04 18:53:39 -0800 |
|---|---|---|
| committer | Subbaraman Narayanamurthy <subbaram@codeaurora.org> | 2017-01-04 19:12:12 -0800 |
| commit | 9862ec5a2ed0b8adc9d9905720d2a86496b844bd (patch) | |
| tree | de72d979f6db5f54d13b6956533d1bea9a80ca07 | |
| parent | 1b6c41d1a0a793097ecebe8e13675ec42f501bb6 (diff) | |
leds: qpnp-flash-v2: add LED_KEEP_TRIGGER flag to switch devices
LED_KEEP_TRIGGER flag needs to be set on switch devices so that
the trigger will not be removed when the brightness is set to 0.
Without this, when an user sets brightness to 0 on switch device
and try to use camera flash, qpnp_flash_led_prepare() will fail
which in turn fails the camera flash operation.
Change-Id: I521bc6c6750bafc742dccac90ef585bc250b0270
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
| -rw-r--r-- | drivers/leds/leds-qpnp-flash-v2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/leds/leds-qpnp-flash-v2.c b/drivers/leds/leds-qpnp-flash-v2.c index aa59677c4b6a..84c2470d070e 100644 --- a/drivers/leds/leds-qpnp-flash-v2.c +++ b/drivers/leds/leds-qpnp-flash-v2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1569,6 +1569,7 @@ static int qpnp_flash_led_parse_and_register_switch(struct qpnp_flash_led *led, snode->pdev = led->pdev; snode->cdev.brightness_set = qpnp_flash_led_brightness_set; snode->cdev.brightness_get = qpnp_flash_led_brightness_get; + snode->cdev.flags |= LED_KEEP_TRIGGER; rc = led_classdev_register(&led->pdev->dev, &snode->cdev); if (rc < 0) { pr_err("Unable to register led switch node\n"); |
