diff mbox

[1/1] iommu/tegra: Add device tree support for SMMU

Message ID 20120413.132331.971155172093927884.hdoyu@nvidia.com
State Superseded, archived
Headers show

Commit Message

Hiroshi Doyu April 13, 2012, 10:23 a.m. UTC
From: Hiroshi DOYU <hdoyu@nvidia.com>

Add device tree support for Tegra30 IOMMU(SMMU).

Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
---
 drivers/iommu/tegra-smmu.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Comments

Thierry Reding April 13, 2012, 11:07 a.m. UTC | #1
* Hiroshi Doyu wrote:
> From: Hiroshi DOYU <hdoyu@nvidia.com>
> 
> Add device tree support for Tegra30 IOMMU(SMMU).
> 
> Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
> ---
>  drivers/iommu/tegra-smmu.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)

I would expect the binding documentation to be included with this patch
instead of the previous one. Stephen?

Thierry
Stephen Warren April 13, 2012, 7:26 p.m. UTC | #2
On 04/13/2012 05:07 AM, Thierry Reding wrote:
> * Hiroshi Doyu wrote:
>> From: Hiroshi DOYU <hdoyu@nvidia.com>
>>
>> Add device tree support for Tegra30 IOMMU(SMMU).
>>
>> Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
>> ---
>>  drivers/iommu/tegra-smmu.c |   10 ++++++++++
>>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> I would expect the binding documentation to be included with this patch
> instead of the previous one. Stephen?

I would certainly tend to include the documentation with the code, then
follow it later with a separate path that edits the .dts/.dtsi files.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Warren April 13, 2012, 7:35 p.m. UTC | #3
On 04/13/2012 04:23 AM, Hiroshi Doyu wrote:
> From: Hiroshi DOYU <hdoyu@nvidia.com>
> 
> Add device tree support for Tegra30 IOMMU(SMMU).

> diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c

> +#ifdef CONFIG_OF
> +static struct of_device_id tegra_smmu_of_match[] __devinitdata = {
> +	{ .compatible = "nvidia,tegra30-smmu", },
> +	{ },
> +};
> +#endif

You probably want to add the following here, inside the ifdef:

MODULE_DEVICE_TABLE(of, tegra_smmu_of_match);
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" 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/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index eb93c82..d4c7963 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -30,6 +30,7 @@ 
 #include <linux/sched.h>
 #include <linux/iommu.h>
 #include <linux/io.h>
+#include <linux/of.h>
 
 #include <asm/page.h>
 #include <asm/cacheflush.h>
@@ -1005,6 +1006,13 @@  const struct dev_pm_ops tegra_smmu_pm_ops = {
 	.resume		= tegra_smmu_resume,
 };
 
+#ifdef CONFIG_OF
+static struct of_device_id tegra_smmu_of_match[] __devinitdata = {
+	{ .compatible = "nvidia,tegra30-smmu", },
+	{ },
+};
+#endif
+
 static struct platform_driver tegra_smmu_driver = {
 	.probe		= tegra_smmu_probe,
 	.remove		= tegra_smmu_remove,
@@ -1012,6 +1020,7 @@  static struct platform_driver tegra_smmu_driver = {
 		.owner	= THIS_MODULE,
 		.name	= "tegra-smmu",
 		.pm	= &tegra_smmu_pm_ops,
+		.of_match_table = of_match_ptr(tegra_smmu_of_match),
 	},
 };
 
@@ -1031,4 +1040,5 @@  module_exit(tegra_smmu_exit);
 
 MODULE_DESCRIPTION("IOMMU API for SMMU in Tegra30");
 MODULE_AUTHOR("Hiroshi DOYU <hdoyu@nvidia.com>");
+MODULE_ALIAS("platform:tegra-smmu");
 MODULE_LICENSE("GPL v2");