]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
soc/tegra: edp: Allow the GPU EDP driver to defer the probe
authorJon Hunter <jonathanh@nvidia.com>
Tue, 6 Dec 2016 15:32:41 +0000 (15:32 +0000)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 21 Dec 2016 07:05:40 +0000 (23:05 -0800)
The parent clock for the GPU clock 'gbus' may not be register before
the 'gbus' is registered. So although we can successfully obtain the
'gbus' required by the GPU EDP driver, the call to determine the max
rate for the 'gbus' may fail because the parent is not present.
Therefore, allow the probe to be deferred if we fail to get the max
rate for 'gbus' in case the parent clock has not been registered.

Bug 1811732

Change-Id: Ic31ae4205e8568b015e863240c95ea8959d69630
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1266679
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
drivers/soc/tegra/tegra-gpu-edp.c

index 264caed785c7e7196c10cdafcaab9728be1d6be1..0a4cb59a185afbe044a3ce667d5aa6d6ed59cca9 100644 (file)
@@ -163,8 +163,7 @@ static int store_edp_max(void *data, u64 val)
 }
 DEFINE_SIMPLE_ATTRIBUTE(edp_max_fops, show_edp_max, store_edp_max, "%llu\n");
 
-static int __init tegra_edp_debugfs_init(struct device *dev,
-                                        struct gpu_edp *ctx)
+static int tegra_edp_debugfs_init(struct device *dev, struct gpu_edp *ctx)
 {
        struct dentry *edp_dir;
        struct edp_attrs *attr;
@@ -194,12 +193,12 @@ static int __init tegra_edp_debugfs_init(struct device *dev,
        return 0;
 }
 #else
-static int __init tegra_edp_debugfs_init(void)
+static int tegra_edp_debugfs_init(void)
 { return 0; }
 #endif /* CONFIG_DEBUG_FS */
 
-static int __init tegra_gpu_edp_parse_dt(struct platform_device *pdev,
-                                        struct gpu_edp_platform_data *pdata)
+static int tegra_gpu_edp_parse_dt(struct platform_device *pdev,
+                                 struct gpu_edp_platform_data *pdata)
 {
 
        struct device_node *np = pdev->dev.of_node;
@@ -219,7 +218,7 @@ static int __init tegra_gpu_edp_parse_dt(struct platform_device *pdev,
        return 0;
 }
 
-static int __init tegra_gpu_edp_probe(struct platform_device *pdev)
+static int tegra_gpu_edp_probe(struct platform_device *pdev)
 {
        struct clk *gpu_clk;
        struct fv_relation *fv = NULL;
@@ -357,14 +356,10 @@ static struct platform_driver tegra_gpu_edp_driver = {
                .owner = THIS_MODULE,
                .of_match_table = tegra_gpu_edp_of_match,
        },
+       .probe = tegra_gpu_edp_probe,
 };
 
-static int __init tegra_gpu_edp_driver_init(void)
-{
-       return platform_driver_probe(&tegra_gpu_edp_driver,
-                                    tegra_gpu_edp_probe);
-}
-module_init(tegra_gpu_edp_driver_init);
+module_platform_driver(tegra_gpu_edp_driver);
 
 MODULE_AUTHOR("NVIDIA Corp.");
 MODULE_DESCRIPTION("Tegra GPU EDP management");