Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9862ec5a authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

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: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 1b6c41d1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/* 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");