diff options
Diffstat (limited to 'drivers/video/omap2/dss/dss.c')
| -rw-r--r-- | drivers/video/omap2/dss/dss.c | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 77c3621c9171..01406f48f438 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c | |||
| @@ -59,6 +59,7 @@ struct dss_reg { | |||
| 59 | dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end)) | 59 | dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end)) |
| 60 | 60 | ||
| 61 | static struct { | 61 | static struct { |
| 62 | struct platform_device *pdev; | ||
| 62 | void __iomem *base; | 63 | void __iomem *base; |
| 63 | 64 | ||
| 64 | struct clk *dpll4_m4_ck; | 65 | struct clk *dpll4_m4_ck; |
| @@ -549,7 +550,7 @@ void dss_set_dac_pwrdn_bgz(bool enable) | |||
| 549 | REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */ | 550 | REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */ |
| 550 | } | 551 | } |
| 551 | 552 | ||
| 552 | int dss_init(bool skip_init) | 553 | static int dss_init(bool skip_init) |
| 553 | { | 554 | { |
| 554 | int r; | 555 | int r; |
| 555 | u32 rev; | 556 | u32 rev; |
| @@ -629,7 +630,7 @@ fail0: | |||
| 629 | return r; | 630 | return r; |
| 630 | } | 631 | } |
| 631 | 632 | ||
| 632 | void dss_exit(void) | 633 | static void dss_exit(void) |
| 633 | { | 634 | { |
| 634 | if (cpu_is_omap34xx()) | 635 | if (cpu_is_omap34xx()) |
| 635 | clk_put(dss.dpll4_m4_ck); | 636 | clk_put(dss.dpll4_m4_ck); |
| @@ -639,3 +640,53 @@ void dss_exit(void) | |||
| 639 | iounmap(dss.base); | 640 | iounmap(dss.base); |
| 640 | } | 641 | } |
| 641 | 642 | ||
| 643 | /* DSS HW IP initialisation */ | ||
| 644 | static int omap_dsshw_probe(struct platform_device *pdev) | ||
| 645 | { | ||
| 646 | int r; | ||
| 647 | int skip_init = 0; | ||
| 648 | |||
| 649 | dss.pdev = pdev; | ||
| 650 | |||
| 651 | #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT | ||
| 652 | /* DISPC_CONTROL */ | ||
| 653 | if (omap_readl(0x48050440) & 1) /* LCD enabled? */ | ||
| 654 | skip_init = 1; | ||
| 655 | #endif | ||
| 656 | |||
| 657 | r = dss_init(skip_init); | ||
| 658 | if (r) { | ||
| 659 | DSSERR("Failed to initialize DSS\n"); | ||
| 660 | goto err_dss; | ||
| 661 | } | ||
| 662 | |||
| 663 | err_dss: | ||
| 664 | |||
| 665 | return r; | ||
| 666 | } | ||
| 667 | |||
| 668 | static int omap_dsshw_remove(struct platform_device *pdev) | ||
| 669 | { | ||
| 670 | dss_exit(); | ||
| 671 | |||
| 672 | return 0; | ||
| 673 | } | ||
| 674 | |||
| 675 | static struct platform_driver omap_dsshw_driver = { | ||
| 676 | .probe = omap_dsshw_probe, | ||
| 677 | .remove = omap_dsshw_remove, | ||
| 678 | .driver = { | ||
| 679 | .name = "omapdss_dss", | ||
| 680 | .owner = THIS_MODULE, | ||
| 681 | }, | ||
| 682 | }; | ||
| 683 | |||
| 684 | int dss_init_platform_driver(void) | ||
| 685 | { | ||
| 686 | return platform_driver_register(&omap_dsshw_driver); | ||
| 687 | } | ||
| 688 | |||
| 689 | void dss_uninit_platform_driver(void) | ||
| 690 | { | ||
| 691 | return platform_driver_unregister(&omap_dsshw_driver); | ||
| 692 | } | ||
