]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commit
regulator: introduce regulator chain locking scheme
authorGrygorii Strashko <grygorii.strashko@ti.com>
Mon, 8 Apr 2013 15:55:04 +0000 (18:55 +0300)
committerJ Keerthy <j-keerthy@ti.com>
Tue, 28 May 2013 05:39:54 +0000 (11:09 +0530)
commitc0b5b6fa115de6bc0ec278b6cd2c03955bee8e12
tree21bd753ce1c6c631b0da358095f8782101c8ce61
parent95dc06615e418498b939830dbbfb3d7514b5bc39
regulator: introduce regulator chain locking scheme

In some cases the regulators may be organized in a chain like:
  ->regA->regB->regC
where regA is supplier for regB and regB is supplier for regC.

Currently it would be possible to reconfigure regA and regC at same time
form different contexts, because each regulator has it own mutex.
But in some cases, the only the whole chain is allowed be reconfigured
because of dependencies between regulators - to change regB
configuration the regA need to be updated first.

Hence, introduce regulator chain locking scheme to lock whole Regulator
chain in case if any part of it has been accessed from outside. To
achieve this goal the root Regulator (which has no supply defined, like
regA) in chain is used to protect the whole chain.

In addition, such locking scheme allows to have access to the supplier
regulator API from inside child's (consumer) regulator API.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
drivers/regulator/core.c
include/linux/regulator/driver.h