lkml.org 
[lkml]   [2019]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 6/8] regulator: core: Don't attach generic coupler to Tegra SoC regulators
Date
Today generic coupler can't handle regulators coupling that is specific to
NVIDIA Tegra SoC's, hence don't allow generic coupler to attach to those
regulators. Later on it should be possible to switch at least Tegra20 to a
generic coupler, once all prerequisite bits will get resolved in upstream
(voltage management support by all drivers, etc).

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
drivers/regulator/core.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 5a5b86d3edfb..68cccaf2e8f2 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4866,6 +4866,16 @@ static int regulator_init_coupling(struct regulator_dev *rdev)
static int generic_coupler_attach(struct regulator_coupler *coupler,
struct regulator_dev *rdev)
{
+ /*
+ * Generic coupler isn't suitable for NVIVIA Tegra SoC's, at least
+ * for now. Hence filter out the unwanted regulators as they shall be
+ * managed by a platform-specific coupler.
+ */
+ if (of_property_read_bool(rdev->dev.of_node, "tegra-core-regulator") ||
+ of_property_read_bool(rdev->dev.of_node, "tegra-rtc-regulator") ||
+ of_property_read_bool(rdev->dev.of_node, "tegra-cpu-regulator"))
+ return -EPERM;
+
return 0;
}

--
2.21.0
\
 
 \ /
  Last update: 2019-06-04 02:00    [W:0.229 / U:1.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site