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

Commit be8fa0cf authored by Jacek Anaszewski's avatar Jacek Anaszewski Committed by ansharma
Browse files

leds: implement sysfs interface locking mechanism



Add a mechanism for locking LED subsystem sysfs interface.
This patch prepares ground for addition of LED Flash Class
extension, whose API will be integrated with V4L2 Flash API.
Such a fusion enforces introducing a locking scheme, which
will secure consistent access to the LED Flash Class device.

The mechanism being introduced allows for disabling LED
subsystem sysfs interface by calling led_sysfs_disable function
and enabling it by calling led_sysfs_enable. The functions
alter the LED_SYSFS_DISABLE flag state and must be called
under mutex lock. The state of the lock is checked with use
of led_sysfs_is_disabled function. Such a design allows for
providing immediate feedback to the user space on whether
the LED Flash Class device is available or is under V4L2 Flash
sub-device control.

CRs-Fixed: 1034167
Change-Id: Iac7bc6c32794df16c1c275d4f46e754fb61bbdc0
Signed-off-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
Git-commit: acd899e4f3066b6662f6047da5b795cc762093cb
Git-repo: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git


[ansharma@codeaurora.org: Fix minor merge conflicts]
Signed-off-by: default avataransharma <ansharma@codeaurora.org>
parent 296a253b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment