From 80c9b923b708e87253f276db00f19024f2117faf Mon Sep 17 00:00:00 2001 From: David Collins Date: Fri, 26 Jun 2020 14:17:01 -0700 Subject: [PATCH] regulator: stub-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: I0be1fc1e6278df828d5ffce22f425c95b425f041 Signed-off-by: David Collins --- drivers/regulator/stub-regulator.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/stub-regulator.c b/drivers/regulator/stub-regulator.c index d9c198d5cd9f..d34e40b18adc 100644 --- a/drivers/regulator/stub-regulator.c +++ b/drivers/regulator/stub-regulator.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2012, 2016, 2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2016, 2018, 2020, The Linux Foundation. + * All rights reserved. */ #include @@ -12,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -207,6 +209,10 @@ static int regulator_stub_probe(struct platform_device *pdev) return rc; } + rc = devm_regulator_debug_register(dev, rdev); + if (rc) + dev_err(dev, "failed to register debug regulator, rc=%d\n", rc); + return 0; }