diff mbox

[5/7] soc/tegra: pmc: Register sub-devices of PMC

Message ID 1460473007-11535-6-git-send-email-ldewangan@nvidia.com
State New
Headers show

Commit Message

Laxman Dewangan April 12, 2016, 2:56 p.m. UTC
Register sub devices of the PMC to support multiple functionalities
of PMC.
The sub devices are the subnode of PMC DT node with containing the
compatible string of sub devices as follows:

        pmc@0,7000e400 {
		pmc-pad-control {
			compatible = "nvidia,tegra210-io-pad";
			::
		};
	};

In this pmc-pad-control is the sub device of PMC and the device
compatibility is nvidia,tegra210-io-pad.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 drivers/soc/tegra/pmc.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Stephen Warren April 15, 2016, 4:31 p.m. UTC | #1
On 04/12/2016 08:56 AM, Laxman Dewangan wrote:
> Register sub devices of the PMC to support multiple functionalities
> of PMC.
> The sub devices are the subnode of PMC DT node with containing the
> compatible string of sub devices as follows:
>
>          pmc@0,7000e400 {
> 		pmc-pad-control {
> 			compatible = "nvidia,tegra210-io-pad";
> 			::
> 		};
> 	};
>
> In this pmc-pad-control is the sub device of PMC and the device
> compatibility is nvidia,tegra210-io-pad.

Since I don't think anyone has mentioned this point on the public lists, 
I'll echo the earlier internal discussion on this patch. I think the PMC 
driver should handle this all entirely internally. The PMC HW module 
doesn't have well-defined sub-modules, and hence we shouldn't represent 
sub-modules in DT. DT should represent HW structure, not Linux SW structure.
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 968f7cb..c044f3b 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -32,6 +32,7 @@ 
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
+#include <linux/of_platform.h>
 #include <linux/reboot.h>
 #include <linux/reset.h>
 #include <linux/seq_file.h>
@@ -1002,6 +1003,11 @@  static int tegra_pmc_probe(struct platform_device *pdev)
 	pmc->base = base;
 	mutex_unlock(&pmc->powergates_lock);
 
+	err = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
+	if (err < 0)
+		dev_err(&pdev->dev,
+			"Failed to register PMC Sub module driver: %d\n", err);
+
 	return 0;
 }