aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-17 06:36:48 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-18 06:19:41 -0500
commite020f9af6d8311cd935217219f49175e161be100 (patch)
tree22fe43864e3238b8c51a12b3d4cf25202c7ec0f3 /drivers/video
parente296264977f68ddf395b8f93f8e174930f88499a (diff)
OMAP: DSS2: remove sub-panel system
The system to allow panel drivers to exists as attached to ctrl drivers did never work very well. It is not useed, and this patch removes it to make the driver cleaner. For now, controller drivers need to include also the panel driver code. In the future a proper mechanism for this should be developed, perhaps by creating busses for controllers. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/core.c35
-rw-r--r--drivers/video/omap2/dss/display.c32
2 files changed, 5 insertions, 62 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 72547dfc56b8..967cbda1fd72 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -771,11 +771,8 @@ static int dss_driver_probe(struct device *dev)
771 771
772 dss_init_device(core.pdev, dssdev); 772 dss_init_device(core.pdev, dssdev);
773 773
774 /* skip this if the device is behind a ctrl */ 774 force = pdata->default_device == dssdev;
775 if (!dssdev->panel.ctrl) { 775 dss_recheck_connections(dssdev, force);
776 force = pdata->default_device == dssdev;
777 dss_recheck_connections(dssdev, force);
778 }
779 776
780 r = dssdrv->probe(dssdev); 777 r = dssdrv->probe(dssdev);
781 778
@@ -861,8 +858,6 @@ static void omap_dss_dev_release(struct device *dev)
861int omap_dss_register_device(struct omap_dss_device *dssdev) 858int omap_dss_register_device(struct omap_dss_device *dssdev)
862{ 859{
863 static int dev_num; 860 static int dev_num;
864 static int panel_num;
865 int r;
866 861
867 WARN_ON(!dssdev->driver_name); 862 WARN_ON(!dssdev->driver_name);
868 863
@@ -871,36 +866,12 @@ int omap_dss_register_device(struct omap_dss_device *dssdev)
871 dssdev->dev.parent = &dss_bus; 866 dssdev->dev.parent = &dss_bus;
872 dssdev->dev.release = omap_dss_dev_release; 867 dssdev->dev.release = omap_dss_dev_release;
873 dev_set_name(&dssdev->dev, "display%d", dev_num++); 868 dev_set_name(&dssdev->dev, "display%d", dev_num++);
874 r = device_register(&dssdev->dev); 869 return device_register(&dssdev->dev);
875 if (r)
876 return r;
877
878 if (dssdev->ctrl.panel) {
879 struct omap_dss_device *panel = dssdev->ctrl.panel;
880
881 panel->panel.ctrl = dssdev;
882
883 reset_device(&panel->dev, 1);
884 panel->dev.bus = &dss_bus_type;
885 panel->dev.parent = &dssdev->dev;
886 panel->dev.release = omap_dss_dev_release;
887 dev_set_name(&panel->dev, "panel%d", panel_num++);
888 r = device_register(&panel->dev);
889 if (r)
890 return r;
891 }
892
893 return 0;
894} 870}
895 871
896void omap_dss_unregister_device(struct omap_dss_device *dssdev) 872void omap_dss_unregister_device(struct omap_dss_device *dssdev)
897{ 873{
898 device_unregister(&dssdev->dev); 874 device_unregister(&dssdev->dev);
899
900 if (dssdev->ctrl.panel) {
901 struct omap_dss_device *panel = dssdev->ctrl.panel;
902 device_unregister(&panel->dev);
903 }
904} 875}
905 876
906/* BUS */ 877/* BUS */
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 3b92b84b9560..3f345b8cbcb0 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -591,10 +591,6 @@ struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from)
591 591
592 int match(struct device *dev, void *data) 592 int match(struct device *dev, void *data)
593 { 593 {
594 /* skip panels connected to controllers */
595 if (to_dss_device(dev)->panel.ctrl)
596 return 0;
597
598 return 1; 594 return 1;
599 } 595 }
600 596
@@ -626,45 +622,21 @@ EXPORT_SYMBOL(omap_dss_find_device);
626 622
627int omap_dss_start_device(struct omap_dss_device *dssdev) 623int omap_dss_start_device(struct omap_dss_device *dssdev)
628{ 624{
629 int r;
630
631 if (!dssdev->driver) { 625 if (!dssdev->driver) {
632 DSSDBG("no driver\n"); 626 DSSDBG("no driver\n");
633 r = -ENODEV; 627 return -ENODEV;
634 goto err0;
635 }
636
637 if (dssdev->ctrl.panel && !dssdev->ctrl.panel->driver) {
638 DSSDBG("no panel driver\n");
639 r = -ENODEV;
640 goto err0;
641 } 628 }
642 629
643 if (!try_module_get(dssdev->dev.driver->owner)) { 630 if (!try_module_get(dssdev->dev.driver->owner)) {
644 r = -ENODEV; 631 return -ENODEV;
645 goto err0;
646 }
647
648 if (dssdev->ctrl.panel) {
649 if (!try_module_get(dssdev->ctrl.panel->dev.driver->owner)) {
650 r = -ENODEV;
651 goto err1;
652 }
653 } 632 }
654 633
655 return 0; 634 return 0;
656err1:
657 module_put(dssdev->dev.driver->owner);
658err0:
659 return r;
660} 635}
661EXPORT_SYMBOL(omap_dss_start_device); 636EXPORT_SYMBOL(omap_dss_start_device);
662 637
663void omap_dss_stop_device(struct omap_dss_device *dssdev) 638void omap_dss_stop_device(struct omap_dss_device *dssdev)
664{ 639{
665 if (dssdev->ctrl.panel)
666 module_put(dssdev->ctrl.panel->dev.driver->owner);
667
668 module_put(dssdev->dev.driver->owner); 640 module_put(dssdev->dev.driver->owner);
669} 641}
670EXPORT_SYMBOL(omap_dss_stop_device); 642EXPORT_SYMBOL(omap_dss_stop_device);