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