]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/video/fbdev/omap2/dss/dispc.c
Merge omapdss scaling fixes
[linux-beck.git] / drivers / video / fbdev / omap2 / dss / dispc.c
index f8c9115cdb4b9381b36fcb75084050f1c2b24e6e..be716c9ffb88a8bc998cc07ba42de950d55a2ac0 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
+#include <linux/component.h>
 
 #include <video/omapdss.h>
 
@@ -3773,7 +3774,7 @@ static void _omap_dispc_initial_config(void)
                dispc_init_mflag();
 }
 
-static const struct dispc_features omap24xx_dispc_feats __initconst = {
+static const struct dispc_features omap24xx_dispc_feats = {
        .sw_start               =       5,
        .fp_start               =       15,
        .bp_start               =       27,
@@ -3793,7 +3794,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = {
        .last_pixel_inc_missing =       true,
 };
 
-static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
+static const struct dispc_features omap34xx_rev1_0_dispc_feats = {
        .sw_start               =       5,
        .fp_start               =       15,
        .bp_start               =       27,
@@ -3814,7 +3815,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = {
        .last_pixel_inc_missing =       true,
 };
 
-static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
+static const struct dispc_features omap34xx_rev3_0_dispc_feats = {
        .sw_start               =       7,
        .fp_start               =       19,
        .bp_start               =       31,
@@ -3835,7 +3836,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = {
        .last_pixel_inc_missing =       true,
 };
 
-static const struct dispc_features omap44xx_dispc_feats __initconst = {
+static const struct dispc_features omap44xx_dispc_feats = {
        .sw_start               =       7,
        .fp_start               =       19,
        .bp_start               =       31,
@@ -3855,7 +3856,7 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
        .set_max_preload        =       true,
 };
 
-static const struct dispc_features omap54xx_dispc_feats __initconst = {
+static const struct dispc_features omap54xx_dispc_feats = {
        .sw_start               =       7,
        .fp_start               =       19,
        .bp_start               =       31,
@@ -3876,7 +3877,7 @@ static const struct dispc_features omap54xx_dispc_feats __initconst = {
        .set_max_preload        =       true,
 };
 
-static int __init dispc_init_features(struct platform_device *pdev)
+static int dispc_init_features(struct platform_device *pdev)
 {
        const struct dispc_features *src;
        struct dispc_features *dst;
@@ -3966,8 +3967,9 @@ void dispc_free_irq(void *dev_id)
 EXPORT_SYMBOL(dispc_free_irq);
 
 /* DISPC HW IP initialisation */
-static int __init omap_dispchw_probe(struct platform_device *pdev)
+static int dispc_bind(struct device *dev, struct device *master, void *data)
 {
+       struct platform_device *pdev = to_platform_device(dev);
        u32 rev;
        int r = 0;
        struct resource *dispc_mem;
@@ -4039,12 +4041,27 @@ err_runtime_get:
        return r;
 }
 
-static int __exit omap_dispchw_remove(struct platform_device *pdev)
+static void dispc_unbind(struct device *dev, struct device *master,
+                              void *data)
 {
-       pm_runtime_disable(&pdev->dev);
+       pm_runtime_disable(dev);
 
        dss_uninit_overlay_managers();
+}
+
+static const struct component_ops dispc_component_ops = {
+       .bind   = dispc_bind,
+       .unbind = dispc_unbind,
+};
 
+static int dispc_probe(struct platform_device *pdev)
+{
+       return component_add(&pdev->dev, &dispc_component_ops);
+}
+
+static int dispc_remove(struct platform_device *pdev)
+{
+       component_del(&pdev->dev, &dispc_component_ops);
        return 0;
 }
 
@@ -4097,7 +4114,8 @@ static const struct of_device_id dispc_of_match[] = {
 };
 
 static struct platform_driver omap_dispchw_driver = {
-       .remove         = __exit_p(omap_dispchw_remove),
+       .probe          = dispc_probe,
+       .remove         = dispc_remove,
        .driver         = {
                .name   = "omapdss_dispc",
                .pm     = &dispc_pm_ops,
@@ -4108,10 +4126,10 @@ static struct platform_driver omap_dispchw_driver = {
 
 int __init dispc_init_platform_driver(void)
 {
-       return platform_driver_probe(&omap_dispchw_driver, omap_dispchw_probe);
+       return platform_driver_register(&omap_dispchw_driver);
 }
 
-void __exit dispc_uninit_platform_driver(void)
+void dispc_uninit_platform_driver(void)
 {
        platform_driver_unregister(&omap_dispchw_driver);
 }