diff options
Diffstat (limited to 'drivers/video/omap2/dss')
| -rw-r--r-- | drivers/video/omap2/dss/dss.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 2ab1c3e9655..2e74eef92fa 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c | |||
| @@ -792,29 +792,46 @@ static const struct dss_features omap54xx_dss_feats __initconst = { | |||
| 792 | .dpi_select_source = &dss_dpi_select_source_omap5, | 792 | .dpi_select_source = &dss_dpi_select_source_omap5, |
| 793 | }; | 793 | }; |
| 794 | 794 | ||
| 795 | static int __init dss_init_features(struct device *dev) | 795 | static int __init dss_init_features(struct platform_device *pdev) |
| 796 | { | 796 | { |
| 797 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | ||
| 797 | const struct dss_features *src; | 798 | const struct dss_features *src; |
| 798 | struct dss_features *dst; | 799 | struct dss_features *dst; |
| 799 | 800 | ||
| 800 | dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL); | 801 | dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); |
| 801 | if (!dst) { | 802 | if (!dst) { |
| 802 | dev_err(dev, "Failed to allocate local DSS Features\n"); | 803 | dev_err(&pdev->dev, "Failed to allocate local DSS Features\n"); |
| 803 | return -ENOMEM; | 804 | return -ENOMEM; |
| 804 | } | 805 | } |
| 805 | 806 | ||
| 806 | if (cpu_is_omap24xx()) | 807 | switch (pdata->version) { |
| 808 | case OMAPDSS_VER_OMAP24xx: | ||
| 807 | src = &omap24xx_dss_feats; | 809 | src = &omap24xx_dss_feats; |
| 808 | else if (cpu_is_omap34xx()) | 810 | break; |
| 811 | |||
| 812 | case OMAPDSS_VER_OMAP34xx_ES1: | ||
| 813 | case OMAPDSS_VER_OMAP34xx_ES3: | ||
| 814 | case OMAPDSS_VER_AM35xx: | ||
| 809 | src = &omap34xx_dss_feats; | 815 | src = &omap34xx_dss_feats; |
| 810 | else if (cpu_is_omap3630()) | 816 | break; |
| 817 | |||
| 818 | case OMAPDSS_VER_OMAP3630: | ||
| 811 | src = &omap3630_dss_feats; | 819 | src = &omap3630_dss_feats; |
| 812 | else if (cpu_is_omap44xx()) | 820 | break; |
| 821 | |||
| 822 | case OMAPDSS_VER_OMAP4430_ES1: | ||
| 823 | case OMAPDSS_VER_OMAP4430_ES2: | ||
| 824 | case OMAPDSS_VER_OMAP4: | ||
| 813 | src = &omap44xx_dss_feats; | 825 | src = &omap44xx_dss_feats; |
| 814 | else if (soc_is_omap54xx()) | 826 | break; |
| 827 | |||
| 828 | case OMAPDSS_VER_OMAP5: | ||
| 815 | src = &omap54xx_dss_feats; | 829 | src = &omap54xx_dss_feats; |
| 816 | else | 830 | break; |
| 831 | |||
| 832 | default: | ||
| 817 | return -ENODEV; | 833 | return -ENODEV; |
| 834 | } | ||
| 818 | 835 | ||
| 819 | memcpy(dst, src, sizeof(*dst)); | 836 | memcpy(dst, src, sizeof(*dst)); |
| 820 | dss.feat = dst; | 837 | dss.feat = dst; |
| @@ -831,7 +848,7 @@ static int __init omap_dsshw_probe(struct platform_device *pdev) | |||
| 831 | 848 | ||
| 832 | dss.pdev = pdev; | 849 | dss.pdev = pdev; |
| 833 | 850 | ||
| 834 | r = dss_init_features(&dss.pdev->dev); | 851 | r = dss_init_features(dss.pdev); |
| 835 | if (r) | 852 | if (r) |
| 836 | return r; | 853 | return r; |
| 837 | 854 | ||
