diff options
author | Dave Airlie <airlied@redhat.com> | 2013-05-02 20:10:23 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-05-02 20:10:23 -0400 |
commit | 7e17fc0b69fbec2c25398adfb18a18fa6b210a53 (patch) | |
tree | 3fab05a131aff7aa4e69923af0d390e17aefc0d3 | |
parent | 6110948846e9440a60e491a9be67a8a13c646b7e (diff) | |
parent | bca3913034ef99c9cc028d054273a3b271ed62b9 (diff) |
Merge tag 'omapdss-for-3.10-fixes' of git://gitorious.org/linux-omap-dss2/linux into drm-next
OMAPDSS fixes for 3.10:
* Compilation fix when DSI is disabled in Kconfig
* Basic deferred probe support to fix DT boot
* tag 'omapdss-for-3.10-fixes' of git://gitorious.org/linux-omap-dss2/linux:
OMAPDSS: TFP410: return EPROBE_DEFER if the i2c adapter not found
OMAPDSS: VENC: Add error handling for venc_probe_pdata
OMAPDSS: HDMI: Add error handling for hdmi_probe_pdata
OMAPDSS: RFBI: Add error handling for rfbi_probe_pdata
OMAPDSS: DSI: Add error handling for dsi_probe_pdata
OMAPDSS: SDI: Add error handling for sdi_probe_pdata
OMAPDSS: DPI: Add error handling for dpi_probe_pdata
OMAPDSS: VENC: use platform_driver_register()
OMAPDSS: HDMI: use platform_driver_register()
OMAPDSS: RFBI: use platform_driver_register()
OMAPDSS: DSI: use platform_driver_register()
OMAPDSS: SDI: use platform_driver_register()
OMAPDSS: DPI: use platform_driver_register()
OMAPFB: defer probe if no displays
OMAPFB: use module_platform_driver()
OMAPDSS: Makefile: move omapfb after panels
OMAPDSS: DPI: fix compilation if DSI not compiled in
-rw-r--r-- | drivers/video/omap2/Makefile | 2 | ||||
-rw-r--r-- | drivers/video/omap2/displays/panel-tfp410.c | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dpi.c | 35 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 35 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 31 | ||||
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 33 | ||||
-rw-r--r-- | drivers/video/omap2/dss/rfbi.c | 32 | ||||
-rw-r--r-- | drivers/video/omap2/dss/sdi.c | 33 | ||||
-rw-r--r-- | drivers/video/omap2/dss/venc.c | 33 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 30 |
10 files changed, 160 insertions, 106 deletions
diff --git a/drivers/video/omap2/Makefile b/drivers/video/omap2/Makefile index 5ea7cb9aed17..296e5c5281c5 100644 --- a/drivers/video/omap2/Makefile +++ b/drivers/video/omap2/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | obj-$(CONFIG_OMAP2_VRFB) += vrfb.o | 1 | obj-$(CONFIG_OMAP2_VRFB) += vrfb.o |
2 | 2 | ||
3 | obj-$(CONFIG_OMAP2_DSS) += dss/ | 3 | obj-$(CONFIG_OMAP2_DSS) += dss/ |
4 | obj-$(CONFIG_FB_OMAP2) += omapfb/ | ||
5 | obj-y += displays/ | 4 | obj-y += displays/ |
5 | obj-$(CONFIG_FB_OMAP2) += omapfb/ | ||
diff --git a/drivers/video/omap2/displays/panel-tfp410.c b/drivers/video/omap2/displays/panel-tfp410.c index a1dba868cef1..46039c4bf1ed 100644 --- a/drivers/video/omap2/displays/panel-tfp410.c +++ b/drivers/video/omap2/displays/panel-tfp410.c | |||
@@ -135,7 +135,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev) | |||
135 | if (!adapter) { | 135 | if (!adapter) { |
136 | dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n", | 136 | dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n", |
137 | i2c_bus_num); | 137 | i2c_bus_num); |
138 | return -EINVAL; | 138 | return -EPROBE_DEFER; |
139 | } | 139 | } |
140 | 140 | ||
141 | ddata->i2c_adapter = adapter; | 141 | ddata->i2c_adapter = adapter; |
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index e93c4debea7f..757b57f7275a 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c | |||
@@ -520,7 +520,7 @@ void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines) | |||
520 | } | 520 | } |
521 | EXPORT_SYMBOL(omapdss_dpi_set_data_lines); | 521 | EXPORT_SYMBOL(omapdss_dpi_set_data_lines); |
522 | 522 | ||
523 | static int __init dpi_verify_dsi_pll(struct platform_device *dsidev) | 523 | static int dpi_verify_dsi_pll(struct platform_device *dsidev) |
524 | { | 524 | { |
525 | int r; | 525 | int r; |
526 | 526 | ||
@@ -572,7 +572,7 @@ static enum omap_channel dpi_get_channel(void) | |||
572 | } | 572 | } |
573 | } | 573 | } |
574 | 574 | ||
575 | static int __init dpi_init_display(struct omap_dss_device *dssdev) | 575 | static int dpi_init_display(struct omap_dss_device *dssdev) |
576 | { | 576 | { |
577 | struct platform_device *dsidev; | 577 | struct platform_device *dsidev; |
578 | 578 | ||
@@ -607,7 +607,7 @@ static int __init dpi_init_display(struct omap_dss_device *dssdev) | |||
607 | return 0; | 607 | return 0; |
608 | } | 608 | } |
609 | 609 | ||
610 | static struct omap_dss_device * __init dpi_find_dssdev(struct platform_device *pdev) | 610 | static struct omap_dss_device *dpi_find_dssdev(struct platform_device *pdev) |
611 | { | 611 | { |
612 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 612 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
613 | const char *def_disp_name = omapdss_get_default_display_name(); | 613 | const char *def_disp_name = omapdss_get_default_display_name(); |
@@ -635,7 +635,7 @@ static struct omap_dss_device * __init dpi_find_dssdev(struct platform_device *p | |||
635 | return def_dssdev; | 635 | return def_dssdev; |
636 | } | 636 | } |
637 | 637 | ||
638 | static void __init dpi_probe_pdata(struct platform_device *dpidev) | 638 | static int dpi_probe_pdata(struct platform_device *dpidev) |
639 | { | 639 | { |
640 | struct omap_dss_device *plat_dssdev; | 640 | struct omap_dss_device *plat_dssdev; |
641 | struct omap_dss_device *dssdev; | 641 | struct omap_dss_device *dssdev; |
@@ -644,11 +644,11 @@ static void __init dpi_probe_pdata(struct platform_device *dpidev) | |||
644 | plat_dssdev = dpi_find_dssdev(dpidev); | 644 | plat_dssdev = dpi_find_dssdev(dpidev); |
645 | 645 | ||
646 | if (!plat_dssdev) | 646 | if (!plat_dssdev) |
647 | return; | 647 | return 0; |
648 | 648 | ||
649 | dssdev = dss_alloc_and_init_device(&dpidev->dev); | 649 | dssdev = dss_alloc_and_init_device(&dpidev->dev); |
650 | if (!dssdev) | 650 | if (!dssdev) |
651 | return; | 651 | return -ENOMEM; |
652 | 652 | ||
653 | dss_copy_device_pdata(dssdev, plat_dssdev); | 653 | dss_copy_device_pdata(dssdev, plat_dssdev); |
654 | 654 | ||
@@ -656,7 +656,7 @@ static void __init dpi_probe_pdata(struct platform_device *dpidev) | |||
656 | if (r) { | 656 | if (r) { |
657 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 657 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
658 | dss_put_device(dssdev); | 658 | dss_put_device(dssdev); |
659 | return; | 659 | return r; |
660 | } | 660 | } |
661 | 661 | ||
662 | r = omapdss_output_set_device(&dpi.output, dssdev); | 662 | r = omapdss_output_set_device(&dpi.output, dssdev); |
@@ -664,7 +664,7 @@ static void __init dpi_probe_pdata(struct platform_device *dpidev) | |||
664 | DSSERR("failed to connect output to new device: %s\n", | 664 | DSSERR("failed to connect output to new device: %s\n", |
665 | dssdev->name); | 665 | dssdev->name); |
666 | dss_put_device(dssdev); | 666 | dss_put_device(dssdev); |
667 | return; | 667 | return r; |
668 | } | 668 | } |
669 | 669 | ||
670 | r = dss_add_device(dssdev); | 670 | r = dss_add_device(dssdev); |
@@ -672,11 +672,13 @@ static void __init dpi_probe_pdata(struct platform_device *dpidev) | |||
672 | DSSERR("device %s register failed: %d\n", dssdev->name, r); | 672 | DSSERR("device %s register failed: %d\n", dssdev->name, r); |
673 | omapdss_output_unset_device(&dpi.output); | 673 | omapdss_output_unset_device(&dpi.output); |
674 | dss_put_device(dssdev); | 674 | dss_put_device(dssdev); |
675 | return; | 675 | return r; |
676 | } | 676 | } |
677 | |||
678 | return 0; | ||
677 | } | 679 | } |
678 | 680 | ||
679 | static void __init dpi_init_output(struct platform_device *pdev) | 681 | static void dpi_init_output(struct platform_device *pdev) |
680 | { | 682 | { |
681 | struct omap_dss_output *out = &dpi.output; | 683 | struct omap_dss_output *out = &dpi.output; |
682 | 684 | ||
@@ -696,13 +698,19 @@ static void __exit dpi_uninit_output(struct platform_device *pdev) | |||
696 | dss_unregister_output(out); | 698 | dss_unregister_output(out); |
697 | } | 699 | } |
698 | 700 | ||
699 | static int __init omap_dpi_probe(struct platform_device *pdev) | 701 | static int omap_dpi_probe(struct platform_device *pdev) |
700 | { | 702 | { |
703 | int r; | ||
704 | |||
701 | mutex_init(&dpi.lock); | 705 | mutex_init(&dpi.lock); |
702 | 706 | ||
703 | dpi_init_output(pdev); | 707 | dpi_init_output(pdev); |
704 | 708 | ||
705 | dpi_probe_pdata(pdev); | 709 | r = dpi_probe_pdata(pdev); |
710 | if (r) { | ||
711 | dpi_uninit_output(pdev); | ||
712 | return r; | ||
713 | } | ||
706 | 714 | ||
707 | return 0; | 715 | return 0; |
708 | } | 716 | } |
@@ -717,6 +725,7 @@ static int __exit omap_dpi_remove(struct platform_device *pdev) | |||
717 | } | 725 | } |
718 | 726 | ||
719 | static struct platform_driver omap_dpi_driver = { | 727 | static struct platform_driver omap_dpi_driver = { |
728 | .probe = omap_dpi_probe, | ||
720 | .remove = __exit_p(omap_dpi_remove), | 729 | .remove = __exit_p(omap_dpi_remove), |
721 | .driver = { | 730 | .driver = { |
722 | .name = "omapdss_dpi", | 731 | .name = "omapdss_dpi", |
@@ -726,7 +735,7 @@ static struct platform_driver omap_dpi_driver = { | |||
726 | 735 | ||
727 | int __init dpi_init_platform_driver(void) | 736 | int __init dpi_init_platform_driver(void) |
728 | { | 737 | { |
729 | return platform_driver_probe(&omap_dpi_driver, omap_dpi_probe); | 738 | return platform_driver_register(&omap_dpi_driver); |
730 | } | 739 | } |
731 | 740 | ||
732 | void __exit dpi_uninit_platform_driver(void) | 741 | void __exit dpi_uninit_platform_driver(void) |
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 9b1c5ecee115..a73dedc33101 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -5225,7 +5225,7 @@ static enum omap_channel dsi_get_channel(int module_id) | |||
5225 | } | 5225 | } |
5226 | } | 5226 | } |
5227 | 5227 | ||
5228 | static int __init dsi_init_display(struct omap_dss_device *dssdev) | 5228 | static int dsi_init_display(struct omap_dss_device *dssdev) |
5229 | { | 5229 | { |
5230 | struct platform_device *dsidev = | 5230 | struct platform_device *dsidev = |
5231 | dsi_get_dsidev_from_id(dssdev->phy.dsi.module); | 5231 | dsi_get_dsidev_from_id(dssdev->phy.dsi.module); |
@@ -5366,7 +5366,7 @@ static int dsi_get_clocks(struct platform_device *dsidev) | |||
5366 | return 0; | 5366 | return 0; |
5367 | } | 5367 | } |
5368 | 5368 | ||
5369 | static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *pdev) | 5369 | static struct omap_dss_device *dsi_find_dssdev(struct platform_device *pdev) |
5370 | { | 5370 | { |
5371 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 5371 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
5372 | struct dsi_data *dsi = dsi_get_dsidrv_data(pdev); | 5372 | struct dsi_data *dsi = dsi_get_dsidrv_data(pdev); |
@@ -5398,7 +5398,7 @@ static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *p | |||
5398 | return def_dssdev; | 5398 | return def_dssdev; |
5399 | } | 5399 | } |
5400 | 5400 | ||
5401 | static void __init dsi_probe_pdata(struct platform_device *dsidev) | 5401 | static int dsi_probe_pdata(struct platform_device *dsidev) |
5402 | { | 5402 | { |
5403 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 5403 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
5404 | struct omap_dss_device *plat_dssdev; | 5404 | struct omap_dss_device *plat_dssdev; |
@@ -5408,11 +5408,11 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev) | |||
5408 | plat_dssdev = dsi_find_dssdev(dsidev); | 5408 | plat_dssdev = dsi_find_dssdev(dsidev); |
5409 | 5409 | ||
5410 | if (!plat_dssdev) | 5410 | if (!plat_dssdev) |
5411 | return; | 5411 | return 0; |
5412 | 5412 | ||
5413 | dssdev = dss_alloc_and_init_device(&dsidev->dev); | 5413 | dssdev = dss_alloc_and_init_device(&dsidev->dev); |
5414 | if (!dssdev) | 5414 | if (!dssdev) |
5415 | return; | 5415 | return -ENOMEM; |
5416 | 5416 | ||
5417 | dss_copy_device_pdata(dssdev, plat_dssdev); | 5417 | dss_copy_device_pdata(dssdev, plat_dssdev); |
5418 | 5418 | ||
@@ -5420,7 +5420,7 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev) | |||
5420 | if (r) { | 5420 | if (r) { |
5421 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 5421 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
5422 | dss_put_device(dssdev); | 5422 | dss_put_device(dssdev); |
5423 | return; | 5423 | return r; |
5424 | } | 5424 | } |
5425 | 5425 | ||
5426 | r = omapdss_output_set_device(&dsi->output, dssdev); | 5426 | r = omapdss_output_set_device(&dsi->output, dssdev); |
@@ -5428,7 +5428,7 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev) | |||
5428 | DSSERR("failed to connect output to new device: %s\n", | 5428 | DSSERR("failed to connect output to new device: %s\n", |
5429 | dssdev->name); | 5429 | dssdev->name); |
5430 | dss_put_device(dssdev); | 5430 | dss_put_device(dssdev); |
5431 | return; | 5431 | return r; |
5432 | } | 5432 | } |
5433 | 5433 | ||
5434 | r = dss_add_device(dssdev); | 5434 | r = dss_add_device(dssdev); |
@@ -5436,11 +5436,13 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev) | |||
5436 | DSSERR("device %s register failed: %d\n", dssdev->name, r); | 5436 | DSSERR("device %s register failed: %d\n", dssdev->name, r); |
5437 | omapdss_output_unset_device(&dsi->output); | 5437 | omapdss_output_unset_device(&dsi->output); |
5438 | dss_put_device(dssdev); | 5438 | dss_put_device(dssdev); |
5439 | return; | 5439 | return r; |
5440 | } | 5440 | } |
5441 | |||
5442 | return 0; | ||
5441 | } | 5443 | } |
5442 | 5444 | ||
5443 | static void __init dsi_init_output(struct platform_device *dsidev) | 5445 | static void dsi_init_output(struct platform_device *dsidev) |
5444 | { | 5446 | { |
5445 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 5447 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
5446 | struct omap_dss_output *out = &dsi->output; | 5448 | struct omap_dss_output *out = &dsi->output; |
@@ -5456,7 +5458,7 @@ static void __init dsi_init_output(struct platform_device *dsidev) | |||
5456 | dss_register_output(out); | 5458 | dss_register_output(out); |
5457 | } | 5459 | } |
5458 | 5460 | ||
5459 | static void __exit dsi_uninit_output(struct platform_device *dsidev) | 5461 | static void dsi_uninit_output(struct platform_device *dsidev) |
5460 | { | 5462 | { |
5461 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 5463 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
5462 | struct omap_dss_output *out = &dsi->output; | 5464 | struct omap_dss_output *out = &dsi->output; |
@@ -5465,7 +5467,7 @@ static void __exit dsi_uninit_output(struct platform_device *dsidev) | |||
5465 | } | 5467 | } |
5466 | 5468 | ||
5467 | /* DSI1 HW IP initialisation */ | 5469 | /* DSI1 HW IP initialisation */ |
5468 | static int __init omap_dsihw_probe(struct platform_device *dsidev) | 5470 | static int omap_dsihw_probe(struct platform_device *dsidev) |
5469 | { | 5471 | { |
5470 | u32 rev; | 5472 | u32 rev; |
5471 | int r, i; | 5473 | int r, i; |
@@ -5561,7 +5563,13 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev) | |||
5561 | 5563 | ||
5562 | dsi_init_output(dsidev); | 5564 | dsi_init_output(dsidev); |
5563 | 5565 | ||
5564 | dsi_probe_pdata(dsidev); | 5566 | r = dsi_probe_pdata(dsidev); |
5567 | if (r) { | ||
5568 | dsi_runtime_put(dsidev); | ||
5569 | dsi_uninit_output(dsidev); | ||
5570 | pm_runtime_disable(&dsidev->dev); | ||
5571 | return r; | ||
5572 | } | ||
5565 | 5573 | ||
5566 | dsi_runtime_put(dsidev); | 5574 | dsi_runtime_put(dsidev); |
5567 | 5575 | ||
@@ -5632,6 +5640,7 @@ static const struct dev_pm_ops dsi_pm_ops = { | |||
5632 | }; | 5640 | }; |
5633 | 5641 | ||
5634 | static struct platform_driver omap_dsihw_driver = { | 5642 | static struct platform_driver omap_dsihw_driver = { |
5643 | .probe = omap_dsihw_probe, | ||
5635 | .remove = __exit_p(omap_dsihw_remove), | 5644 | .remove = __exit_p(omap_dsihw_remove), |
5636 | .driver = { | 5645 | .driver = { |
5637 | .name = "omapdss_dsi", | 5646 | .name = "omapdss_dsi", |
@@ -5642,7 +5651,7 @@ static struct platform_driver omap_dsihw_driver = { | |||
5642 | 5651 | ||
5643 | int __init dsi_init_platform_driver(void) | 5652 | int __init dsi_init_platform_driver(void) |
5644 | { | 5653 | { |
5645 | return platform_driver_probe(&omap_dsihw_driver, omap_dsihw_probe); | 5654 | return platform_driver_register(&omap_dsihw_driver); |
5646 | } | 5655 | } |
5647 | 5656 | ||
5648 | void __exit dsi_uninit_platform_driver(void) | 5657 | void __exit dsi_uninit_platform_driver(void) |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index faaf35857b0e..84758936429d 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -277,6 +277,12 @@ int sdi_init_platform_driver(void) __init; | |||
277 | void sdi_uninit_platform_driver(void) __exit; | 277 | void sdi_uninit_platform_driver(void) __exit; |
278 | 278 | ||
279 | /* DSI */ | 279 | /* DSI */ |
280 | |||
281 | typedef bool (*dsi_pll_calc_func)(int regn, int regm, unsigned long fint, | ||
282 | unsigned long pll, void *data); | ||
283 | typedef bool (*dsi_hsdiv_calc_func)(int regm_dispc, unsigned long dispc, | ||
284 | void *data); | ||
285 | |||
280 | #ifdef CONFIG_OMAP2_DSS_DSI | 286 | #ifdef CONFIG_OMAP2_DSS_DSI |
281 | 287 | ||
282 | struct dentry; | 288 | struct dentry; |
@@ -295,10 +301,6 @@ u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt); | |||
295 | 301 | ||
296 | unsigned long dsi_get_pll_clkin(struct platform_device *dsidev); | 302 | unsigned long dsi_get_pll_clkin(struct platform_device *dsidev); |
297 | 303 | ||
298 | typedef bool (*dsi_pll_calc_func)(int regn, int regm, unsigned long fint, | ||
299 | unsigned long pll, void *data); | ||
300 | typedef bool (*dsi_hsdiv_calc_func)(int regm_dispc, unsigned long dispc, | ||
301 | void *data); | ||
302 | bool dsi_hsdiv_calc(struct platform_device *dsidev, unsigned long pll, | 304 | bool dsi_hsdiv_calc(struct platform_device *dsidev, unsigned long pll, |
303 | unsigned long out_min, dsi_hsdiv_calc_func func, void *data); | 305 | unsigned long out_min, dsi_hsdiv_calc_func func, void *data); |
304 | bool dsi_pll_calc(struct platform_device *dsidev, unsigned long clkin, | 306 | bool dsi_pll_calc(struct platform_device *dsidev, unsigned long clkin, |
@@ -358,6 +360,27 @@ static inline struct platform_device *dsi_get_dsidev_from_id(int module) | |||
358 | { | 360 | { |
359 | return NULL; | 361 | return NULL; |
360 | } | 362 | } |
363 | |||
364 | static inline unsigned long dsi_get_pll_clkin(struct platform_device *dsidev) | ||
365 | { | ||
366 | return 0; | ||
367 | } | ||
368 | |||
369 | static inline bool dsi_hsdiv_calc(struct platform_device *dsidev, | ||
370 | unsigned long pll, unsigned long out_min, | ||
371 | dsi_hsdiv_calc_func func, void *data) | ||
372 | { | ||
373 | return false; | ||
374 | } | ||
375 | |||
376 | static inline bool dsi_pll_calc(struct platform_device *dsidev, | ||
377 | unsigned long clkin, | ||
378 | unsigned long pll_min, unsigned long pll_max, | ||
379 | dsi_pll_calc_func func, void *data) | ||
380 | { | ||
381 | return false; | ||
382 | } | ||
383 | |||
361 | #endif | 384 | #endif |
362 | 385 | ||
363 | /* DPI */ | 386 | /* DPI */ |
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 79393099d505..17f4d55c621c 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -328,7 +328,7 @@ static void hdmi_runtime_put(void) | |||
328 | WARN_ON(r < 0 && r != -ENOSYS); | 328 | WARN_ON(r < 0 && r != -ENOSYS); |
329 | } | 329 | } |
330 | 330 | ||
331 | static int __init hdmi_init_display(struct omap_dss_device *dssdev) | 331 | static int hdmi_init_display(struct omap_dss_device *dssdev) |
332 | { | 332 | { |
333 | int r; | 333 | int r; |
334 | 334 | ||
@@ -954,7 +954,7 @@ int hdmi_audio_config(struct omap_dss_audio *audio) | |||
954 | 954 | ||
955 | #endif | 955 | #endif |
956 | 956 | ||
957 | static struct omap_dss_device * __init hdmi_find_dssdev(struct platform_device *pdev) | 957 | static struct omap_dss_device *hdmi_find_dssdev(struct platform_device *pdev) |
958 | { | 958 | { |
959 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 959 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
960 | const char *def_disp_name = omapdss_get_default_display_name(); | 960 | const char *def_disp_name = omapdss_get_default_display_name(); |
@@ -982,7 +982,7 @@ static struct omap_dss_device * __init hdmi_find_dssdev(struct platform_device * | |||
982 | return def_dssdev; | 982 | return def_dssdev; |
983 | } | 983 | } |
984 | 984 | ||
985 | static void __init hdmi_probe_pdata(struct platform_device *pdev) | 985 | static int hdmi_probe_pdata(struct platform_device *pdev) |
986 | { | 986 | { |
987 | struct omap_dss_device *plat_dssdev; | 987 | struct omap_dss_device *plat_dssdev; |
988 | struct omap_dss_device *dssdev; | 988 | struct omap_dss_device *dssdev; |
@@ -992,11 +992,11 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev) | |||
992 | plat_dssdev = hdmi_find_dssdev(pdev); | 992 | plat_dssdev = hdmi_find_dssdev(pdev); |
993 | 993 | ||
994 | if (!plat_dssdev) | 994 | if (!plat_dssdev) |
995 | return; | 995 | return 0; |
996 | 996 | ||
997 | dssdev = dss_alloc_and_init_device(&pdev->dev); | 997 | dssdev = dss_alloc_and_init_device(&pdev->dev); |
998 | if (!dssdev) | 998 | if (!dssdev) |
999 | return; | 999 | return -ENOMEM; |
1000 | 1000 | ||
1001 | dss_copy_device_pdata(dssdev, plat_dssdev); | 1001 | dss_copy_device_pdata(dssdev, plat_dssdev); |
1002 | 1002 | ||
@@ -1010,7 +1010,7 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev) | |||
1010 | if (r) { | 1010 | if (r) { |
1011 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 1011 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
1012 | dss_put_device(dssdev); | 1012 | dss_put_device(dssdev); |
1013 | return; | 1013 | return r; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | r = omapdss_output_set_device(&hdmi.output, dssdev); | 1016 | r = omapdss_output_set_device(&hdmi.output, dssdev); |
@@ -1018,7 +1018,7 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev) | |||
1018 | DSSERR("failed to connect output to new device: %s\n", | 1018 | DSSERR("failed to connect output to new device: %s\n", |
1019 | dssdev->name); | 1019 | dssdev->name); |
1020 | dss_put_device(dssdev); | 1020 | dss_put_device(dssdev); |
1021 | return; | 1021 | return r; |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | r = dss_add_device(dssdev); | 1024 | r = dss_add_device(dssdev); |
@@ -1027,11 +1027,13 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev) | |||
1027 | omapdss_output_unset_device(&hdmi.output); | 1027 | omapdss_output_unset_device(&hdmi.output); |
1028 | hdmi_uninit_display(dssdev); | 1028 | hdmi_uninit_display(dssdev); |
1029 | dss_put_device(dssdev); | 1029 | dss_put_device(dssdev); |
1030 | return; | 1030 | return r; |
1031 | } | 1031 | } |
1032 | |||
1033 | return 0; | ||
1032 | } | 1034 | } |
1033 | 1035 | ||
1034 | static void __init hdmi_init_output(struct platform_device *pdev) | 1036 | static void hdmi_init_output(struct platform_device *pdev) |
1035 | { | 1037 | { |
1036 | struct omap_dss_output *out = &hdmi.output; | 1038 | struct omap_dss_output *out = &hdmi.output; |
1037 | 1039 | ||
@@ -1052,7 +1054,7 @@ static void __exit hdmi_uninit_output(struct platform_device *pdev) | |||
1052 | } | 1054 | } |
1053 | 1055 | ||
1054 | /* HDMI HW IP initialisation */ | 1056 | /* HDMI HW IP initialisation */ |
1055 | static int __init omapdss_hdmihw_probe(struct platform_device *pdev) | 1057 | static int omapdss_hdmihw_probe(struct platform_device *pdev) |
1056 | { | 1058 | { |
1057 | struct resource *res; | 1059 | struct resource *res; |
1058 | int r; | 1060 | int r; |
@@ -1096,7 +1098,13 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) | |||
1096 | 1098 | ||
1097 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); | 1099 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); |
1098 | 1100 | ||
1099 | hdmi_probe_pdata(pdev); | 1101 | r = hdmi_probe_pdata(pdev); |
1102 | if (r) { | ||
1103 | hdmi_panel_exit(); | ||
1104 | hdmi_uninit_output(pdev); | ||
1105 | pm_runtime_disable(&pdev->dev); | ||
1106 | return r; | ||
1107 | } | ||
1100 | 1108 | ||
1101 | return 0; | 1109 | return 0; |
1102 | } | 1110 | } |
@@ -1151,6 +1159,7 @@ static const struct dev_pm_ops hdmi_pm_ops = { | |||
1151 | }; | 1159 | }; |
1152 | 1160 | ||
1153 | static struct platform_driver omapdss_hdmihw_driver = { | 1161 | static struct platform_driver omapdss_hdmihw_driver = { |
1162 | .probe = omapdss_hdmihw_probe, | ||
1154 | .remove = __exit_p(omapdss_hdmihw_remove), | 1163 | .remove = __exit_p(omapdss_hdmihw_remove), |
1155 | .driver = { | 1164 | .driver = { |
1156 | .name = "omapdss_hdmi", | 1165 | .name = "omapdss_hdmi", |
@@ -1161,7 +1170,7 @@ static struct platform_driver omapdss_hdmihw_driver = { | |||
1161 | 1170 | ||
1162 | int __init hdmi_init_platform_driver(void) | 1171 | int __init hdmi_init_platform_driver(void) |
1163 | { | 1172 | { |
1164 | return platform_driver_probe(&omapdss_hdmihw_driver, omapdss_hdmihw_probe); | 1173 | return platform_driver_register(&omapdss_hdmihw_driver); |
1165 | } | 1174 | } |
1166 | 1175 | ||
1167 | void __exit hdmi_uninit_platform_driver(void) | 1176 | void __exit hdmi_uninit_platform_driver(void) |
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 1a691bb27547..1a17dd1447dc 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c | |||
@@ -943,13 +943,13 @@ void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev) | |||
943 | } | 943 | } |
944 | EXPORT_SYMBOL(omapdss_rfbi_display_disable); | 944 | EXPORT_SYMBOL(omapdss_rfbi_display_disable); |
945 | 945 | ||
946 | static int __init rfbi_init_display(struct omap_dss_device *dssdev) | 946 | static int rfbi_init_display(struct omap_dss_device *dssdev) |
947 | { | 947 | { |
948 | rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev; | 948 | rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev; |
949 | return 0; | 949 | return 0; |
950 | } | 950 | } |
951 | 951 | ||
952 | static struct omap_dss_device * __init rfbi_find_dssdev(struct platform_device *pdev) | 952 | static struct omap_dss_device *rfbi_find_dssdev(struct platform_device *pdev) |
953 | { | 953 | { |
954 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 954 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
955 | const char *def_disp_name = omapdss_get_default_display_name(); | 955 | const char *def_disp_name = omapdss_get_default_display_name(); |
@@ -977,7 +977,7 @@ static struct omap_dss_device * __init rfbi_find_dssdev(struct platform_device * | |||
977 | return def_dssdev; | 977 | return def_dssdev; |
978 | } | 978 | } |
979 | 979 | ||
980 | static void __init rfbi_probe_pdata(struct platform_device *rfbidev) | 980 | static int rfbi_probe_pdata(struct platform_device *rfbidev) |
981 | { | 981 | { |
982 | struct omap_dss_device *plat_dssdev; | 982 | struct omap_dss_device *plat_dssdev; |
983 | struct omap_dss_device *dssdev; | 983 | struct omap_dss_device *dssdev; |
@@ -986,11 +986,11 @@ static void __init rfbi_probe_pdata(struct platform_device *rfbidev) | |||
986 | plat_dssdev = rfbi_find_dssdev(rfbidev); | 986 | plat_dssdev = rfbi_find_dssdev(rfbidev); |
987 | 987 | ||
988 | if (!plat_dssdev) | 988 | if (!plat_dssdev) |
989 | return; | 989 | return 0; |
990 | 990 | ||
991 | dssdev = dss_alloc_and_init_device(&rfbidev->dev); | 991 | dssdev = dss_alloc_and_init_device(&rfbidev->dev); |
992 | if (!dssdev) | 992 | if (!dssdev) |
993 | return; | 993 | return -ENOMEM; |
994 | 994 | ||
995 | dss_copy_device_pdata(dssdev, plat_dssdev); | 995 | dss_copy_device_pdata(dssdev, plat_dssdev); |
996 | 996 | ||
@@ -998,7 +998,7 @@ static void __init rfbi_probe_pdata(struct platform_device *rfbidev) | |||
998 | if (r) { | 998 | if (r) { |
999 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 999 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
1000 | dss_put_device(dssdev); | 1000 | dss_put_device(dssdev); |
1001 | return; | 1001 | return r; |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | r = omapdss_output_set_device(&rfbi.output, dssdev); | 1004 | r = omapdss_output_set_device(&rfbi.output, dssdev); |
@@ -1006,7 +1006,7 @@ static void __init rfbi_probe_pdata(struct platform_device *rfbidev) | |||
1006 | DSSERR("failed to connect output to new device: %s\n", | 1006 | DSSERR("failed to connect output to new device: %s\n", |
1007 | dssdev->name); | 1007 | dssdev->name); |
1008 | dss_put_device(dssdev); | 1008 | dss_put_device(dssdev); |
1009 | return; | 1009 | return r; |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | r = dss_add_device(dssdev); | 1012 | r = dss_add_device(dssdev); |
@@ -1014,11 +1014,13 @@ static void __init rfbi_probe_pdata(struct platform_device *rfbidev) | |||
1014 | DSSERR("device %s register failed: %d\n", dssdev->name, r); | 1014 | DSSERR("device %s register failed: %d\n", dssdev->name, r); |
1015 | omapdss_output_unset_device(&rfbi.output); | 1015 | omapdss_output_unset_device(&rfbi.output); |
1016 | dss_put_device(dssdev); | 1016 | dss_put_device(dssdev); |
1017 | return; | 1017 | return r; |
1018 | } | 1018 | } |
1019 | |||
1020 | return 0; | ||
1019 | } | 1021 | } |
1020 | 1022 | ||
1021 | static void __init rfbi_init_output(struct platform_device *pdev) | 1023 | static void rfbi_init_output(struct platform_device *pdev) |
1022 | { | 1024 | { |
1023 | struct omap_dss_output *out = &rfbi.output; | 1025 | struct omap_dss_output *out = &rfbi.output; |
1024 | 1026 | ||
@@ -1039,7 +1041,7 @@ static void __exit rfbi_uninit_output(struct platform_device *pdev) | |||
1039 | } | 1041 | } |
1040 | 1042 | ||
1041 | /* RFBI HW IP initialisation */ | 1043 | /* RFBI HW IP initialisation */ |
1042 | static int __init omap_rfbihw_probe(struct platform_device *pdev) | 1044 | static int omap_rfbihw_probe(struct platform_device *pdev) |
1043 | { | 1045 | { |
1044 | u32 rev; | 1046 | u32 rev; |
1045 | struct resource *rfbi_mem; | 1047 | struct resource *rfbi_mem; |
@@ -1091,7 +1093,12 @@ static int __init omap_rfbihw_probe(struct platform_device *pdev) | |||
1091 | 1093 | ||
1092 | rfbi_init_output(pdev); | 1094 | rfbi_init_output(pdev); |
1093 | 1095 | ||
1094 | rfbi_probe_pdata(pdev); | 1096 | r = rfbi_probe_pdata(pdev); |
1097 | if (r) { | ||
1098 | rfbi_uninit_output(pdev); | ||
1099 | pm_runtime_disable(&pdev->dev); | ||
1100 | return r; | ||
1101 | } | ||
1095 | 1102 | ||
1096 | return 0; | 1103 | return 0; |
1097 | 1104 | ||
@@ -1135,6 +1142,7 @@ static const struct dev_pm_ops rfbi_pm_ops = { | |||
1135 | }; | 1142 | }; |
1136 | 1143 | ||
1137 | static struct platform_driver omap_rfbihw_driver = { | 1144 | static struct platform_driver omap_rfbihw_driver = { |
1145 | .probe = omap_rfbihw_probe, | ||
1138 | .remove = __exit_p(omap_rfbihw_remove), | 1146 | .remove = __exit_p(omap_rfbihw_remove), |
1139 | .driver = { | 1147 | .driver = { |
1140 | .name = "omapdss_rfbi", | 1148 | .name = "omapdss_rfbi", |
@@ -1145,7 +1153,7 @@ static struct platform_driver omap_rfbihw_driver = { | |||
1145 | 1153 | ||
1146 | int __init rfbi_init_platform_driver(void) | 1154 | int __init rfbi_init_platform_driver(void) |
1147 | { | 1155 | { |
1148 | return platform_driver_probe(&omap_rfbihw_driver, omap_rfbihw_probe); | 1156 | return platform_driver_register(&omap_rfbihw_driver); |
1149 | } | 1157 | } |
1150 | 1158 | ||
1151 | void __exit rfbi_uninit_platform_driver(void) | 1159 | void __exit rfbi_uninit_platform_driver(void) |
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index e6baee2e84f8..0bcd30272f69 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c | |||
@@ -248,7 +248,7 @@ void omapdss_sdi_set_datapairs(struct omap_dss_device *dssdev, int datapairs) | |||
248 | } | 248 | } |
249 | EXPORT_SYMBOL(omapdss_sdi_set_datapairs); | 249 | EXPORT_SYMBOL(omapdss_sdi_set_datapairs); |
250 | 250 | ||
251 | static int __init sdi_init_display(struct omap_dss_device *dssdev) | 251 | static int sdi_init_display(struct omap_dss_device *dssdev) |
252 | { | 252 | { |
253 | DSSDBG("SDI init\n"); | 253 | DSSDBG("SDI init\n"); |
254 | 254 | ||
@@ -268,7 +268,7 @@ static int __init sdi_init_display(struct omap_dss_device *dssdev) | |||
268 | return 0; | 268 | return 0; |
269 | } | 269 | } |
270 | 270 | ||
271 | static struct omap_dss_device * __init sdi_find_dssdev(struct platform_device *pdev) | 271 | static struct omap_dss_device *sdi_find_dssdev(struct platform_device *pdev) |
272 | { | 272 | { |
273 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 273 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
274 | const char *def_disp_name = omapdss_get_default_display_name(); | 274 | const char *def_disp_name = omapdss_get_default_display_name(); |
@@ -296,7 +296,7 @@ static struct omap_dss_device * __init sdi_find_dssdev(struct platform_device *p | |||
296 | return def_dssdev; | 296 | return def_dssdev; |
297 | } | 297 | } |
298 | 298 | ||
299 | static void __init sdi_probe_pdata(struct platform_device *sdidev) | 299 | static int sdi_probe_pdata(struct platform_device *sdidev) |
300 | { | 300 | { |
301 | struct omap_dss_device *plat_dssdev; | 301 | struct omap_dss_device *plat_dssdev; |
302 | struct omap_dss_device *dssdev; | 302 | struct omap_dss_device *dssdev; |
@@ -305,11 +305,11 @@ static void __init sdi_probe_pdata(struct platform_device *sdidev) | |||
305 | plat_dssdev = sdi_find_dssdev(sdidev); | 305 | plat_dssdev = sdi_find_dssdev(sdidev); |
306 | 306 | ||
307 | if (!plat_dssdev) | 307 | if (!plat_dssdev) |
308 | return; | 308 | return 0; |
309 | 309 | ||
310 | dssdev = dss_alloc_and_init_device(&sdidev->dev); | 310 | dssdev = dss_alloc_and_init_device(&sdidev->dev); |
311 | if (!dssdev) | 311 | if (!dssdev) |
312 | return; | 312 | return -ENOMEM; |
313 | 313 | ||
314 | dss_copy_device_pdata(dssdev, plat_dssdev); | 314 | dss_copy_device_pdata(dssdev, plat_dssdev); |
315 | 315 | ||
@@ -317,7 +317,7 @@ static void __init sdi_probe_pdata(struct platform_device *sdidev) | |||
317 | if (r) { | 317 | if (r) { |
318 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 318 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
319 | dss_put_device(dssdev); | 319 | dss_put_device(dssdev); |
320 | return; | 320 | return r; |
321 | } | 321 | } |
322 | 322 | ||
323 | r = omapdss_output_set_device(&sdi.output, dssdev); | 323 | r = omapdss_output_set_device(&sdi.output, dssdev); |
@@ -325,7 +325,7 @@ static void __init sdi_probe_pdata(struct platform_device *sdidev) | |||
325 | DSSERR("failed to connect output to new device: %s\n", | 325 | DSSERR("failed to connect output to new device: %s\n", |
326 | dssdev->name); | 326 | dssdev->name); |
327 | dss_put_device(dssdev); | 327 | dss_put_device(dssdev); |
328 | return; | 328 | return r; |
329 | } | 329 | } |
330 | 330 | ||
331 | r = dss_add_device(dssdev); | 331 | r = dss_add_device(dssdev); |
@@ -333,11 +333,13 @@ static void __init sdi_probe_pdata(struct platform_device *sdidev) | |||
333 | DSSERR("device %s register failed: %d\n", dssdev->name, r); | 333 | DSSERR("device %s register failed: %d\n", dssdev->name, r); |
334 | omapdss_output_unset_device(&sdi.output); | 334 | omapdss_output_unset_device(&sdi.output); |
335 | dss_put_device(dssdev); | 335 | dss_put_device(dssdev); |
336 | return; | 336 | return r; |
337 | } | 337 | } |
338 | |||
339 | return 0; | ||
338 | } | 340 | } |
339 | 341 | ||
340 | static void __init sdi_init_output(struct platform_device *pdev) | 342 | static void sdi_init_output(struct platform_device *pdev) |
341 | { | 343 | { |
342 | struct omap_dss_output *out = &sdi.output; | 344 | struct omap_dss_output *out = &sdi.output; |
343 | 345 | ||
@@ -357,11 +359,17 @@ static void __exit sdi_uninit_output(struct platform_device *pdev) | |||
357 | dss_unregister_output(out); | 359 | dss_unregister_output(out); |
358 | } | 360 | } |
359 | 361 | ||
360 | static int __init omap_sdi_probe(struct platform_device *pdev) | 362 | static int omap_sdi_probe(struct platform_device *pdev) |
361 | { | 363 | { |
364 | int r; | ||
365 | |||
362 | sdi_init_output(pdev); | 366 | sdi_init_output(pdev); |
363 | 367 | ||
364 | sdi_probe_pdata(pdev); | 368 | r = sdi_probe_pdata(pdev); |
369 | if (r) { | ||
370 | sdi_uninit_output(pdev); | ||
371 | return r; | ||
372 | } | ||
365 | 373 | ||
366 | return 0; | 374 | return 0; |
367 | } | 375 | } |
@@ -376,6 +384,7 @@ static int __exit omap_sdi_remove(struct platform_device *pdev) | |||
376 | } | 384 | } |
377 | 385 | ||
378 | static struct platform_driver omap_sdi_driver = { | 386 | static struct platform_driver omap_sdi_driver = { |
387 | .probe = omap_sdi_probe, | ||
379 | .remove = __exit_p(omap_sdi_remove), | 388 | .remove = __exit_p(omap_sdi_remove), |
380 | .driver = { | 389 | .driver = { |
381 | .name = "omapdss_sdi", | 390 | .name = "omapdss_sdi", |
@@ -385,7 +394,7 @@ static struct platform_driver omap_sdi_driver = { | |||
385 | 394 | ||
386 | int __init sdi_init_platform_driver(void) | 395 | int __init sdi_init_platform_driver(void) |
387 | { | 396 | { |
388 | return platform_driver_probe(&omap_sdi_driver, omap_sdi_probe); | 397 | return platform_driver_register(&omap_sdi_driver); |
389 | } | 398 | } |
390 | 399 | ||
391 | void __exit sdi_uninit_platform_driver(void) | 400 | void __exit sdi_uninit_platform_driver(void) |
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index 17764d136398..74fdb3ee209e 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c | |||
@@ -633,7 +633,7 @@ void omapdss_venc_invert_vid_out_polarity(struct omap_dss_device *dssdev, | |||
633 | mutex_unlock(&venc.venc_lock); | 633 | mutex_unlock(&venc.venc_lock); |
634 | } | 634 | } |
635 | 635 | ||
636 | static int __init venc_init_display(struct omap_dss_device *dssdev) | 636 | static int venc_init_display(struct omap_dss_device *dssdev) |
637 | { | 637 | { |
638 | DSSDBG("init_display\n"); | 638 | DSSDBG("init_display\n"); |
639 | 639 | ||
@@ -726,7 +726,7 @@ static int venc_get_clocks(struct platform_device *pdev) | |||
726 | return 0; | 726 | return 0; |
727 | } | 727 | } |
728 | 728 | ||
729 | static struct omap_dss_device * __init venc_find_dssdev(struct platform_device *pdev) | 729 | static struct omap_dss_device *venc_find_dssdev(struct platform_device *pdev) |
730 | { | 730 | { |
731 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 731 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
732 | const char *def_disp_name = omapdss_get_default_display_name(); | 732 | const char *def_disp_name = omapdss_get_default_display_name(); |
@@ -754,7 +754,7 @@ static struct omap_dss_device * __init venc_find_dssdev(struct platform_device * | |||
754 | return def_dssdev; | 754 | return def_dssdev; |
755 | } | 755 | } |
756 | 756 | ||
757 | static void __init venc_probe_pdata(struct platform_device *vencdev) | 757 | static int venc_probe_pdata(struct platform_device *vencdev) |
758 | { | 758 | { |
759 | struct omap_dss_device *plat_dssdev; | 759 | struct omap_dss_device *plat_dssdev; |
760 | struct omap_dss_device *dssdev; | 760 | struct omap_dss_device *dssdev; |
@@ -763,11 +763,11 @@ static void __init venc_probe_pdata(struct platform_device *vencdev) | |||
763 | plat_dssdev = venc_find_dssdev(vencdev); | 763 | plat_dssdev = venc_find_dssdev(vencdev); |
764 | 764 | ||
765 | if (!plat_dssdev) | 765 | if (!plat_dssdev) |
766 | return; | 766 | return 0; |
767 | 767 | ||
768 | dssdev = dss_alloc_and_init_device(&vencdev->dev); | 768 | dssdev = dss_alloc_and_init_device(&vencdev->dev); |
769 | if (!dssdev) | 769 | if (!dssdev) |
770 | return; | 770 | return -ENOMEM; |
771 | 771 | ||
772 | dss_copy_device_pdata(dssdev, plat_dssdev); | 772 | dss_copy_device_pdata(dssdev, plat_dssdev); |
773 | 773 | ||
@@ -775,7 +775,7 @@ static void __init venc_probe_pdata(struct platform_device *vencdev) | |||
775 | if (r) { | 775 | if (r) { |
776 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 776 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
777 | dss_put_device(dssdev); | 777 | dss_put_device(dssdev); |
778 | return; | 778 | return r; |
779 | } | 779 | } |
780 | 780 | ||
781 | r = omapdss_output_set_device(&venc.output, dssdev); | 781 | r = omapdss_output_set_device(&venc.output, dssdev); |
@@ -783,7 +783,7 @@ static void __init venc_probe_pdata(struct platform_device *vencdev) | |||
783 | DSSERR("failed to connect output to new device: %s\n", | 783 | DSSERR("failed to connect output to new device: %s\n", |
784 | dssdev->name); | 784 | dssdev->name); |
785 | dss_put_device(dssdev); | 785 | dss_put_device(dssdev); |
786 | return; | 786 | return r; |
787 | } | 787 | } |
788 | 788 | ||
789 | r = dss_add_device(dssdev); | 789 | r = dss_add_device(dssdev); |
@@ -791,11 +791,13 @@ static void __init venc_probe_pdata(struct platform_device *vencdev) | |||
791 | DSSERR("device %s register failed: %d\n", dssdev->name, r); | 791 | DSSERR("device %s register failed: %d\n", dssdev->name, r); |
792 | omapdss_output_unset_device(&venc.output); | 792 | omapdss_output_unset_device(&venc.output); |
793 | dss_put_device(dssdev); | 793 | dss_put_device(dssdev); |
794 | return; | 794 | return r; |
795 | } | 795 | } |
796 | |||
797 | return 0; | ||
796 | } | 798 | } |
797 | 799 | ||
798 | static void __init venc_init_output(struct platform_device *pdev) | 800 | static void venc_init_output(struct platform_device *pdev) |
799 | { | 801 | { |
800 | struct omap_dss_output *out = &venc.output; | 802 | struct omap_dss_output *out = &venc.output; |
801 | 803 | ||
@@ -816,7 +818,7 @@ static void __exit venc_uninit_output(struct platform_device *pdev) | |||
816 | } | 818 | } |
817 | 819 | ||
818 | /* VENC HW IP initialisation */ | 820 | /* VENC HW IP initialisation */ |
819 | static int __init omap_venchw_probe(struct platform_device *pdev) | 821 | static int omap_venchw_probe(struct platform_device *pdev) |
820 | { | 822 | { |
821 | u8 rev_id; | 823 | u8 rev_id; |
822 | struct resource *venc_mem; | 824 | struct resource *venc_mem; |
@@ -864,7 +866,13 @@ static int __init omap_venchw_probe(struct platform_device *pdev) | |||
864 | 866 | ||
865 | venc_init_output(pdev); | 867 | venc_init_output(pdev); |
866 | 868 | ||
867 | venc_probe_pdata(pdev); | 869 | r = venc_probe_pdata(pdev); |
870 | if (r) { | ||
871 | venc_panel_exit(); | ||
872 | venc_uninit_output(pdev); | ||
873 | pm_runtime_disable(&pdev->dev); | ||
874 | return r; | ||
875 | } | ||
868 | 876 | ||
869 | return 0; | 877 | return 0; |
870 | 878 | ||
@@ -922,6 +930,7 @@ static const struct dev_pm_ops venc_pm_ops = { | |||
922 | }; | 930 | }; |
923 | 931 | ||
924 | static struct platform_driver omap_venchw_driver = { | 932 | static struct platform_driver omap_venchw_driver = { |
933 | .probe = omap_venchw_probe, | ||
925 | .remove = __exit_p(omap_venchw_remove), | 934 | .remove = __exit_p(omap_venchw_remove), |
926 | .driver = { | 935 | .driver = { |
927 | .name = "omapdss_venc", | 936 | .name = "omapdss_venc", |
@@ -932,7 +941,7 @@ static struct platform_driver omap_venchw_driver = { | |||
932 | 941 | ||
933 | int __init venc_init_platform_driver(void) | 942 | int __init venc_init_platform_driver(void) |
934 | { | 943 | { |
935 | return platform_driver_probe(&omap_venchw_driver, omap_venchw_probe); | 944 | return platform_driver_register(&omap_venchw_driver); |
936 | } | 945 | } |
937 | 946 | ||
938 | void __exit venc_uninit_platform_driver(void) | 947 | void __exit venc_uninit_platform_driver(void) |
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index f38348ea3375..ff00d1d8bd26 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -2422,7 +2422,7 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev, | |||
2422 | return 0; | 2422 | return 0; |
2423 | } | 2423 | } |
2424 | 2424 | ||
2425 | static int __init omapfb_probe(struct platform_device *pdev) | 2425 | static int omapfb_probe(struct platform_device *pdev) |
2426 | { | 2426 | { |
2427 | struct omapfb2_device *fbdev = NULL; | 2427 | struct omapfb2_device *fbdev = NULL; |
2428 | int r = 0; | 2428 | int r = 0; |
@@ -2484,7 +2484,7 @@ static int __init omapfb_probe(struct platform_device *pdev) | |||
2484 | 2484 | ||
2485 | if (fbdev->num_displays == 0) { | 2485 | if (fbdev->num_displays == 0) { |
2486 | dev_err(&pdev->dev, "no displays\n"); | 2486 | dev_err(&pdev->dev, "no displays\n"); |
2487 | r = -EINVAL; | 2487 | r = -EPROBE_DEFER; |
2488 | goto cleanup; | 2488 | goto cleanup; |
2489 | } | 2489 | } |
2490 | 2490 | ||
@@ -2595,6 +2595,7 @@ static int __exit omapfb_remove(struct platform_device *pdev) | |||
2595 | } | 2595 | } |
2596 | 2596 | ||
2597 | static struct platform_driver omapfb_driver = { | 2597 | static struct platform_driver omapfb_driver = { |
2598 | .probe = omapfb_probe, | ||
2598 | .remove = __exit_p(omapfb_remove), | 2599 | .remove = __exit_p(omapfb_remove), |
2599 | .driver = { | 2600 | .driver = { |
2600 | .name = "omapfb", | 2601 | .name = "omapfb", |
@@ -2602,36 +2603,13 @@ static struct platform_driver omapfb_driver = { | |||
2602 | }, | 2603 | }, |
2603 | }; | 2604 | }; |
2604 | 2605 | ||
2605 | static int __init omapfb_init(void) | ||
2606 | { | ||
2607 | DBG("omapfb_init\n"); | ||
2608 | |||
2609 | if (platform_driver_probe(&omapfb_driver, omapfb_probe)) { | ||
2610 | printk(KERN_ERR "failed to register omapfb driver\n"); | ||
2611 | return -ENODEV; | ||
2612 | } | ||
2613 | |||
2614 | return 0; | ||
2615 | } | ||
2616 | |||
2617 | static void __exit omapfb_exit(void) | ||
2618 | { | ||
2619 | DBG("omapfb_exit\n"); | ||
2620 | platform_driver_unregister(&omapfb_driver); | ||
2621 | } | ||
2622 | |||
2623 | module_param_named(mode, def_mode, charp, 0); | 2606 | module_param_named(mode, def_mode, charp, 0); |
2624 | module_param_named(vram, def_vram, charp, 0); | 2607 | module_param_named(vram, def_vram, charp, 0); |
2625 | module_param_named(rotate, def_rotate, int, 0); | 2608 | module_param_named(rotate, def_rotate, int, 0); |
2626 | module_param_named(vrfb, def_vrfb, bool, 0); | 2609 | module_param_named(vrfb, def_vrfb, bool, 0); |
2627 | module_param_named(mirror, def_mirror, bool, 0); | 2610 | module_param_named(mirror, def_mirror, bool, 0); |
2628 | 2611 | ||
2629 | /* late_initcall to let panel/ctrl drivers loaded first. | 2612 | module_platform_driver(omapfb_driver); |
2630 | * I guess better option would be a more dynamic approach, | ||
2631 | * so that omapfb reacts to new panels when they are loaded */ | ||
2632 | late_initcall(omapfb_init); | ||
2633 | /*module_init(omapfb_init);*/ | ||
2634 | module_exit(omapfb_exit); | ||
2635 | 2613 | ||
2636 | MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>"); | 2614 | MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>"); |
2637 | MODULE_DESCRIPTION("OMAP2/3 Framebuffer"); | 2615 | MODULE_DESCRIPTION("OMAP2/3 Framebuffer"); |