]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
misc: tegra_cec: add DT matching entry
authorXia Yang <xiay@nvidia.com>
Wed, 2 Jul 2014 22:39:38 +0000 (15:39 -0700)
committerLaxman Dewangan <ldewangan@nvidia.com>
Tue, 15 Jul 2014 07:11:20 +0000 (00:11 -0700)
Auxdata still have to be provided in of_platform_populate()
during early boot device detection to get the device correctly
named as "tegra_cec".  Failing to do so will result in device
probe failure as of_device_make_bus_id() will name the device
as "[phys_base].tegra_cec" and cause clock assignment failure.

Bug 200013561

Change-Id: Ib0f898f89146cba7f02cffb768c6a2eb558400ce
Signed-off-by: Xia Yang <xiay@nvidia.com>
Reviewed-on: http://git-master/r/433871
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/misc/tegra-cec/tegra_cec.c

index e162996fdfc44b8c7b2350cacd8ce5aef9669208..3c8f23f94188f3ce1232e3c5cf6d0ab958b63007 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/platform_device.h>
 #include <linux/miscdevice.h>
 #include <linux/clk/tegra.h>
+#include <linux/of.h>
 
 #include "tegra_cec.h"
 
@@ -450,6 +451,11 @@ static int tegra_cec_probe(struct platform_device *pdev)
                goto cec_error;
        }
 
+       dev_info(&pdev->dev, "dt=%d start=0x%08llX end=0x%08llX irq=%d\n",
+               (pdev->dev.of_node != NULL),
+               res->start, res->end,
+               cec->tegra_cec_irq);
+
        atomic_set(&cec->init_done, 0);
        mutex_init(&cec->tx_lock);
 
@@ -557,10 +563,19 @@ static int tegra_cec_resume(struct platform_device *pdev)
 }
 #endif
 
+static struct of_device_id tegra_cec_of_match[] = {
+       { .compatible = "nvidia,tegra114-cec", },
+       { .compatible = "nvidia,tegra124-cec", },
+       { .compatible = "nvidia,tegra210-cec", },
+       {},
+};
+
 static struct platform_driver tegra_cec_driver = {
        .driver = {
                .name = TEGRA_CEC_NAME,
                .owner = THIS_MODULE,
+
+               .of_match_table = of_match_ptr(tegra_cec_of_match),
        },
        .probe = tegra_cec_probe,
        .remove = tegra_cec_remove,