regulator: rpmh-regulator: add support for debugfs control

Add support for debugfs control of a regulator's state.  This
is useful for testing and debugging.

Change-Id: I26da17c0cf45b942680eb4813d8cc7d0b58e6d29
Signed-off-by: David Collins <collinsd@codeaurora.org>
This commit is contained in:
David Collins 2020-06-26 14:22:28 -07:00 committed by David Collins
parent 96f3cd3912
commit 442fbd3fa6

View File

@ -12,6 +12,7 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/regulator/debug-regulator.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
@ -1814,6 +1815,11 @@ static int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg)
vreg_err(vreg, "failed to register proxy consumer, rc=%d\n",
rc);
rc = devm_regulator_debug_register(dev, vreg->rdev);
if (rc)
vreg_err(vreg, "failed to register debug regulator, rc=%d\n",
rc);
vreg_debug(vreg, "successfully registered; set=%s\n",
vreg->set_active && vreg->set_sleep
? "active + sleep"