diff options
Diffstat (limited to 'drivers/video/omap2/dss/dsi.c')
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 35 |
1 files changed, 22 insertions, 13 deletions
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) |